import { PrimaryKey, Sequence } from './DataType'; type TriggerDataAttributeType = '$$triggerData$$'; type TriggerTimestampAttributeType = '$$triggerTimestamp$$'; type PrimaryKeyAttributeType = 'id'; type CreateAtAttributeType = '$$createAt$$'; type UpdateAtAttributeType = '$$updateAt$$'; type DeleteAtAttributeType = '$$deleteAt$$'; 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 type InstinctiveAttributes = PrimaryKeyAttributeType | CreateAtAttributeType | UpdateAtAttributeType | DeleteAtAttributeType | TriggerDataAttributeType | TriggerTimestampAttributeType | SeqAttributeType; export declare const initinctiveAttributes: string[]; type FilterPart = { filter?: A extends 'create' ? undefined : F; indexFrom?: A extends 'create' ? undefined : number; count?: A extends 'create' ? undefined : number; }; export type SelectOption = { dontCollect?: boolean; blockTrigger?: true; obscure?: boolean; forUpdate?: true; includedDeleted?: true; dummy?: 1; }; export type OperateOption = { blockTrigger?: true; dontCollect?: boolean; dontCreateOper?: boolean; dontCreateModi?: boolean; allowExists?: boolean; modiParentId?: string; modiParentEntity?: string; dummy?: 1; }; export type FormUpdateData = Partial<{ [K in keyof Omit]: SH[K] | null; }>; export type FormCreateData = Partial> & { id: string; }; export type Operation = { 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 type MakeAction = A; export interface EntityDef { Schema: GeneralEntityShape; OpSchema: GeneralEntityShape; Action: string; ParticularAction?: string; Selection: Omit, 'action'>; Aggregation: Omit, 'action'>; 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 type AggregationOp = `#max-${number}` | `#min-${number}` | `#avg-${number}` | `#count-${number}` | `#sum-${number}`; export type DeduceAggregationData

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

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