import { EntityDict, Context, DeduceUpdateOperation, StorageSchema, OpRecord, SelectRowShape, DeduceOperation, AspectWrapper } from "oak-domain/lib/types"; import { CommonAspectDict } from 'oak-common-aspect'; import { NamedFilterItem, NamedSorterItem } from "../types/NamedCondition"; import { Cache } from './cache'; import { Pagination } from '../types/Pagination'; import { Feature } from '../types/Feature'; declare abstract class Node, AD extends CommonAspectDict> { protected entity: T; protected schema: StorageSchema; protected projection: ED[T]['Selection']['data'] | (() => Promise); protected parent?: Node; protected action?: ED[T]['Action']; protected dirty: boolean; protected updateData: DeduceUpdateOperation['data']; protected cache: Cache; protected refreshing: boolean; private beforeExecute?; private afterExecute?; abstract onCacheSync(opRecords: OpRecord[]): Promise; abstract refreshValue(): void; constructor(entity: T, schema: StorageSchema, cache: Cache, projection: ED[T]['Selection']['data'] | (() => Promise), parent?: Node, action?: ED[T]['Action'], updateData?: DeduceUpdateOperation['data']); getEntity(): T; protected abstract setForeignKey(attr: string, entity: keyof ED, id: string | undefined): void; private setLocalUpdateData; setUpdateData(attr: string, value: any): void; getUpdateData(): import("oak-domain/lib/types").DeduceUpdateOperationData; setMultiUpdateData(updateData: DeduceUpdateOperation['data']): void; setDirty(): void; setAction(action: ED[T]['Action']): void; isDirty(): boolean; getParent(): Node | undefined; getProjection(): Promise; setBeforeExecute(_beforeExecute?: (updateData: DeduceUpdateOperation['data'], action: ED[T]['Action']) => Promise): void; setAfterExecute(_afterExecute?: (updateData: DeduceUpdateOperation['data'], action: ED[T]['Action']) => Promise): void; getBeforeExecute(): ((updateData: import("oak-domain/lib/types").DeduceUpdateOperationData, action: ED[T]["Action"]) => Promise) | undefined; getAfterExecute(): ((updateData: import("oak-domain/lib/types").DeduceUpdateOperationData, action: ED[T]["Action"]) => Promise) | undefined; destroy(): void; protected judgeRelation(attr: string): string | 0 | 2 | string[] | 1; protected contains(filter: ED[T]['Selection']['filter'], conditionalFilter: ED[T]['Selection']['filter']): boolean; protected repel(filter1: ED[T]['Selection']['filter'], filter2: ED[T]['Selection']['filter']): boolean; } declare class ListNode, AD extends CommonAspectDict> extends Node { private children; private newBorn; private filters; private sorters; private pagination; private projectionShape; onCacheSync(records: OpRecord[]): Promise; setForeignKey(attr: string, entity: keyof ED, id: string | undefined): Promise; refreshValue(): void; constructor(entity: T, schema: StorageSchema, cache: Cache, projection: ED[T]['Selection']['data'] | (() => Promise), projectionShape: ED[T]['Selection']['data'], parent?: Node, action?: ED[T]['Action'], updateData?: DeduceUpdateOperation['data'], filters?: NamedFilterItem[], sorters?: NamedSorterItem[], pagination?: Pagination); getPagination(): Pagination; setPageSize(pageSize: number): void; getChild(path: string, newBorn?: true): SingleNode | undefined; getChildren(): SingleNode[]; getNewBorn(): SingleNode[]; removeChild(path: string): void; setValue(value: SelectRowShape[] | undefined): void; private appendValue; getNamedFilters(): NamedFilterItem[]; getNamedFilterByName(name: string): NamedFilterItem | undefined; setNamedFilters(filters: NamedFilterItem[]): void; addNamedFilter(filter: NamedFilterItem): void; removeNamedFilter(filter: NamedFilterItem): void; removeNamedFilterByName(name: string): void; getNamedSorters(): NamedSorterItem[]; getNamedSorterByName(name: string): NamedSorterItem | undefined; setNamedSorters(sorters: NamedSorterItem[]): void; addNamedSorter(sorter: NamedSorterItem): void; removeNamedSorter(sorter: NamedSorterItem): void; removeNamedSorterByName(name: string): void; getFreshValue(): Array | undefined>; getAction(): "update" | ED[T]["Action"]; composeOperation(action?: string, execute?: boolean): Promise | DeduceOperation[] | undefined>; refresh(): Promise; loadMore(): Promise; resetUpdateData(): void; pushNewBorn(options: Pick, 'updateData' | 'beforeExecute' | 'afterExecute'>): SingleNode; popNewBorn(path: string): void; /** * 判断传入的updateData和当前的某项是否相等 * @param from 当前项 * @param to 传入项 * @returns */ private judgeTheSame; setUniqueChildren(data: Pick, 'updateData' | 'beforeExecute' | 'afterExecute'>[]): void; toggleChild(data: Pick, 'updateData' | 'beforeExecute' | 'afterExecute'>, checked: boolean): void; } declare class SingleNode, AD extends CommonAspectDict> extends Node { private id?; private value?; private freshValue?; private children; onCacheSync(records: OpRecord[]): Promise; constructor(entity: T, schema: StorageSchema, cache: Cache, projection: ED[T]['Selection']['data'] | (() => Promise), projectionShape: ED[T]['Selection']['data'], parent?: Node, action?: ED[T]['Action'], updateData?: DeduceUpdateOperation['data']); getChild(path: string): SingleNode | ListNode; getChildren(): { [K: string]: SingleNode | ListNode; }; removeChild(path: string): void; refreshValue(): void; setValue(value: SelectRowShape | undefined): void; getFreshValue(ignoreRemoved?: boolean): (SelectRowShape & Partial> & { [k: string]: any; }) | SelectRowShape | undefined; getAction(): "create" | "update" | ED[T]["Action"]; composeOperation(action2?: string, execute?: boolean): Promise | DeduceUpdateOperation | undefined>; refresh(scene: string): Promise; resetUpdateData(attrs?: string[]): void; setForeignKey(attr: string, entity: keyof ED, id: string | undefined): Promise; } export declare type CreateNodeOptions = { path: string; parent?: string; entity: T; isList?: boolean; isPicker?: boolean; projection: ED[T]['Selection']['data'] | (() => Promise); pagination?: Pagination; filters?: NamedFilterItem[]; sorters?: NamedSorterItem[]; action?: ED[T]['Action']; id?: string; ids?: string[]; updateData?: DeduceUpdateOperation['data']; beforeExecute?: (updateData: DeduceUpdateOperation['data'], action: ED[T]['Action']) => Promise; afterExecute?: (updateData: DeduceUpdateOperation['data'], action: ED[T]['Action']) => Promise; }; export declare class RunningTree, AD extends CommonAspectDict> extends Feature { private cache; private schema; private root; constructor(aspectWrapper: AspectWrapper, cache: Cache, schema: StorageSchema); createNode(options: CreateNodeOptions): Promise | SingleNode>; private findNode; destroyNode(path: string): void; private applyOperation; getFreshValue(path: string): (SelectRowShape & Partial> & { [k: string]: any; }) | SelectRowShape | (SelectRowShape | undefined)[] | undefined; isDirty(path: string): boolean; private setUpdateDataInner; setUpdateData(path: string, attr: string, value: any): Promise; setAction(path: string, action: ED[T]['Action']): Promise; setForeignKey(parent: string, attr: string, id: string | undefined): void; addForeignKeys(parent: string, attr: string, ids: string[]): void; setUniqueForeignKeys(parent: string, attr: string, ids: string[]): void; refresh(path: string): Promise; loadMore(path: string): Promise; getPagination(path: string): Pagination; setPageSize(path: string, pageSize: number): void; getNamedFilters(path: string): NamedFilterItem[]; getNamedFilterByName(path: string, name: string): NamedFilterItem | undefined; setNamedFilters(path: string, filters: NamedFilterItem[], refresh?: boolean): Promise; addNamedFilter(path: string, filter: NamedFilterItem, refresh?: boolean): Promise; removeNamedFilter(path: string, filter: NamedFilterItem, refresh?: boolean): Promise; removeNamedFilterByName(path: string, name: string, refresh?: boolean): Promise; getNamedSorters(path: string): NamedSorterItem[]; getNamedSorterByName(path: string, name: string): NamedSorterItem | undefined; setNamedSorters(path: string, sorters: NamedSorterItem[], refresh?: boolean): Promise; addNamedSorter(path: string, sorter: NamedSorterItem, refresh?: boolean): Promise; removeNamedSorter(path: string, sorter: NamedSorterItem, refresh?: boolean): Promise; removeNamedSorterByName(path: string, name: string, refresh?: boolean): Promise; testAction(path: string, action?: string, execute?: boolean): Promise<{ node: SingleNode | ListNode; operation: DeduceOperation | DeduceOperation[]; }>; private beforeExecute; execute(path: string, action?: string): Promise | DeduceOperation[]>; pushNode(path: string, options: Pick, 'updateData' | 'beforeExecute' | 'afterExecute'>): void; removeNode(parent: string, path: string): Promise; resetUpdateData(path: string): void; toggleNode(path: string, nodeData: Record, checked: boolean): void; getRoot(): Record | ListNode>; } export {};