@blocksuite/global
Advanced tools
Comparing version 0.5.0-20230402001300-4b31439f to 0.5.0-20230402081609-679ed3e9
@@ -7,39 +7,12 @@ export interface RowHost<Value = unknown> extends HTMLElement { | ||
} | ||
export interface SchemaInternalProperty { | ||
/** | ||
* color of the column | ||
*/ | ||
color: `#${string}`; | ||
/** | ||
* width of a column | ||
*/ | ||
export type ColumnSchemaType = 'rich-text' | 'select' | 'multi-select' | 'number' | 'progress'; | ||
export interface ColumnSchema extends Record<string, unknown> { | ||
id: string; | ||
type: ColumnSchemaType; | ||
width: number; | ||
/** | ||
* whether this display in the table | ||
*/ | ||
hide: boolean; | ||
} | ||
export type ColumnSchemaProperty<Property extends Record<string, unknown>> = Property; | ||
export type ColumnSchemaType = 'rich-text' | 'select' | 'multi-select' | 'number' | 'progress'; | ||
export interface ColumnSchema<Type extends ColumnSchemaType = ColumnSchemaType, Property extends Record<string, unknown> = Record<string, unknown>, BaseValue = unknown> { | ||
/** | ||
* each instance of tag type has its own unique uuid | ||
*/ | ||
id: string; | ||
type: Type; | ||
/** | ||
* column name | ||
*/ | ||
name: string; | ||
internalProperty: SchemaInternalProperty; | ||
property: ColumnSchemaProperty<Property>; | ||
/** | ||
* this value is just for hold the `BaseValue`, | ||
* don't use this value in the runtime. | ||
*/ | ||
__$TYPE_HOLDER$__?: BaseValue; | ||
} | ||
export type BlockColumn<Schema extends ColumnSchema = ColumnSchema> = { | ||
columnId: Schema['id']; | ||
value: Schema extends ColumnSchema<infer _, infer __, infer Value> ? Value : never; | ||
export type BlockColumn = { | ||
columnId: ColumnSchema['id']; | ||
value: unknown; | ||
}; | ||
@@ -46,0 +19,0 @@ export declare const enum ColumnInsertPosition { |
{ | ||
"name": "@blocksuite/global", | ||
"version": "0.5.0-20230402001300-4b31439f", | ||
"version": "0.5.0-20230402081609-679ed3e9", | ||
"types": "./index.d.ts", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -10,20 +10,2 @@ export interface RowHost<Value = unknown> extends HTMLElement { | ||
export interface SchemaInternalProperty { | ||
/** | ||
* color of the column | ||
*/ | ||
color: `#${string}`; | ||
/** | ||
* width of a column | ||
*/ | ||
width: number; // px | ||
/** | ||
* whether this display in the table | ||
*/ | ||
hide: boolean; | ||
} | ||
export type ColumnSchemaProperty<Property extends Record<string, unknown>> = | ||
Property; | ||
export type ColumnSchemaType = | ||
@@ -36,30 +18,12 @@ | 'rich-text' | ||
export interface ColumnSchema< | ||
Type extends ColumnSchemaType = ColumnSchemaType, | ||
Property extends Record<string, unknown> = Record<string, unknown>, | ||
BaseValue = unknown | ||
> { | ||
/** | ||
* each instance of tag type has its own unique uuid | ||
*/ | ||
export interface ColumnSchema extends Record<string, unknown> { | ||
id: string; | ||
type: Type; | ||
/** | ||
* column name | ||
*/ | ||
name: string; | ||
internalProperty: SchemaInternalProperty; | ||
property: ColumnSchemaProperty<Property>; | ||
/** | ||
* this value is just for hold the `BaseValue`, | ||
* don't use this value in the runtime. | ||
*/ | ||
__$TYPE_HOLDER$__?: BaseValue; | ||
type: ColumnSchemaType; | ||
width: number; // px | ||
hide: boolean; | ||
} | ||
export type BlockColumn<Schema extends ColumnSchema = ColumnSchema> = { | ||
columnId: Schema['id']; | ||
value: Schema extends ColumnSchema<infer _, infer __, infer Value> | ||
? Value | ||
: never; | ||
export type BlockColumn = { | ||
columnId: ColumnSchema['id']; | ||
value: unknown; | ||
}; | ||
@@ -66,0 +30,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
474941
5447