mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +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,4 +1,4 @@
|
||||
import { defineBlockSchema, type SchemaToModel } from '@blocksuite/store';
|
||||
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
|
||||
|
||||
export type SurfaceRefProps = {
|
||||
reference: string;
|
||||
@@ -18,9 +18,10 @@ export const SurfaceRefBlockSchema = defineBlockSchema({
|
||||
role: 'content',
|
||||
parent: ['affine:note', 'affine:paragraph', 'affine:list'],
|
||||
},
|
||||
toModel: () => new SurfaceRefBlockModel(),
|
||||
});
|
||||
|
||||
export type SurfaceRefBlockModel = SchemaToModel<typeof SurfaceRefBlockSchema>;
|
||||
export class SurfaceRefBlockModel extends BlockModel<SurfaceRefProps> {}
|
||||
|
||||
declare global {
|
||||
namespace BlockSuite {
|
||||
|
||||
Reference in New Issue
Block a user