import type { ColumnDataType } from '@blocksuite/affine-model'; import type { InsertToPosition } from '@blocksuite/affine-shared/utils'; import { Container, type GeneralServiceIdentifier, type ServiceProvider } from '@blocksuite/global/di'; import { type ReadonlySignal } from '@preact/signals-core'; import type { TypeInstance } from '../logical/type.js'; import type { PropertyMetaConfig } from '../property/property-config.js'; import type { DatabaseFlags } from '../types.js'; import type { ViewConvertConfig } from '../view/convert.js'; import type { DataViewDataType, ViewMeta } from '../view/data-view.js'; import type { ViewManager } from '../view-manager/view-manager.js'; export interface DataSource { readonly$: ReadonlySignal; properties$: ReadonlySignal; featureFlags$: ReadonlySignal; cellValueGet(rowId: string, propertyId: string): unknown; cellValueGet$(rowId: string, propertyId: string): ReadonlySignal; cellValueChange(rowId: string, propertyId: string, value: unknown): void; rows$: ReadonlySignal; rowAdd(InsertToPosition: InsertToPosition | number): string; rowDelete(ids: string[]): void; rowMove(rowId: string, position: InsertToPosition): void; propertyMetas$: ReadonlySignal; allPropertyMetas$: ReadonlySignal; propertyNameGet$(propertyId: string): ReadonlySignal; propertyNameGet(propertyId: string): string; propertyNameSet(propertyId: string, name: string): void; propertyTypeGet(propertyId: string): string | undefined; propertyTypeGet$(propertyId: string): ReadonlySignal; propertyTypeSet(propertyId: string, type: string): void; propertyTypeCanSet(propertyId: string): boolean; propertyDataGet(propertyId: string): Record; propertyDataGet$(propertyId: string): ReadonlySignal | undefined>; propertyDataSet(propertyId: string, data: Record): void; propertyDataTypeGet(propertyId: string): TypeInstance | undefined; propertyDataTypeGet$(propertyId: string): ReadonlySignal; propertyReadonlyGet(propertyId: string): boolean; propertyReadonlyGet$(propertyId: string): ReadonlySignal; propertyMetaGet(type: string): PropertyMetaConfig | undefined; propertyAdd(insertToPosition: InsertToPosition, ops?: { type?: string; name?: string; }): string | undefined; propertyDuplicate(propertyId: string): string | undefined; propertyCanDuplicate(propertyId: string): boolean; propertyDelete(id: string): void; propertyCanDelete(propertyId: string): boolean; provider: ServiceProvider; serviceGet(key: GeneralServiceIdentifier): T | null; serviceGetOrCreate(key: GeneralServiceIdentifier, create: () => T): T; viewConverts: ViewConvertConfig[]; viewManager: ViewManager; viewMetas: ViewMeta[]; viewDataList$: ReadonlySignal; viewDataGet(viewId: string): DataViewDataType | undefined; viewDataGet$(viewId: string): ReadonlySignal; viewDataAdd(viewData: DataViewDataType): string; viewDataDuplicate(id: string): string; viewDataDelete(viewId: string): void; viewDataMoveTo(id: string, position: InsertToPosition): void; viewDataUpdate(id: string, updater: (data: ViewData) => Partial): void; viewMetaGet(type: string): ViewMeta; viewMetaGet$(type: string): ReadonlySignal; viewMetaGetById(viewId: string): ViewMeta | undefined; viewMetaGetById$(viewId: string): ReadonlySignal; } export declare const DataSourceScope: import("@blocksuite/global/di").ServiceScope; export declare abstract class DataSourceBase implements DataSource { propertyTypeCanSet(propertyId: string): boolean; propertyCanDuplicate(propertyId: string): boolean; propertyCanDelete(propertyId: string): boolean; protected container: Container; abstract get parentProvider(): ServiceProvider; abstract featureFlags$: ReadonlySignal; abstract properties$: ReadonlySignal; abstract propertyMetas$: ReadonlySignal; abstract allPropertyMetas$: ReadonlySignal; abstract readonly$: ReadonlySignal; abstract rows$: ReadonlySignal; abstract viewConverts: ViewConvertConfig[]; abstract viewDataList$: ReadonlySignal; abstract viewManager: ViewManager; abstract viewMetas: ViewMeta[]; abstract cellValueChange(rowId: string, propertyId: string, value: unknown): void; abstract cellValueChange(rowId: string, propertyId: string, value: unknown): void; abstract cellValueGet(rowId: string, propertyId: string): unknown; cellValueGet$(rowId: string, propertyId: string): ReadonlySignal; get provider(): ServiceProvider; serviceGet(key: GeneralServiceIdentifier): T | null; serviceSet(key: GeneralServiceIdentifier, value: T): void; serviceGetOrCreate(key: GeneralServiceIdentifier, create: () => T): T; abstract propertyAdd(insertToPosition: InsertToPosition, ops?: { type?: string; name?: string; }): string | undefined; abstract propertyDataGet(propertyId: string): Record; propertyDataGet$(propertyId: string): ReadonlySignal | undefined>; abstract propertyDataSet(propertyId: string, data: Record): void; abstract propertyDataTypeGet(propertyId: string): TypeInstance | undefined; propertyDataTypeGet$(propertyId: string): ReadonlySignal; abstract propertyDelete(id: string): void; abstract propertyDuplicate(propertyId: string): string | undefined; abstract propertyMetaGet(type: string): PropertyMetaConfig | undefined; abstract propertyNameGet(propertyId: string): string; propertyNameGet$(propertyId: string): ReadonlySignal; abstract propertyNameSet(propertyId: string, name: string): void; propertyReadonlyGet(_propertyId: string): boolean; propertyReadonlyGet$(propertyId: string): ReadonlySignal; abstract propertyTypeGet(propertyId: string): string | undefined; propertyTypeGet$(propertyId: string): ReadonlySignal; abstract propertyTypeSet(propertyId: string, type: string): void; abstract rowAdd(InsertToPosition: InsertToPosition | number): string; abstract rowDelete(ids: string[]): void; abstract rowMove(rowId: string, position: InsertToPosition): void; abstract viewDataAdd(viewData: DataViewDataType): string; abstract viewDataDelete(viewId: string): void; abstract viewDataDuplicate(id: string): string; abstract viewDataGet(viewId: string): DataViewDataType | undefined; viewDataGet$(viewId: string): ReadonlySignal; abstract viewDataMoveTo(id: string, position: InsertToPosition): void; abstract viewDataUpdate(id: string, updater: (data: ViewData) => Partial): void; abstract viewMetaGet(type: string): ViewMeta; viewMetaGet$(type: string): ReadonlySignal; abstract viewMetaGetById(viewId: string): ViewMeta | undefined; viewMetaGetById$(viewId: string): ReadonlySignal; fixedProperties$: ReadonlySignal; fixedPropertySet: ReadonlySignal>; protected abstract getNormalPropertyAndIndex(propertyId: string): { column: ColumnDataType>; index: number; } | undefined; isFixedProperty(propertyId: string): boolean; } //# sourceMappingURL=base.d.ts.map