mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-12 14:40:22 +08:00
refactor(editor): remove global types in model (#10082)
Closes: [BS-2249](https://linear.app/affine-design/issue/BS-2249/remove-global-types-in-model) ```ts // before matchFlavours(model, ['affine:page']); // after matchFlavours(model, [PageBlockModel]); ```
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { SchemaToModel, Text } from '@blocksuite/store';
|
||||
import { defineBlockSchema } from '@blocksuite/store';
|
||||
import type { Text } from '@blocksuite/store';
|
||||
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
|
||||
|
||||
// `toggle` type has been deprecated, do not use it
|
||||
export type ListType = 'bulleted' | 'numbered' | 'todo' | 'toggle';
|
||||
@@ -35,9 +35,12 @@ export const ListBlockSchema = defineBlockSchema({
|
||||
'affine:edgeless-text',
|
||||
],
|
||||
},
|
||||
toModel: () => new ListBlockModel(),
|
||||
});
|
||||
|
||||
export type ListBlockModel = SchemaToModel<typeof ListBlockSchema>;
|
||||
export class ListBlockModel extends BlockModel<ListProps> {
|
||||
override text!: Text;
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace BlockSuite {
|
||||
|
||||
Reference in New Issue
Block a user