定义了importation和exportation

This commit is contained in:
Xu Chang 2023-01-08 12:14:51 +08:00
parent f4891f2c35
commit b59ddaa1ee
2 changed files with 33 additions and 1 deletions

15
lib/types/Entity.d.ts vendored
View File

@ -169,4 +169,19 @@ export declare type Configuration = {
actionType?: ActionType;
static?: boolean;
};
export declare type Exportation<ED extends EntityDict, T extends keyof ED, K extends string> = {
name: string;
id: string;
entity: T;
projection: ED[T]['Selection']['data'];
header: K[];
fn: (data: ED[T]['Schema']) => Record<K, string | number | boolean | null>;
};
export declare type Importation<ED extends EntityDict, T extends keyof ED, K extends string> = {
name: string;
id: string;
entity: T;
header: K[];
fn: (data: Record<K, string | number | boolean>) => ED[T]['CreateSingle']['data'];
};
export {};

View File

@ -245,4 +245,21 @@ export type ActionType = 'readOnly' | 'appendOnly' | 'excludeUpdate' | 'excludeR
export type Configuration = {
actionType?: ActionType;
static?: boolean; // 标识是维表(变动较小,相对独立)
};
};
export type Exportation<ED extends EntityDict, T extends keyof ED, K extends string> = {
name: string;
id: string;
entity: T;
projection: ED[T]['Selection']['data'];
header: K[];
fn: (data: ED[T]['Schema']) => Record<K, string | number | boolean | null>;
};
export type Importation<ED extends EntityDict, T extends keyof ED, K extends string> = {
name: string;
id: string;
entity: T;
header: K[];
fn: (data: Record<K, string | number | boolean>) => ED[T]['CreateSingle']['data'];
};