1 | import { ModelPersistenceEventCallback } from '../Types';
|
2 |
|
3 |
|
4 |
|
5 | export interface IModelAttributeIndex {
|
6 | name: string;
|
7 | unique?: boolean;
|
8 | isSecondaryKey?: boolean;
|
9 | secondaryKey?: string;
|
10 | }
|
11 |
|
12 |
|
13 |
|
14 | export interface IModelAttributeOptions {
|
15 | name?: string;
|
16 | type?: any;
|
17 | typeName?: string;
|
18 | isArray?: boolean;
|
19 | primaryKey?: boolean;
|
20 | secondaryKey?: boolean;
|
21 | index?: IModelAttributeIndex;
|
22 | transient?: boolean;
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export interface IModelOptions {
|
29 | clazzName?: string;
|
30 | clazz?: any;
|
31 | onlyMapDefinedAttributes?: boolean;
|
32 | tableName?: string;
|
33 | attrs?: IModelAttributeOptions[];
|
34 | transientAttrs?: string[];
|
35 | onPersistenceEvent?: ModelPersistenceEventCallback<any>;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 | export interface IModelKey {
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 | export interface IKeyValue {
|
46 | }
|
47 | export declare type TKeyValue = IKeyValue | string | number;
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | export declare function Model(opts?: IModelOptions): (constructor: Function) => void;
|
59 |
|
60 |
|
61 |
|
62 | export declare type DefaultValueFn = (o: any) => any;
|
63 |
|
64 |
|
65 |
|
66 | export declare function DefaultValue(defaultValueFn: DefaultValueFn): (target: any, propertyKey: string) => void;
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export declare function Attribute(opts?: IModelAttributeOptions): (target: any, propertyKey: string) => void;
|