ts-ref-kit 1.0.12 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/parser/index.cjs +3 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/parser/index.js +3 -0
- package/dist/types/index.d.ts +455 -0
- package/{types/parser/reflect-parser.d.ts → dist/types/parser/index.d.ts} +110 -77
- package/dist/types/tsdoc-metadata.json +11 -0
- package/package.json +24 -9
- package/dist/index.js +0 -19
- package/dist/parser/index.js +0 -3
- package/types/index.d.ts +0 -2
- package/types/parser/index.d.ts +0 -3
- package/types/parser/path-match.d.ts +0 -7
- package/types/parser/reflect-loader.d.ts +0 -10
- package/types/parser/reflect-parser-plugin.d.ts +0 -7
- package/types/reflect-json/Mappable.d.ts +0 -13
- package/types/reflect-json/decorate.d.ts +0 -18
- package/types/reflect-json/index.d.ts +0 -6
- package/types/reflect-json/json-translation.d.ts +0 -38
- package/types/reflect-json/reflect-extension.d.ts +0 -13
- package/types/reflect-json/types.d.ts +0 -15
- package/types/reflect-json/utils.d.ts +0 -9
- package/types/reflect-types/ClassDefinition.d.ts +0 -28
- package/types/reflect-types/EnumDefinition.d.ts +0 -8
- package/types/reflect-types/InterfaceDefinition.d.ts +0 -18
- package/types/reflect-types/MethodDefinition.d.ts +0 -15
- package/types/reflect-types/PropertyDefinition.d.ts +0 -18
- package/types/reflect-types/assert-type.d.ts +0 -14
- package/types/reflect-types/function-validate.d.ts +0 -10
- package/types/reflect-types/index.d.ts +0 -11
- package/types/reflect-types/package.d.ts +0 -10
- package/types/reflect-types/reflect-context.d.ts +0 -16
- package/types/reflect-types/reflect-definitions.d.ts +0 -104
- package/types/reflect-types/reflect-types.d.ts +0 -20
- package/types/reflect-types/reflect-validate.d.ts +0 -24
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
export declare const AfterSerialized: PropertyDecorator;
|
|
2
|
+
|
|
3
|
+
export declare type Any = any;
|
|
4
|
+
|
|
5
|
+
declare type Any_2 = any;
|
|
6
|
+
|
|
7
|
+
export declare type AnyConstructorFunction = new (...args: Any[]) => Any;
|
|
8
|
+
|
|
9
|
+
declare type AnyConstructorFunction_2 = new (...args: Any_2[]) => Any_2;
|
|
10
|
+
|
|
11
|
+
export declare type AnyFunction = (...args: Any[]) => Any;
|
|
12
|
+
|
|
13
|
+
export declare type AnyObject = Dictionary<Any>;
|
|
14
|
+
|
|
15
|
+
export declare const anyType: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export declare function asBoolean(value: unknown): boolean;
|
|
20
|
+
|
|
21
|
+
export declare function asNumber(v: unknown): number;
|
|
22
|
+
|
|
23
|
+
export declare function assertType<T>(data: unknown, type: Type, depth?: number): T;
|
|
24
|
+
|
|
25
|
+
export declare function asString(v: unknown): string;
|
|
26
|
+
|
|
27
|
+
export declare function callDecoratedMethod<Self extends object>(self: Self, metaKey: symbol, ...args: Any[]): Any | undefined;
|
|
28
|
+
|
|
29
|
+
export declare type Class<T> = new (...args: Any[]) => T;
|
|
30
|
+
|
|
31
|
+
export declare class ClassDefinition {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly superClassName: string;
|
|
34
|
+
readonly superClass: ClassDefinition | undefined;
|
|
35
|
+
readonly methods: MethodDefinition[];
|
|
36
|
+
readonly properties: PropertyDefinition_2[];
|
|
37
|
+
readonly jsClass: AnyConstructorFunction_2;
|
|
38
|
+
private readonly _implementationNames;
|
|
39
|
+
private readonly _implementations?;
|
|
40
|
+
private _allImplementations?;
|
|
41
|
+
constructor(def: RawClassDefinition & {
|
|
42
|
+
jsClass: AnyConstructorFunction_2;
|
|
43
|
+
});
|
|
44
|
+
get allMethods(): Dictionary_2<MethodDefinition>;
|
|
45
|
+
get allProperties(): Dictionary_2<PropertyDefinition_2>;
|
|
46
|
+
get implementations(): ImplementationOfClass[];
|
|
47
|
+
get allImplementations(): ImplementationOfClass[];
|
|
48
|
+
getProperty(propName: string): PropertyDefinition_2 | undefined;
|
|
49
|
+
get type(): TypeDefinition;
|
|
50
|
+
isSubClassOf(typeName: string): boolean;
|
|
51
|
+
isSuperClassOf(typeName: string): boolean;
|
|
52
|
+
toString(): string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export declare type ClassOrInstance<T> = T | Class<T>;
|
|
56
|
+
|
|
57
|
+
export declare function createNewInstance<T>(clazz: Class<T>): any;
|
|
58
|
+
|
|
59
|
+
export declare function defineDecoratedProperty(metaKey: symbol): PropertyDecorator;
|
|
60
|
+
|
|
61
|
+
export declare function deserialize<T>(json: string | JsonValue, constructorOrTarget?: ClassOrInstance<T>): T;
|
|
62
|
+
|
|
63
|
+
export declare function deserializeArray<T>(json: string | JsonValue[], clazz?: Class<T>): T[];
|
|
64
|
+
|
|
65
|
+
export declare function deserializeFrom<T extends AnyObject>(data: JsonObject, target: T): void;
|
|
66
|
+
|
|
67
|
+
export declare type Dictionary<T> = {
|
|
68
|
+
[key: string | symbol]: T;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
declare type Dictionary_2<T> = {
|
|
72
|
+
[key: string]: T;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare const done: () => any;
|
|
76
|
+
|
|
77
|
+
export declare type EnableReflect = object;
|
|
78
|
+
|
|
79
|
+
export declare class EnumDefinition {
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly members: Map<string, TypeDefinition>;
|
|
82
|
+
constructor(def: RawEnumDefinition);
|
|
83
|
+
get type(): TypeDefinition;
|
|
84
|
+
get names(): string[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare interface FailureResult extends ValidateResult {
|
|
88
|
+
cause?: FailureResult;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export declare function fillMethod(rawMethod: RawMethodDefinition): MethodDefinition;
|
|
92
|
+
|
|
93
|
+
export declare function fillProperty(rawProperty: RawPropertyDefinition): PropertyDefinition_2;
|
|
94
|
+
|
|
95
|
+
export declare function fillType(rawType: RawTypeDefinition | string | undefined): TypeDefinition;
|
|
96
|
+
|
|
97
|
+
declare type FromJSON<T> = (jsonValue: JsonValue) => T;
|
|
98
|
+
|
|
99
|
+
export declare function getAnyValue<T>(target: Any, field: string | number | symbol): T | undefined;
|
|
100
|
+
|
|
101
|
+
export declare function getClassByName(className: string): AnyConstructorFunction_2 | undefined;
|
|
102
|
+
|
|
103
|
+
export declare function getClassDefinition(arg: AnyConstructorFunction_2 | object | string): ClassDefinition | undefined;
|
|
104
|
+
|
|
105
|
+
declare function getClassDefinition_2(arg: AnyConstructorFunction_2 | object | string): ClassDefinition | undefined;
|
|
106
|
+
|
|
107
|
+
export declare function getDecoratedProperty(target: object, metaKey: symbol): ReflectPropertyKey | undefined;
|
|
108
|
+
|
|
109
|
+
export declare function getDecoratedPropertyValue<V>(target: object, metaKey: symbol): V | undefined;
|
|
110
|
+
|
|
111
|
+
export declare function getEnumDefinition(name: string): EnumDefinition | undefined;
|
|
112
|
+
|
|
113
|
+
declare function getEnumDefinition_2(name: string): EnumDefinition | undefined;
|
|
114
|
+
|
|
115
|
+
export declare function getEnumNames(enumName: string): string[];
|
|
116
|
+
|
|
117
|
+
export declare function getEnumValues(args: {
|
|
118
|
+
[enumName: string]: Record<string, string | number>;
|
|
119
|
+
}): (string | number)[];
|
|
120
|
+
|
|
121
|
+
export declare function getErrorTraceMessages(failureResult: FailureResult): string;
|
|
122
|
+
|
|
123
|
+
export declare function getInterfaceDefinition(name: string): InterfaceDefinition | undefined;
|
|
124
|
+
|
|
125
|
+
declare function getInterfaceDefinition_2(name: string): InterfaceDefinition | undefined;
|
|
126
|
+
|
|
127
|
+
export declare function getOrSetValue<T>(target: Any, field: string | number | symbol, defaultWith: () => T): T;
|
|
128
|
+
|
|
129
|
+
export declare function getSerializeSettings(clazz: Class<Any>): any;
|
|
130
|
+
|
|
131
|
+
export declare function getTypeAliasDefinition(name: string): TypeDefinition | undefined;
|
|
132
|
+
|
|
133
|
+
declare function getTypeAliasDefinition_2(name: string): TypeDefinition | undefined;
|
|
134
|
+
|
|
135
|
+
export declare function getTypeDef(type: Type | TypeDefinition): TypeDefinition;
|
|
136
|
+
|
|
137
|
+
export declare function getTypeDefinition(typeName: string): TypeDefinition;
|
|
138
|
+
|
|
139
|
+
export declare function hasDecoratedMethod<Self extends object>(self: Self, metaKey: symbol): boolean;
|
|
140
|
+
|
|
141
|
+
export declare function hasGenerics(type: TypeDefinition): type is {
|
|
142
|
+
generics: TypeDefinition[];
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export declare const IgnoreSerialization: PropertyDecorator;
|
|
146
|
+
|
|
147
|
+
declare type ImplementationOfClass = InterfaceDefinition | TypeDefinition;
|
|
148
|
+
|
|
149
|
+
declare type ImplementationOfInterface = InterfaceDefinition | ClassDefinition | TypeDefinition;
|
|
150
|
+
|
|
151
|
+
export declare class InterfaceDefinition {
|
|
152
|
+
readonly name: string;
|
|
153
|
+
readonly methods: MethodDefinition[];
|
|
154
|
+
readonly properties: PropertyDefinition_2[];
|
|
155
|
+
private readonly _implementationNames;
|
|
156
|
+
private _implementations?;
|
|
157
|
+
private _allImplementations?;
|
|
158
|
+
constructor(def: RawInterfaceDefinition);
|
|
159
|
+
get implementations(): ImplementationOfInterface[];
|
|
160
|
+
get allImplementations(): ImplementationOfInterface[];
|
|
161
|
+
get type(): TypeDefinition;
|
|
162
|
+
toString(): string;
|
|
163
|
+
buildBaseObject(): {};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare type IPropertyWrapper = {
|
|
167
|
+
getField: (owner: object, property: ReflectPropertyKey, fieldSymbol: symbol) => Any;
|
|
168
|
+
setField: (owner: object, property: ReflectPropertyKey, newValue: Any, fieldSymbol: symbol) => void;
|
|
169
|
+
} & (<T>({ getter, setter, fieldSymbol }: {
|
|
170
|
+
getter?: (self: object, property: ReflectPropertyKey) => T;
|
|
171
|
+
setter?: (self: object, newValue: T, property: ReflectPropertyKey) => void;
|
|
172
|
+
fieldSymbol: symbol;
|
|
173
|
+
}) => PropertyDecorator);
|
|
174
|
+
|
|
175
|
+
export declare function isArrayType(type: TypeDefinition): type is {
|
|
176
|
+
arrayElementType: TypeDefinition;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export declare function isClassDefinition(type: TypeDefinition): type is {
|
|
180
|
+
classDefinition: ClassDefinition;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export declare function isDictionary(value: Any): boolean;
|
|
184
|
+
|
|
185
|
+
export declare function isIgnoredType(type: TypeDefinition): boolean;
|
|
186
|
+
|
|
187
|
+
export declare function isIntersectionType(type: TypeDefinition): type is {
|
|
188
|
+
intersectionMembers: TypeDefinition[];
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export declare function isLiteralType(type: TypeDefinition): type is {
|
|
192
|
+
literalValue: string;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export declare function isNullable(type: Type | TypeDefinition): boolean;
|
|
196
|
+
|
|
197
|
+
export declare function isPrimitiveType(type: TypeDefinition): type is {
|
|
198
|
+
name: string;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export declare function isTupleType(type: TypeDefinition): type is {
|
|
202
|
+
tupleMembers: TypeDefinition[];
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export declare function isType(value: unknown, type: Type | TypeDefinition): boolean;
|
|
206
|
+
|
|
207
|
+
export declare function isTypeLiteralType(type: TypeDefinition): type is {
|
|
208
|
+
typeLiteralMembers: PropertyDefinition_2[];
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export declare function isUnionType(type: TypeDefinition): type is {
|
|
212
|
+
unionMembers: TypeDefinition[];
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export declare const itSelf: (some: Any) => any;
|
|
216
|
+
|
|
217
|
+
export declare type JsonObject = {
|
|
218
|
+
[propName: string]: JsonValue;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export declare type JsonValue = string | number | boolean | null | JsonObject | JsonObject[];
|
|
222
|
+
|
|
223
|
+
export declare interface JsonValueTransform<T> {
|
|
224
|
+
fromJson: FromJSON<T>;
|
|
225
|
+
toJson: ToJSON<T>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export declare function Lazy(creator: (self: object, property: ReflectPropertyKey) => Any): PropertyDecorator;
|
|
229
|
+
|
|
230
|
+
export declare function mapAllProperties<T extends Mappable>(target: T, map: Mapping<T>): void;
|
|
231
|
+
|
|
232
|
+
export declare interface Mappable extends EnableReflect {
|
|
233
|
+
mapping(map: Mapping<Mappable>): void;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export declare type Mapping<T extends Mappable> = {
|
|
237
|
+
[propName in keyof T]-?: (fieldName?: string | symbol, transform?: {
|
|
238
|
+
fromJSON?: (jsonValue: JsonValue) => Mappable;
|
|
239
|
+
toJSON?: (obj: Mappable) => JsonValue;
|
|
240
|
+
}) => void;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export declare class MethodDefinition {
|
|
244
|
+
name: string;
|
|
245
|
+
isPrivate: boolean;
|
|
246
|
+
isStatic: boolean;
|
|
247
|
+
isAsync: boolean;
|
|
248
|
+
returnType: TypeDefinition;
|
|
249
|
+
args: {
|
|
250
|
+
name: string;
|
|
251
|
+
type?: TypeDefinition;
|
|
252
|
+
isOptional: boolean;
|
|
253
|
+
}[];
|
|
254
|
+
constructor(def: RawMethodDefinition);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export declare type Nullable<T> = T | null;
|
|
258
|
+
|
|
259
|
+
export declare const nullType: {
|
|
260
|
+
name: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export declare type Optional<T> = T | undefined;
|
|
264
|
+
|
|
265
|
+
declare class PropertyDefinition_2 {
|
|
266
|
+
name: string;
|
|
267
|
+
isOptional: boolean;
|
|
268
|
+
isPrivate: boolean;
|
|
269
|
+
isStatic: boolean;
|
|
270
|
+
type: TypeDefinition;
|
|
271
|
+
accessor?: {
|
|
272
|
+
getter?: {
|
|
273
|
+
isPrivate: boolean;
|
|
274
|
+
};
|
|
275
|
+
setter?: {
|
|
276
|
+
isPrivate: boolean;
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
constructor(def: RawPropertyDefinition);
|
|
280
|
+
}
|
|
281
|
+
export { PropertyDefinition_2 as PropertyDefinition }
|
|
282
|
+
|
|
283
|
+
export declare const PropertyWrapper: IPropertyWrapper;
|
|
284
|
+
|
|
285
|
+
export declare interface RawClassDefinition {
|
|
286
|
+
name: string;
|
|
287
|
+
superClassName?: string;
|
|
288
|
+
implementations?: string[];
|
|
289
|
+
methods?: RawMethodDefinition[];
|
|
290
|
+
properties?: RawPropertyDefinition[];
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export declare interface RawEnumDefinition {
|
|
294
|
+
name: string;
|
|
295
|
+
members: {
|
|
296
|
+
name: string;
|
|
297
|
+
initializer: string | undefined;
|
|
298
|
+
}[];
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export declare interface RawInterfaceDefinition {
|
|
302
|
+
name: string;
|
|
303
|
+
implementations?: string[];
|
|
304
|
+
methods?: RawMethodDefinition[];
|
|
305
|
+
properties?: RawPropertyDefinition[];
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export declare interface RawMethodDefinition {
|
|
309
|
+
name: string;
|
|
310
|
+
isPrivate?: boolean;
|
|
311
|
+
isStatic?: boolean;
|
|
312
|
+
isAsync?: boolean;
|
|
313
|
+
returnType?: RawTypeDef;
|
|
314
|
+
args?: {
|
|
315
|
+
name: string;
|
|
316
|
+
type?: RawTypeDef;
|
|
317
|
+
isOptional: boolean;
|
|
318
|
+
}[];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export declare interface RawPropertyDefinition {
|
|
322
|
+
name: string;
|
|
323
|
+
isOptional?: boolean;
|
|
324
|
+
isPrivate?: boolean;
|
|
325
|
+
isStatic?: boolean;
|
|
326
|
+
type?: RawTypeDef;
|
|
327
|
+
accessor?: {
|
|
328
|
+
getter?: {
|
|
329
|
+
isPrivate: boolean;
|
|
330
|
+
};
|
|
331
|
+
setter?: {
|
|
332
|
+
isPrivate: boolean;
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare type RawTypeDef = string | RawTypeDefinition;
|
|
338
|
+
|
|
339
|
+
export declare interface RawTypeDefinition {
|
|
340
|
+
arrayElementType?: RawTypeDef;
|
|
341
|
+
literalValue?: unknown;
|
|
342
|
+
typeLiteralMembers?: RawPropertyDefinition[];
|
|
343
|
+
unionMembers?: RawTypeDef[];
|
|
344
|
+
intersectionMembers?: RawTypeDef[];
|
|
345
|
+
isFunction?: boolean;
|
|
346
|
+
tupleMembers?: RawTypeDef[];
|
|
347
|
+
isOptionalInTuple?: boolean;
|
|
348
|
+
isConstructor?: boolean;
|
|
349
|
+
generics?: RawTypeDef[];
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export declare const ReflectClass: ClassDecorator;
|
|
353
|
+
|
|
354
|
+
export declare const ReflectContext: {
|
|
355
|
+
getClassDefinition: typeof getClassDefinition_2;
|
|
356
|
+
getInterfaceDefinition: typeof getInterfaceDefinition_2;
|
|
357
|
+
getEnumDefinition: typeof getEnumDefinition_2;
|
|
358
|
+
getTypeAliasDefinition: typeof getTypeAliasDefinition_2;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export declare type ReflectPropertyKey = string | symbol;
|
|
362
|
+
|
|
363
|
+
export declare type ReflectType = StringConstructor | NumberConstructor | BooleanConstructor | ObjectConstructor | ArrayConstructor | FunctionConstructor | AnyConstructorFunction;
|
|
364
|
+
|
|
365
|
+
export declare const ReflectValidate: MethodDecorator;
|
|
366
|
+
|
|
367
|
+
export declare function registerMappable<T extends Mappable>(mappableClass: Class<T>): void;
|
|
368
|
+
|
|
369
|
+
export declare function registerSerializedProperty(target: AnyObject, propName: string, options: SerializedOptions<Any>): void;
|
|
370
|
+
|
|
371
|
+
export declare function registerTransform<T>(clazz: Class<T>, transform: JsonValueTransform<T>): void;
|
|
372
|
+
|
|
373
|
+
export declare function safeCall(target: object, methodName: string, ...args: unknown[]): unknown;
|
|
374
|
+
|
|
375
|
+
export declare function safeSetValue(target: object, propName: string, value: unknown): void;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* serialize an object to json string
|
|
379
|
+
*/
|
|
380
|
+
export declare function serialize<T>(value: T): string;
|
|
381
|
+
|
|
382
|
+
export declare function Serialized<T extends object>(options?: SerializedOptions<T>): PropertyDecorator;
|
|
383
|
+
|
|
384
|
+
export declare const SerializedClass: PropertyDecorator;
|
|
385
|
+
|
|
386
|
+
export declare function SerializedName(serializedName: string): PropertyDecorator;
|
|
387
|
+
|
|
388
|
+
declare type SerializedOptions<T> = {
|
|
389
|
+
name?: string;
|
|
390
|
+
class?: Class<T>;
|
|
391
|
+
fromJSON?: FromJSON<T>;
|
|
392
|
+
toJSON?: ToJSON<T>;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
export declare function serializeTo<T>(value: T): JsonValue;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* convert an object to data object
|
|
399
|
+
*/
|
|
400
|
+
export declare function serializeToData<T extends object>(object: T): JsonObject | JsonObject[];
|
|
401
|
+
|
|
402
|
+
export declare function setAnyValue<T>(target: Any, field: string | number | symbol, value: T): void;
|
|
403
|
+
|
|
404
|
+
export declare function setDefaultIgnored(clazz: Class<Any>, defaultIgnored: boolean): void;
|
|
405
|
+
|
|
406
|
+
declare type ToJSON<T> = (obj: T) => JsonValue;
|
|
407
|
+
|
|
408
|
+
export declare type Type = string | {
|
|
409
|
+
array: Type;
|
|
410
|
+
} | {
|
|
411
|
+
union: Type[];
|
|
412
|
+
} | {
|
|
413
|
+
intersection: Type[];
|
|
414
|
+
} | {
|
|
415
|
+
tuple: Type[];
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
export declare interface TypeDefinition {
|
|
419
|
+
name?: string;
|
|
420
|
+
arrayElementType?: TypeDefinition;
|
|
421
|
+
literalValue?: string;
|
|
422
|
+
typeLiteralMembers?: PropertyDefinition_2[];
|
|
423
|
+
unionMembers?: TypeDefinition[];
|
|
424
|
+
intersectionMembers?: TypeDefinition[];
|
|
425
|
+
isFunction?: boolean;
|
|
426
|
+
tupleMembers?: TypeDefinition[];
|
|
427
|
+
isOptionalInTuple?: boolean;
|
|
428
|
+
isConstructor?: boolean;
|
|
429
|
+
generics?: TypeDefinition[];
|
|
430
|
+
classDefinition?: ClassDefinition;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export declare function validateArray<T extends object>(array: T[], typeName?: string, depth?: number): ValidateResult;
|
|
434
|
+
|
|
435
|
+
export declare function validateDictionary<T extends object>(dict: Dictionary_2<T>, typeName?: string, depth?: number): ValidateResult;
|
|
436
|
+
|
|
437
|
+
export declare function validateFunctionArgument(args: {
|
|
438
|
+
funcName: string;
|
|
439
|
+
optionsObj?: object;
|
|
440
|
+
value?: unknown;
|
|
441
|
+
argName: string;
|
|
442
|
+
type: string;
|
|
443
|
+
optional?: boolean;
|
|
444
|
+
}): void;
|
|
445
|
+
|
|
446
|
+
export declare function validateInstance<T extends object>(instance: T, typeName?: string, depth?: number): ValidateResult;
|
|
447
|
+
|
|
448
|
+
declare interface ValidateResult {
|
|
449
|
+
success: boolean;
|
|
450
|
+
errorMessage?: string;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export declare function validateValue(value: unknown, type: TypeDefinition, depth?: number): ValidateResult;
|
|
454
|
+
|
|
455
|
+
export { }
|
|
@@ -1,77 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
import { Plugin as Plugin_2 } from 'vite';
|
|
2
|
+
|
|
3
|
+
declare type Any = any;
|
|
4
|
+
|
|
5
|
+
export declare const DEBUG_CONFIG: {
|
|
6
|
+
OUTPUT_LOG: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare type FilePathRule = string | RegExp | (string | RegExp)[];
|
|
10
|
+
|
|
11
|
+
declare interface Options extends ReflectLoaderOptions {
|
|
12
|
+
entry: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare function parseSource(filePaths?: string | string[], exclude?: FilePathRule): {
|
|
16
|
+
classDefinitions: Map<string, RawClassDefinition>;
|
|
17
|
+
interfaceDefinitions: Map<string, RawInterfaceDefinition>;
|
|
18
|
+
enumDefinitions: Map<string, RawEnumDefinition>;
|
|
19
|
+
typeAliasDefinitions: Map<string, RawTypeDef>;
|
|
20
|
+
constTypeDefinitions: Map<string, RawTypeDef>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export declare interface RawClassDefinition {
|
|
24
|
+
name: string;
|
|
25
|
+
superClassName?: string;
|
|
26
|
+
implementations?: string[];
|
|
27
|
+
methods?: RawMethodDefinition[];
|
|
28
|
+
properties?: RawPropertyDefinition[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface RawEnumDefinition {
|
|
32
|
+
name: string;
|
|
33
|
+
members: {
|
|
34
|
+
name: string;
|
|
35
|
+
initializer: string | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare interface RawInterfaceDefinition {
|
|
40
|
+
name: string;
|
|
41
|
+
implementations?: string[];
|
|
42
|
+
methods?: RawMethodDefinition[];
|
|
43
|
+
properties?: RawPropertyDefinition[];
|
|
44
|
+
indexElementType?: RawTypeDef;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare interface RawMethodDefinition {
|
|
48
|
+
name: string;
|
|
49
|
+
isPrivate?: boolean;
|
|
50
|
+
isStatic?: boolean;
|
|
51
|
+
isAsync?: boolean;
|
|
52
|
+
returnType?: RawTypeDef;
|
|
53
|
+
args?: {
|
|
54
|
+
name: string;
|
|
55
|
+
type?: RawTypeDef;
|
|
56
|
+
isOptional: boolean;
|
|
57
|
+
}[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare interface RawPropertyDefinition {
|
|
61
|
+
name: string;
|
|
62
|
+
isOptional?: boolean;
|
|
63
|
+
isPrivate?: boolean;
|
|
64
|
+
isStatic?: boolean;
|
|
65
|
+
type?: RawTypeDef;
|
|
66
|
+
accessor?: {
|
|
67
|
+
getter?: {
|
|
68
|
+
isPrivate: boolean;
|
|
69
|
+
};
|
|
70
|
+
setter?: {
|
|
71
|
+
isPrivate: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare type RawTypeDef = string | RawTypeDefinition;
|
|
77
|
+
|
|
78
|
+
export declare interface RawTypeDefinition {
|
|
79
|
+
arrayElementType?: RawTypeDef;
|
|
80
|
+
indexElementType?: RawTypeDef;
|
|
81
|
+
literalValue?: Any;
|
|
82
|
+
typeLiteralMembers?: RawPropertyDefinition[];
|
|
83
|
+
unionMembers?: RawTypeDef[];
|
|
84
|
+
intersectionMembers?: RawTypeDef[];
|
|
85
|
+
generics?: RawTypeDef[];
|
|
86
|
+
isFunction?: boolean;
|
|
87
|
+
tupleMembers?: RawTypeDef[];
|
|
88
|
+
isOptionalInTuple?: boolean;
|
|
89
|
+
isConstructor?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare function reflectLoader(options: ReflectLoaderOptions): {
|
|
93
|
+
outputAllMetas: () => string;
|
|
94
|
+
transform: (sourceCode: string, sourceFileName: string) => string;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export declare interface ReflectLoaderOptions {
|
|
98
|
+
sourcePaths: string | string[];
|
|
99
|
+
exclude?: string | RegExp | (string | RegExp)[];
|
|
100
|
+
forEnabledClassOnly?: boolean;
|
|
101
|
+
outputLog?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare function reflectParserPlugin(options: Options): Plugin_2;
|
|
105
|
+
|
|
106
|
+
export declare function setupReflectTypes(filePaths: string | string[], exclude?: FilePathRule, distFolder?: string): Promise<void>;
|
|
107
|
+
|
|
108
|
+
export declare function updateReflectModules(filePath: string, distFolder: string): Promise<void>;
|
|
109
|
+
|
|
110
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.52.11"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|