-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathbreeze.metadata-helper.d.ts
63 lines (56 loc) · 2.43 KB
/
breeze.metadata-helper.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { config } from '../breeze-client';
declare module '../breeze-client' {
namespace config {
export interface PropertyDef {
name?: string;
nameOnServer?: string;
isScalar?: boolean;
validators?: Array<Validator> | Array<Object>;
}
export interface DataPropertyDef extends PropertyDef {
dataType?: DataType;
complexTypeName?: string;
isNullable?: boolean;
defaultValue?: any;
isPartOfKey?: boolean;
isUnmapped?: boolean;
concurrencyMode?: string;
maxLength?: number;
custom?: Object;
}
export interface NavigationPropertyDef extends PropertyDef {
entityTypeName: string;
associationName?: string;
foreignKeyNames?: Array<string>;
}
export interface TypeDef {
shortName: string;
namespace?: string;
dataProperties?: Array<DataPropertyDef>;
custom?: Object;
}
export interface ComplexTypeDef extends TypeDef { }
export interface EntityTypeDef extends TypeDef {
baseTypeName?: string;
isAbstract?: boolean;
autoGeneratedKeyType?: AutoGeneratedKeyType;
defaultResourceName?: string;
navigationProperties?: Array<NavigationPropertyDef>;
serializerFn?: (dataProperty: DataProperty, value: any) => any;
}
export class MetadataHelper {
constructor(defaultNamespace: string, defaultAutoGeneratedKeyType: AutoGeneratedKeyType);
addDataService(store: MetadataStore, serviceName: string): void;
addTypeNameAsResource(store: MetadataStore, type: EntityType): void;
addTypeToStore(store: MetadataStore, typeDef: ComplexTypeDef | EntityTypeDef): ComplexType | EntityType;
convertValidators(typeName: string, propName: string, propDef: PropertyDef): void;
findEntityKey(typeDef: TypeDef): DataPropertyDef;
inferDefaultResourceName(typeDef: EntityTypeDef): void;
inferValidators(entityType: EntityTypeDef): EntityTypeDef;
patch(typeDef: EntityTypeDef): void;
pluralize(word: string): string;
setDefaultAutoGeneratedKeyType(autoGeneratedKeyType: AutoGeneratedKeyType): void;
setDefaultNamespace(namespace: string): void;
}
}
}