import { ReadOnlyAction } from '../actions/action'; import { PrimaryKey, Sequence } from './DataType'; declare type TriggerDataAttributeType = '$$triggerData$$'; declare type TriggerTimestampAttributeType = '$$triggerTimestamp$$'; declare type PrimaryKeyAttributeType = 'id'; declare type CreateAtAttributeType = '$$createAt$$'; declare type UpdateAtAttributeType = '$$updateAt$$'; declare type DeleteAtAttributeType = '$$deleteAt$$'; declare type SeqAttributeType = '$$seq$$'; export declare const TriggerDataAttribute = "$$triggerData$$"; export declare const TriggerTimestampAttribute = "$$triggerTimestamp$$"; export declare const PrimaryKeyAttribute = "id"; export declare const CreateAtAttribute = "$$createAt$$"; export declare const UpdateAtAttribute = "$$updateAt$$"; export declare const DeleteAtAttribute = "$$deleteAt$$"; export declare const SeqAttribute = "$$seq$$"; export declare type InstinctiveAttributes = PrimaryKeyAttributeType | CreateAtAttributeType | UpdateAtAttributeType | DeleteAtAttributeType | TriggerDataAttributeType | TriggerTimestampAttributeType | SeqAttributeType; export declare const initinctiveAttributes: string[]; declare type FilterPart = { filter?: A extends 'create' ? undefined : F; indexFrom?: A extends 'create' ? undefined : number; count?: A extends 'create' ? undefined : number; }; export declare type SelectOption = { dontCollect?: boolean; blockTrigger?: true; obscure?: boolean; forUpdate?: true; includedDeleted?: true; dummy?: 1; }; export declare type OperateOption = { blockTrigger?: true; dontCollect?: boolean; dontCreateOper?: boolean; dontCreateModi?: boolean; allowExists?: boolean; modiParentId?: string; modiParentEntity?: string; dummy?: 1; }; export declare type FormUpdateData = Partial<{ [K in keyof Omit]: SH[K] | null; }>; export declare type FormCreateData = Partial> & { id: string; }; export declare type Operation = { id: string; action: A; data: D; sorter?: S; } & FilterPart; export declare type Selection = { id?: string; action: A; data: D; sorter?: S; } & FilterPart; export interface EntityShape { id: PrimaryKey; $$seq$$: Sequence; $$createAt$$: number | Date; $$updateAt$$: number | Date; $$deleteAt$$?: number | Date | null; } interface GeneralEntityShape extends EntityShape { [K: string]: any; } export declare type MakeAction = A; export interface EntityDef { Schema: GeneralEntityShape; OpSchema: GeneralEntityShape; Action: string; ParticularAction?: string; Selection: Omit, 'action'>; Aggregation: DeduceAggregation; Operation: CUDOperation; Create: CreateOperation; CreateSingle: CreateSingleOperation; CreateMulti: CreateMultipleOperation; Update: UpdateOperation; Remove: RemoveOperation; Relation?: string; } export interface EntityDict { [E: string]: EntityDef; } export interface OtmSubProjection extends Omit, 'action'> { $entity: string; } export declare type AggregationOp = `#max-${number}` | `#min-${number}` | `#avg-${number}` | `#count-${number}` | `#sum-${number}`; export declare type DeduceAggregationData

= { [A in AggregationOp]?: P; } & { '#aggr'?: P; }; export declare type AggregationResult = Array<{ [A in AggregationOp]?: number | string; } & { '#data'?: Partial; }>; export declare type AttrFilter = { [K in keyof SH]?: any; }; declare type SortAttr = { [K: string]: any; }; declare type SorterItem = { $attr: SortAttr; $direction?: "asc" | "desc"; }; declare type Sorter = Array; declare type Filter = { [K: string]: any; }; declare type Projection = { [K: string]: any; }; export declare type DeduceAggregation

= Omit, F, S>, 'action'>; declare type CreateOperationData = { id: string; [K: string]: any; }; declare type CreateSingleOperation = Operation<'create', CreateOperationData, undefined, undefined>; declare type CreateMultipleOperation = Operation<'create', Array, undefined, undefined>; declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation; declare type UpdateOperationData = { id?: never; [k: string]: any; }; export declare type UpdateOperation = Operation; declare type RemoveOperationData = { [k: string]: any; }; export declare type RemoveOperation = Operation<'remove', RemoveOperationData, Filter, Sorter>; export declare type CUDOperation = CreateOperation | UpdateOperation | RemoveOperation; export declare type CreateOpResult = { a: 'c'; e: T; d: ED[T]['OpSchema'] | ED[T]['OpSchema'][]; }; export declare type UpdateOpResult = { a: 'u'; e: T; d: UpdateOperationData; f?: Filter; }; export declare type RemoveOpResult = { a: 'r'; e: T; f?: Filter; }; export declare type RelationHierarchy = { [K in R]?: R[]; }; export declare type CascadeRelationItem = { cascadePath: string; relations?: string[]; }; export declare type CascadeRelationAuth = { [K in R]?: CascadeRelationItem | (CascadeRelationItem | CascadeRelationItem[])[]; }; export declare type SelectOpResult = { a: 's'; d: { [T in keyof ED]?: { [ID: string]: ED[T]['OpSchema']; }; }; }; export declare type OpRecord = CreateOpResult | UpdateOpResult | RemoveOpResult | SelectOpResult; export declare type OperationResult = { [K in keyof ED]?: { [A in ED[K]['Action']]?: number; }; }; export declare type ActionType = 'readOnly' | 'appendOnly' | 'excludeUpdate' | 'excludeRemove' | 'crud'; export declare type Configuration = { actionType?: ActionType; static?: boolean; }; export {};