mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 10:45:57 +08:00
refactor(editor): add schema for value of database block properties (#10749)
This commit is contained in:
@@ -197,7 +197,7 @@ export abstract class DataSourceBase implements DataSource {
|
||||
return computed(() => this.propertyReadonlyGet(propertyId));
|
||||
}
|
||||
|
||||
abstract propertyTypeGet(propertyId: string): string;
|
||||
abstract propertyTypeGet(propertyId: string): string | undefined;
|
||||
|
||||
propertyTypeGet$(propertyId: string): ReadonlySignal<string | undefined> {
|
||||
return computed(() => this.propertyTypeGet(propertyId));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Disposable } from '@blocksuite/global/slot';
|
||||
import type { ZodType } from 'zod';
|
||||
|
||||
import type { DataSource } from '../data-source/base.js';
|
||||
import type { TypeInstance } from '../logical/type.js';
|
||||
@@ -15,6 +16,7 @@ export type PropertyConfig<
|
||||
Value = unknown,
|
||||
> = {
|
||||
name: string;
|
||||
valueSchema: ZodType<Value>;
|
||||
hide?: boolean;
|
||||
fixed?: {
|
||||
defaultData: Data;
|
||||
|
||||
Reference in New Issue
Block a user