@blocksuite/global
Advanced tools
Comparing version 0.5.0-20230227215422-5b7fc14 to 0.5.0-20230228075503-02b693a
@@ -104,58 +104,1 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| 'h6'; | ||
declare namespace BlockSuiteModelProps { | ||
import type { Text } from '@blocksuite/store'; | ||
interface CodeBlockModel { | ||
language: string; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
interface DividerBlockModel {} | ||
interface EmbedBlockModel { | ||
type: EmbedType; | ||
sourceId: string; | ||
width?: number; | ||
height?: number; | ||
caption?: string; | ||
} | ||
interface FrameBlockModel { | ||
xywh: string; | ||
} | ||
interface ListBlockModel { | ||
type: ListType; | ||
checked: boolean; | ||
} | ||
interface PageBlockModel { | ||
title: Text; | ||
} | ||
interface ParagraphBlockModel { | ||
type: ParagraphType; | ||
} | ||
import type { ColorStyle, TDShapeType } from '@blocksuite/blocks'; | ||
interface DatabaseBlockModel { | ||
columns: BlockSuiteInternal.ColumnTypes[]; | ||
title: string; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
interface SurfaceBlockModel {} | ||
export type ALL = { | ||
'affine:database': DatabaseBlockModel; | ||
'affine:paragraph': ParagraphBlockModel; | ||
'affine:page': PageBlockModel; | ||
'affine:list': ListBlockModel; | ||
'affine:frame': FrameBlockModel; | ||
'affine:code': CodeBlockModel; | ||
'affine:divider': DividerBlockModel; | ||
'affine:embed': EmbedBlockModel; | ||
'affine:surface': SurfaceBlockModel; | ||
}; | ||
} |
{ | ||
"name": "@blocksuite/global", | ||
"version": "0.5.0-20230227215422-5b7fc14", | ||
"version": "0.5.0-20230228075503-02b693a", | ||
"types": "./index.d.ts", | ||
@@ -5,0 +5,0 @@ "type": "module", |
import type { TemplateResult } from 'lit/html.js'; | ||
import type { BlockModelProps } from '../../types.js'; | ||
import { | ||
@@ -22,3 +23,3 @@ BulletedListIcon, | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
ALLProps extends Record<string, any> = BlockSuiteModelProps.ALL, | ||
ALLProps extends Record<string, any> = BlockModelProps, | ||
Flavour extends keyof ALLProps & string = keyof ALLProps & string | ||
@@ -25,0 +26,0 @@ > = { |
import type { | ||
CodeBlockModelSchema, | ||
DatabaseBlockModelSchema, | ||
DividerBlockModelSchema, | ||
EmbedBlockModelSchema, | ||
FrameBlockModelSchema, | ||
ListBlockModelSchema, | ||
PageBlockModelSchema, | ||
ParagraphBlockModelSchema, | ||
SurfaceBlockModelSchema, | ||
} from '@blocksuite/blocks'; | ||
import type { | ||
// Model | ||
@@ -14,2 +25,14 @@ CodeBlockModel, | ||
export type BlockSchemas = { | ||
'affine:paragraph': typeof ParagraphBlockModelSchema; | ||
'affine:page': typeof PageBlockModelSchema; | ||
'affine:list': typeof ListBlockModelSchema; | ||
'affine:frame': typeof FrameBlockModelSchema; | ||
'affine:code': typeof CodeBlockModelSchema; | ||
'affine:divider': typeof DividerBlockModelSchema; | ||
'affine:embed': typeof EmbedBlockModelSchema; | ||
'affine:surface': typeof SurfaceBlockModelSchema; | ||
'affine:database': typeof DatabaseBlockModelSchema; | ||
}; | ||
export type BlockModels = { | ||
@@ -26,1 +49,5 @@ 'affine:paragraph': ParagraphBlockModel; | ||
}; | ||
export type BlockModelProps = { | ||
[K in keyof BlockSchemas]: ReturnType<BlockSchemas[K]['model']['props']>; | ||
}; |
31
124415
2216
6