@zyno-io/ts-reflection 26.803.2224
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/README.md +13 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +966 -0
- package/dist/reflection/annotations.d.ts +15 -0
- package/dist/reflection/annotations.d.ts.map +1 -0
- package/dist/reflection/compact-metadata.d.ts +18 -0
- package/dist/reflection/compact-metadata.d.ts.map +1 -0
- package/dist/reflection/conversion.d.ts +15 -0
- package/dist/reflection/conversion.d.ts.map +1 -0
- package/dist/reflection/deserializer.d.ts +15 -0
- package/dist/reflection/deserializer.d.ts.map +1 -0
- package/dist/reflection/errors.d.ts +8 -0
- package/dist/reflection/errors.d.ts.map +1 -0
- package/dist/reflection/index.d.ts +10 -0
- package/dist/reflection/index.d.ts.map +1 -0
- package/dist/reflection/metadata-store.d.ts +20 -0
- package/dist/reflection/metadata-store.d.ts.map +1 -0
- package/dist/reflection/model.d.ts +273 -0
- package/dist/reflection/model.d.ts.map +1 -0
- package/dist/reflection/primitive-conversion.d.ts +2 -0
- package/dist/reflection/primitive-conversion.d.ts.map +1 -0
- package/dist/reflection/reflection-class.d.ts +60 -0
- package/dist/reflection/reflection-class.d.ts.map +1 -0
- package/dist/reflection/type-utils.d.ts +34 -0
- package/dist/reflection/type-utils.d.ts.map +1 -0
- package/dist/type-compiler/download-prebuilt.cjs +114 -0
- package/dist/type-compiler/go/ast_expression.go +187 -0
- package/dist/type-compiler/go/ast_metadata.go +388 -0
- package/dist/type-compiler/go/collect.go +963 -0
- package/dist/type-compiler/go/compact_metadata.go +553 -0
- package/dist/type-compiler/go/emission_plan.go +340 -0
- package/dist/type-compiler/go/emit_ast.go +557 -0
- package/dist/type-compiler/go/emit_ast_test.go +558 -0
- package/dist/type-compiler/go/go.mod +10 -0
- package/dist/type-compiler/go/plugin.go +359 -0
- package/dist/type-compiler/go/plugin_test.go +1206 -0
- package/dist/type-compiler/go/precompute.go +86 -0
- package/dist/type-compiler/go/receive_type.go +912 -0
- package/dist/type-compiler/go/resolve.go +265 -0
- package/dist/type-compiler/go/source_scan.go +51 -0
- package/dist/type-compiler/go/text_parse.go +734 -0
- package/dist/type-compiler/go/type_expr.go +1291 -0
- package/dist/type-compiler/go/typia_expr.go +2316 -0
- package/dist/type-compiler/index.cjs +43 -0
- package/dist/type-compiler/pnp.cjs +474 -0
- package/dist/type-compiler/prebuilt.cjs +324 -0
- package/dist/type-metadata-runtime.cjs +1 -0
- package/dist/type-metadata-runtime.d.ts +2 -0
- package/dist/type-metadata-runtime.d.ts.map +1 -0
- package/dist/type-metadata-runtime.js +107 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/primitives.d.ts +33 -0
- package/dist/types/primitives.d.ts.map +1 -0
- package/dist/types/runtime.d.ts +2 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/type-annotations.d.ts +28 -0
- package/dist/types/type-annotations.d.ts.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReflectionKind, type Type, type ValidationAnnotation } from './model.js';
|
|
2
|
+
export declare function isUUIDType(type: Type): boolean;
|
|
3
|
+
export declare function isDatabaseUUIDType(type: Type): boolean;
|
|
4
|
+
export declare const typeAnnotation: {
|
|
5
|
+
getType(type: Type, name: string): Type | undefined;
|
|
6
|
+
getOption(type: Type, name: string): unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare const validationAnnotation: {
|
|
9
|
+
getAnnotations(type: Type): ValidationAnnotation[];
|
|
10
|
+
};
|
|
11
|
+
export declare const databaseAnnotation: {
|
|
12
|
+
getDatabase<T = any>(type: Type, dialect: string): T | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare function knownPrimitiveKind(type: Type): ReflectionKind.string | ReflectionKind.number | ReflectionKind.boolean | undefined;
|
|
15
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/reflection/annotations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,KAAK,IAAI,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElF,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAG9C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAGtD;AAED,eAAO,MAAM,cAAc;IACvB,OAAO,OAAO,IAAI,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS;IAMnD,SAAS,OAAO,IAAI,QAAQ,MAAM,GAAG,OAAO;CAG/C,CAAC;AAEF,eAAO,MAAM,oBAAoB;IAC7B,cAAc,OAAO,IAAI,GAAG,oBAAoB,EAAE;CAuBrD,CAAC;AAEF,eAAO,MAAM,kBAAkB;IAC3B,WAAW,CAAC,CAAC,GAAG,GAAG,QAAQ,IAAI,WAAW,MAAM,GAAG,CAAC,GAAG,SAAS;CAenE,CAAC;AA2JF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,OAAO,GAAG,SAAS,CAMjI"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reconstruct metadata serialized by the native type compiler.
|
|
3
|
+
*
|
|
4
|
+
* Generated metadata is almost entirely JSON data. Values that must retain
|
|
5
|
+
* JavaScript semantics (constructors, lazy functions, imported metadata,
|
|
6
|
+
* `undefined`, bigint literals, and similar expressions) are supplied through
|
|
7
|
+
* a small side table and represented in the JSON payload by indexed markers.
|
|
8
|
+
*
|
|
9
|
+
* This function is a generated-code ABI. Keep the version in its exported name
|
|
10
|
+
* when adding a new wire format so old compiled applications fail explicitly
|
|
11
|
+
* instead of being decoded with different semantics.
|
|
12
|
+
*/
|
|
13
|
+
export declare function decodeCompactMetadataV1<T>(serialized: string, references: readonly unknown[], resolveType?: (index: number) => unknown): T;
|
|
14
|
+
/** Create one lazy metadata-type registry for a generated module. */
|
|
15
|
+
export declare function createCompactMetadataRegistryV1(serialized: string, references: readonly unknown[]): (index: number) => unknown;
|
|
16
|
+
/** Resolve metadata published by a type-only external import at first use. */
|
|
17
|
+
export declare function resolveCompactMetadataAliasV1(loadModule: (() => unknown) | ((specifier: string) => unknown), specifierOrExportName: string, exportNameOrTypeName: string, maybeTypeName?: string): unknown;
|
|
18
|
+
//# sourceMappingURL=compact-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact-metadata.d.ts","sourceRoot":"","sources":["../../src/reflection/compact-metadata.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,OAAO,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,CAAC,CAE1I;AAED,qEAAqE;AACrE,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,OAAO,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAmB9H;AAED,8EAA8E;AAC9E,wBAAgB,6BAA6B,CACzC,UAAU,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,EAC9D,qBAAqB,EAAE,MAAM,EAC7B,oBAAoB,EAAE,MAAM,EAC5B,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAqBT"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ValidatorError } from './errors.js';
|
|
2
|
+
import { type ClassType, type Type } from './model.js';
|
|
3
|
+
export type RuntimeValidator = (value: unknown) => ValidatorError | undefined | void;
|
|
4
|
+
export declare const validationRegistry: {
|
|
5
|
+
register(name: string, validator: RuntimeValidator): void;
|
|
6
|
+
get(name: string): RuntimeValidator | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare function validate<T>(value: unknown, target?: ClassType<T> | Type): ValidatorError[];
|
|
9
|
+
export declare function deserialize<T>(value: unknown, type?: Type): T;
|
|
10
|
+
export declare function validatedDeserialize<T>(value: unknown, _a?: unknown, _b?: unknown, _c?: unknown, type?: Type): T;
|
|
11
|
+
export declare function assert<T>(value: unknown, _deserializer?: unknown, type?: Type): asserts value is T;
|
|
12
|
+
export declare function is<T>(value: unknown, _deserializer?: unknown, type?: Type): value is T;
|
|
13
|
+
export declare function cast<T>(value: unknown, _deserializer?: unknown, _a?: unknown, _b?: unknown, type?: Type): T;
|
|
14
|
+
export declare function resolveReceiveType(value?: Type): Type;
|
|
15
|
+
//# sourceMappingURL=conversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversion.d.ts","sourceRoot":"","sources":["../../src/reflection/conversion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgB7C,OAAO,EAAmC,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGxF,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,GAAG,SAAS,GAAG,IAAI,CAAC;AAIrF,eAAO,MAAM,kBAAkB;IAC3B,QAAQ,OAAO,MAAM,aAAa,gBAAgB,GAAG,IAAI;IAIzD,GAAG,OAAO,MAAM,GAAG,gBAAgB,GAAG,SAAS;CAGlD,CAAC;AAEF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,cAAc,EAAE,CAI1F;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAI7D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAOhH;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAKlG;AAED,wBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,CAItF;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAI3G;AAED,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAGrD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Type } from './model.js';
|
|
2
|
+
type DeserializeHandler = (type: Type, state: DeserializerState) => void;
|
|
3
|
+
export declare class DeserializerRegistry {
|
|
4
|
+
private readonly decorators;
|
|
5
|
+
addDecorator(predicate: (type: Type) => boolean, handler: DeserializeHandler): void;
|
|
6
|
+
apply(type: Type, value: unknown): unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare class DeserializerState {
|
|
9
|
+
private transforms;
|
|
10
|
+
addTransform(transform: (value: unknown) => unknown): void;
|
|
11
|
+
apply(value: unknown): unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare const deserializer: DeserializerRegistry;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=deserializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deserializer.d.ts","sourceRoot":"","sources":["../../src/reflection/deserializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAEzE,qBAAa,oBAAoB;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAGlB;IAET,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAElF;IAED,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CASzC;CACJ;AAED,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,UAAU,CAAuC;IAEzD,YAAY,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,CAEzD;IAED,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE7B;CACJ;AAED,eAAO,MAAM,YAAY,sBAA6B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class ValidatorError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly errors: ValidatorError[];
|
|
5
|
+
constructor(code: string, message: string, path?: string);
|
|
6
|
+
}
|
|
7
|
+
export { ValidatorError as ValidationError };
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/reflection/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAe,SAAQ,KAAK;aAIjB,IAAI,EAAE,MAAM;aAEZ,IAAI,EAAE,MAAM;IALhC,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IAElC,YACoB,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM,EACC,IAAI,GAAE,MAAW,EAIpC;CACJ;AAOD,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './model.js';
|
|
2
|
+
export * from './errors.js';
|
|
3
|
+
export * from './deserializer.js';
|
|
4
|
+
export * from './primitive-conversion.js';
|
|
5
|
+
export * from './reflection-class.js';
|
|
6
|
+
export * from './conversion.js';
|
|
7
|
+
export * from './annotations.js';
|
|
8
|
+
export * from './type-utils.js';
|
|
9
|
+
export * from './metadata-store.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reflection/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ClassMetadata, EntityIndexMetadata } from './model.js';
|
|
2
|
+
export type GeneratedColumnStorage = 'virtual' | 'stored';
|
|
3
|
+
export interface GeneratedColumnOptions {
|
|
4
|
+
expression: string;
|
|
5
|
+
storage: GeneratedColumnStorage;
|
|
6
|
+
}
|
|
7
|
+
export type EntityOptions = {
|
|
8
|
+
collectionName?: string;
|
|
9
|
+
indexes?: EntityIndexMetadata[];
|
|
10
|
+
excludeMigration?: boolean;
|
|
11
|
+
generatedColumns?: Record<string, GeneratedColumnOptions>;
|
|
12
|
+
};
|
|
13
|
+
export type EntityClassDecorator = ClassDecorator & {
|
|
14
|
+
index(names: readonly (string | number | symbol)[], options?: Record<string, any>): EntityClassDecorator;
|
|
15
|
+
excludeMigration(): EntityClassDecorator;
|
|
16
|
+
};
|
|
17
|
+
export declare const classMetadata: WeakMap<Function, ClassMetadata>;
|
|
18
|
+
export declare const classOptions: WeakMap<Function, EntityOptions>;
|
|
19
|
+
export declare function applyMetadataOptions(metadata: ClassMetadata, options?: EntityOptions): void;
|
|
20
|
+
//# sourceMappingURL=metadata-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata-store.d.ts","sourceRoot":"","sources":["../../src/reflection/metadata-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1D,MAAM,WAAW,sBAAsB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,sBAAsB,CAAC;CACnC;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG;IAChD,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,oBAAoB,CAAC;IACzG,gBAAgB,IAAI,oBAAoB,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAyC,CAAC;AACpE,eAAO,MAAM,YAAY,kCAAyC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAK3F"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
export declare enum ReflectionKind {
|
|
2
|
+
never = 0,
|
|
3
|
+
any = 1,
|
|
4
|
+
unknown = 2,
|
|
5
|
+
void = 3,
|
|
6
|
+
undefined = 4,
|
|
7
|
+
null = 5,
|
|
8
|
+
string = 6,
|
|
9
|
+
number = 7,
|
|
10
|
+
boolean = 8,
|
|
11
|
+
bigint = 9,
|
|
12
|
+
literal = 10,
|
|
13
|
+
enum = 11,
|
|
14
|
+
union = 12,
|
|
15
|
+
intersection = 13,
|
|
16
|
+
array = 14,
|
|
17
|
+
tuple = 15,
|
|
18
|
+
class = 16,
|
|
19
|
+
object = 17,
|
|
20
|
+
objectLiteral = 18,
|
|
21
|
+
property = 19,
|
|
22
|
+
propertySignature = 20,
|
|
23
|
+
method = 21,
|
|
24
|
+
promise = 22,
|
|
25
|
+
templateLiteral = 23
|
|
26
|
+
}
|
|
27
|
+
export type ClassType<T = any> = new (...args: any[]) => T;
|
|
28
|
+
export type AbstractClassType<T = any> = abstract new (...args: any[]) => T;
|
|
29
|
+
export interface TypeBase<K extends ReflectionKind = ReflectionKind> {
|
|
30
|
+
kind: K;
|
|
31
|
+
typeName?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
parent?: Type;
|
|
34
|
+
annotations?: Record<string, Type>;
|
|
35
|
+
validation?: ValidationAnnotation[];
|
|
36
|
+
database?: Record<string, Record<string, any>>;
|
|
37
|
+
/** Declared generic parameter names retained for imported alias instantiation. */
|
|
38
|
+
typeParameters?: string[];
|
|
39
|
+
}
|
|
40
|
+
export type PrimitiveReflectionKind = ReflectionKind.never | ReflectionKind.any | ReflectionKind.unknown | ReflectionKind.void | ReflectionKind.undefined | ReflectionKind.null | ReflectionKind.string | ReflectionKind.number | ReflectionKind.boolean | ReflectionKind.bigint | ReflectionKind.object | ReflectionKind.method | ReflectionKind.templateLiteral;
|
|
41
|
+
export type TypePrimitive = TypeBase<PrimitiveReflectionKind>;
|
|
42
|
+
export type TypeLiteral = TypeBase<ReflectionKind.literal> & {
|
|
43
|
+
literal: unknown;
|
|
44
|
+
};
|
|
45
|
+
export type TypeEnum = TypeBase<ReflectionKind.enum> & {
|
|
46
|
+
values: unknown[];
|
|
47
|
+
};
|
|
48
|
+
export type TypeUnion = TypeBase<ReflectionKind.union> & {
|
|
49
|
+
types: Type[];
|
|
50
|
+
};
|
|
51
|
+
export type TypeIntersection = TypeBase<ReflectionKind.intersection> & {
|
|
52
|
+
types: Type[];
|
|
53
|
+
};
|
|
54
|
+
export type TypeArray = TypeBase<ReflectionKind.array> & {
|
|
55
|
+
type: Type;
|
|
56
|
+
};
|
|
57
|
+
export type TypePromise = TypeBase<ReflectionKind.promise> & {
|
|
58
|
+
type: Type;
|
|
59
|
+
};
|
|
60
|
+
export type TypeTupleEntry = Type & {
|
|
61
|
+
type: Type;
|
|
62
|
+
};
|
|
63
|
+
export type TypeTuple = TypeBase<ReflectionKind.tuple> & {
|
|
64
|
+
types: TypeTupleEntry[];
|
|
65
|
+
};
|
|
66
|
+
export type TypeClass = TypeBase<ReflectionKind.class> & {
|
|
67
|
+
classType: ClassType;
|
|
68
|
+
};
|
|
69
|
+
export type TypeObjectLiteral = TypeBase<ReflectionKind.objectLiteral> & {
|
|
70
|
+
types: TypePropertySignature[];
|
|
71
|
+
index?: Type;
|
|
72
|
+
implements?: Type[];
|
|
73
|
+
};
|
|
74
|
+
export type TypeProperty = TypeBase<ReflectionKind.property> & {
|
|
75
|
+
name: string | number | symbol;
|
|
76
|
+
type: Type;
|
|
77
|
+
optional?: boolean;
|
|
78
|
+
};
|
|
79
|
+
export type Type = TypePrimitive | TypeLiteral | TypeEnum | TypeUnion | TypeIntersection | TypeArray | TypePromise | TypeTuple | TypeClass | TypeObjectLiteral | TypeProperty | TypePropertySignature;
|
|
80
|
+
export type ReceiveType<T = any> = Type & {
|
|
81
|
+
readonly __receiveType?: T;
|
|
82
|
+
};
|
|
83
|
+
export declare function isReflectedType(value: unknown): value is Type;
|
|
84
|
+
export interface TypePropertySignature extends TypeBase<ReflectionKind.propertySignature> {
|
|
85
|
+
kind: ReflectionKind.propertySignature;
|
|
86
|
+
name: string | number | symbol;
|
|
87
|
+
type: Type;
|
|
88
|
+
optional?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface ValidationAnnotation {
|
|
91
|
+
name: string;
|
|
92
|
+
args: Type[];
|
|
93
|
+
}
|
|
94
|
+
export interface PropertyMetadata {
|
|
95
|
+
name: string | number | symbol;
|
|
96
|
+
type: Type;
|
|
97
|
+
optional?: boolean;
|
|
98
|
+
primaryKey?: boolean;
|
|
99
|
+
autoIncrement?: boolean;
|
|
100
|
+
reference?: Record<string, any>;
|
|
101
|
+
index?: Record<string, any>;
|
|
102
|
+
unique?: Record<string, any>;
|
|
103
|
+
description?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface ParameterMetadata {
|
|
106
|
+
name: string;
|
|
107
|
+
type: Type;
|
|
108
|
+
optional?: boolean;
|
|
109
|
+
default?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export interface MethodMetadata {
|
|
112
|
+
name: string | symbol;
|
|
113
|
+
parameters: ParameterMetadata[];
|
|
114
|
+
returnType: Type;
|
|
115
|
+
description?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ClassMetadata extends TypeBase<ReflectionKind.class> {
|
|
118
|
+
kind: ReflectionKind.class;
|
|
119
|
+
classType: ClassType;
|
|
120
|
+
name: string;
|
|
121
|
+
properties: PropertyMetadata[];
|
|
122
|
+
methods: MethodMetadata[];
|
|
123
|
+
constructorParameters: ParameterMetadata[];
|
|
124
|
+
hasConstructor?: boolean;
|
|
125
|
+
collectionName?: string;
|
|
126
|
+
indexes?: EntityIndexMetadata[];
|
|
127
|
+
excludeMigration?: boolean;
|
|
128
|
+
}
|
|
129
|
+
declare const TypeAnnotationSymbol: unique symbol;
|
|
130
|
+
export type TypeAnnotation<Name extends string, Value = undefined> = {
|
|
131
|
+
readonly [TypeAnnotationSymbol]?: unknown;
|
|
132
|
+
};
|
|
133
|
+
export type TypiaTagTarget = 'boolean' | 'bigint' | 'number' | 'string' | 'array' | 'object';
|
|
134
|
+
export type TypiaTagBase<Tag extends {
|
|
135
|
+
target: TypiaTagTarget;
|
|
136
|
+
kind: string;
|
|
137
|
+
value?: unknown;
|
|
138
|
+
}> = {
|
|
139
|
+
readonly 'typia.tag'?: Tag;
|
|
140
|
+
};
|
|
141
|
+
export type TypiaFormat<Value extends string> = TypiaTagBase<{
|
|
142
|
+
target: 'string';
|
|
143
|
+
kind: 'format';
|
|
144
|
+
value: Value;
|
|
145
|
+
exclusive: true;
|
|
146
|
+
schema: {
|
|
147
|
+
format: Value;
|
|
148
|
+
};
|
|
149
|
+
}>;
|
|
150
|
+
export type TsfTypiaTag<Target extends TypiaTagTarget, Kind extends string, Value = undefined> = TypiaTagBase<{
|
|
151
|
+
target: Target;
|
|
152
|
+
kind: Kind;
|
|
153
|
+
value: Value;
|
|
154
|
+
}>;
|
|
155
|
+
export type TsfTypiaSchemaTag<Target extends TypiaTagTarget, Kind extends string, Value, Schema extends object> = TypiaTagBase<{
|
|
156
|
+
target: Target;
|
|
157
|
+
kind: Kind;
|
|
158
|
+
value: Value;
|
|
159
|
+
schema: Schema;
|
|
160
|
+
}>;
|
|
161
|
+
export type TsfTypeTag<Target extends TypiaTagTarget, Name extends string> = TsfTypiaTag<Target, 'tsf:type', Name>;
|
|
162
|
+
export type TsfValidatorTag<Target extends TypiaTagTarget, Name extends string> = TsfTypiaTag<Target, 'tsf:validator', Name>;
|
|
163
|
+
export type TsfDatabaseTag<Kind extends string, Options extends object = {}> = TsfTypiaSchemaTag<TypiaTagTarget, Kind, '*', Options>;
|
|
164
|
+
export type TsfDatabaseFieldTag<Options extends object> = TypeAnnotation<'database:field', Options>;
|
|
165
|
+
export type PrimaryKey = TsfTypiaTag<TypiaTagTarget, 'database:primaryKey', true>;
|
|
166
|
+
export type AutoIncrement = TsfTypiaTag<TypiaTagTarget, 'database:autoIncrement', true>;
|
|
167
|
+
export type Unique<Options extends object = {}> = TsfDatabaseTag<'database:unique', Options>;
|
|
168
|
+
export type Index<Options extends object = {}> = TsfDatabaseTag<'database:index', Options>;
|
|
169
|
+
export type Indexed<T, Options extends object = {}> = T extends null | undefined ? T : T & Index<Options>;
|
|
170
|
+
export type Reference<Options extends object = {}> = TsfDatabaseTag<'database:reference', Options>;
|
|
171
|
+
export type DatabaseField<Options extends object = {}> = TsfDatabaseFieldTag<Options>;
|
|
172
|
+
export type MySQL<Options extends object = {}> = TypeAnnotation<'database:mysql', Options>;
|
|
173
|
+
export type Pattern<T extends string> = TypiaTagBase<{
|
|
174
|
+
target: 'string';
|
|
175
|
+
kind: 'pattern';
|
|
176
|
+
value: T;
|
|
177
|
+
schema: {
|
|
178
|
+
pattern: T;
|
|
179
|
+
};
|
|
180
|
+
}>;
|
|
181
|
+
export type MinLength<T extends number> = TypiaTagBase<{
|
|
182
|
+
target: 'string';
|
|
183
|
+
kind: 'minLength';
|
|
184
|
+
value: T;
|
|
185
|
+
validate: `${T} <= $input.length`;
|
|
186
|
+
exclusive: true;
|
|
187
|
+
schema: {
|
|
188
|
+
minLength: T;
|
|
189
|
+
};
|
|
190
|
+
}>;
|
|
191
|
+
export type MaxLength<T extends number> = TypiaTagBase<{
|
|
192
|
+
target: 'string';
|
|
193
|
+
kind: 'maxLength';
|
|
194
|
+
value: T;
|
|
195
|
+
validate: `$input.length <= ${T}`;
|
|
196
|
+
exclusive: true;
|
|
197
|
+
schema: {
|
|
198
|
+
maxLength: T;
|
|
199
|
+
};
|
|
200
|
+
}>;
|
|
201
|
+
export type Minimum<T extends number> = TypiaTagBase<{
|
|
202
|
+
target: 'number';
|
|
203
|
+
kind: 'minimum';
|
|
204
|
+
value: T;
|
|
205
|
+
validate: `${T} <= $input`;
|
|
206
|
+
exclusive: true;
|
|
207
|
+
schema: {
|
|
208
|
+
minimum: T;
|
|
209
|
+
};
|
|
210
|
+
}>;
|
|
211
|
+
export type GreaterThan<T extends number> = TypiaTagBase<{
|
|
212
|
+
target: 'number';
|
|
213
|
+
kind: 'greaterThan';
|
|
214
|
+
value: T;
|
|
215
|
+
validate: `${T} < $input`;
|
|
216
|
+
exclusive: true;
|
|
217
|
+
schema: {
|
|
218
|
+
exclusiveMinimum: T;
|
|
219
|
+
};
|
|
220
|
+
}>;
|
|
221
|
+
export type Maximum<T extends number> = TypiaTagBase<{
|
|
222
|
+
target: 'number';
|
|
223
|
+
kind: 'maximum';
|
|
224
|
+
value: T;
|
|
225
|
+
validate: `$input <= ${T}`;
|
|
226
|
+
exclusive: true;
|
|
227
|
+
schema: {
|
|
228
|
+
maximum: T;
|
|
229
|
+
};
|
|
230
|
+
}>;
|
|
231
|
+
export type LessThan<T extends number> = TypiaTagBase<{
|
|
232
|
+
target: 'number';
|
|
233
|
+
kind: 'lessThan';
|
|
234
|
+
value: T;
|
|
235
|
+
validate: `$input < ${T}`;
|
|
236
|
+
exclusive: true;
|
|
237
|
+
schema: {
|
|
238
|
+
exclusiveMaximum: T;
|
|
239
|
+
};
|
|
240
|
+
}>;
|
|
241
|
+
export type Validate<T> = T extends string ? TsfValidatorTag<TypiaTagTarget, T> : TypeAnnotation<'validation:custom', T>;
|
|
242
|
+
export type UUID = string & TypiaFormat<'uuid'> & TsfTypeTag<'string', 'uuid'>;
|
|
243
|
+
export type integer = number & TsfTypiaTag<'number', 'type', 'int32'> & TsfTypeTag<'number', 'integer'>;
|
|
244
|
+
export type HttpBody<T> = T & TypeAnnotation<'httpBody', {
|
|
245
|
+
type: T;
|
|
246
|
+
}>;
|
|
247
|
+
export type HttpQueries<T> = T & TypeAnnotation<'httpQueries', {
|
|
248
|
+
type: T;
|
|
249
|
+
}>;
|
|
250
|
+
export type HttpQuery<T, Options extends {
|
|
251
|
+
name?: string;
|
|
252
|
+
} = {}> = T & TypeAnnotation<'httpQuery', Options & {
|
|
253
|
+
type: T;
|
|
254
|
+
}>;
|
|
255
|
+
export type HttpPath<T, Options extends {
|
|
256
|
+
name?: string;
|
|
257
|
+
} = {}> = T & TypeAnnotation<'httpPath', Options & {
|
|
258
|
+
type: T;
|
|
259
|
+
}>;
|
|
260
|
+
export type HttpHeader<T, Options extends {
|
|
261
|
+
name?: string;
|
|
262
|
+
} = {}> = T & TypeAnnotation<'httpHeader', Options & {
|
|
263
|
+
type: T;
|
|
264
|
+
}>;
|
|
265
|
+
export type ApiName<T extends string> = TypeAnnotation<'openapi:name', T>;
|
|
266
|
+
export type ApiType<Name extends string, T> = T & ApiName<Name>;
|
|
267
|
+
export type ApiResponse<T, Status extends number = 200> = Promise<T>;
|
|
268
|
+
export type EntityIndexMetadata = {
|
|
269
|
+
names: (string | number | symbol)[];
|
|
270
|
+
options: Record<string, any>;
|
|
271
|
+
};
|
|
272
|
+
export {};
|
|
273
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/reflection/model.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,KAAK,IAAI;IACT,GAAG,IAAI;IACP,OAAO,IAAI;IACX,IAAI,IAAI;IACR,SAAS,IAAI;IACb,IAAI,IAAI;IACR,MAAM,IAAI;IACV,MAAM,IAAI;IACV,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,KAAK;IACZ,IAAI,KAAK;IACT,KAAK,KAAK;IACV,YAAY,KAAK;IACjB,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,aAAa,KAAK;IAClB,QAAQ,KAAK;IACb,iBAAiB,KAAK;IACtB,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,eAAe,KAAK;CACvB;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG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 -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive-conversion.d.ts","sourceRoot":"","sources":["../../src/reflection/primitive-conversion.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAS1D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ClassMetadata, type ClassType, type MethodMetadata, type ParameterMetadata, type PropertyMetadata, type ReceiveType, type Type } from './model.js';
|
|
2
|
+
export declare function typeOf<T>(type?: Type): ReceiveType<T>;
|
|
3
|
+
export declare function registerClassMetadata(target: ClassType, metadata: ClassMetadata): void;
|
|
4
|
+
export declare class ReflectionClass<T = any> {
|
|
5
|
+
private readonly classType;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly indexes: {
|
|
8
|
+
names: (string | number | symbol)[];
|
|
9
|
+
options: Record<string, any>;
|
|
10
|
+
}[];
|
|
11
|
+
private readonly metadata;
|
|
12
|
+
private constructor();
|
|
13
|
+
static from<T>(classType: ClassType<T>): ReflectionClass<T>;
|
|
14
|
+
getClassType(): ClassType<T>;
|
|
15
|
+
getCollectionName(): string | undefined;
|
|
16
|
+
isDatabaseMigrationSkipped(_dialect: string): boolean;
|
|
17
|
+
getProperties(): ReflectionProperty[];
|
|
18
|
+
getProperty(name: string | number | symbol): ReflectionProperty;
|
|
19
|
+
getPrimary(): ReflectionProperty;
|
|
20
|
+
getMethod(name: string | symbol): ReflectionMethod;
|
|
21
|
+
getConstructorOrUndefined(): ReflectionMethod | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare class ReflectionProperty {
|
|
24
|
+
private readonly metadata;
|
|
25
|
+
readonly type: Type;
|
|
26
|
+
readonly name: string | number | symbol;
|
|
27
|
+
constructor(metadata: PropertyMetadata);
|
|
28
|
+
getNameAsString(): string;
|
|
29
|
+
getType(): Type;
|
|
30
|
+
getDescription(): string;
|
|
31
|
+
isPublic(): boolean;
|
|
32
|
+
isPrimaryKey(): boolean;
|
|
33
|
+
isAutoIncrement(): boolean;
|
|
34
|
+
isOptional(): boolean;
|
|
35
|
+
isNullable(): boolean;
|
|
36
|
+
getDatabase<T = any>(dialect?: string): T | undefined;
|
|
37
|
+
isBackReference(): boolean;
|
|
38
|
+
isDatabaseSkipped(_dialect: string): boolean;
|
|
39
|
+
isDatabaseMigrationSkipped(_dialect: string): boolean;
|
|
40
|
+
isReference(): boolean;
|
|
41
|
+
getReference<T = any>(): T | undefined;
|
|
42
|
+
getResolvedReflectionClass(): ReflectionClass;
|
|
43
|
+
}
|
|
44
|
+
export declare class ReflectionMethod {
|
|
45
|
+
private readonly metadata;
|
|
46
|
+
constructor(metadata: MethodMetadata);
|
|
47
|
+
getDescription(): string;
|
|
48
|
+
getParameters(): ReflectionParameter[];
|
|
49
|
+
getReturnType(): Type;
|
|
50
|
+
}
|
|
51
|
+
export declare class ReflectionParameter {
|
|
52
|
+
private readonly metadata;
|
|
53
|
+
constructor(metadata: ParameterMetadata);
|
|
54
|
+
getName(): string;
|
|
55
|
+
getType(): Type;
|
|
56
|
+
isOptional(): boolean;
|
|
57
|
+
hasDefault(): boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare function readClassMetadata(target: Function): ClassMetadata | undefined;
|
|
60
|
+
//# sourceMappingURL=reflection-class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflection-class.d.ts","sourceRoot":"","sources":["../../src/reflection/reflection-class.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,IAAI,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAIrD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,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AI,MAAM,CAEvB;IAED,QAAQ,IAAI,OAAO,CAElB;IAED,YAAY,IAAI,OAAO,CAEtB;IAED,eAAe,IAAI,OAAO,CAEzB;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,GAAE,MAAY,GAAG,CAAC,GAAG,SAAS,CAIzD;IAED,eAAe,IAAI,OAAO,CAEzB;IAED,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3C;IAED,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEpD;IAED,WAAW,IAAI,OAAO,CAErB;IAED,YAAY,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,SAAS,CAErC;IAED,0BAA0B,IAAI,eAAe,CAM5C;CACJ;AAED,qBAAa,gBAAgB;IACb,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAArC,YAA6B,QAAQ,EAAE,cAAc,EAAI;IAEzD,cAAc,IAAI,MAAM,CAEvB;IAED,aAAa,IAAI,mBAAmB,EAAE,CAErC;IAED,aAAa,IAAI,IAAI,CAEpB;CACJ;AAED,qBAAa,mBAAmB;IAChB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAArC,YAA6B,QAAQ,EAAE,iBAAiB,EAAI;IAE5D,OAAO,IAAI,MAAM,CAEhB;IAED,OAAO,IAAI,IAAI,CAEd;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,UAAU,IAAI,OAAO,CAEpB;CACJ;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS,CA+B7E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ClassType, type Type, type TypeObjectLiteral, type TypePropertySignature } from './model.js';
|
|
2
|
+
export declare function unwrapValueType(type: Type): Type;
|
|
3
|
+
export declare function mergedIntersectionObjectLiteral(type: Type): TypeObjectLiteral | undefined;
|
|
4
|
+
export declare function mergeStructuredProperties(type: Type): TypePropertySignature[];
|
|
5
|
+
export declare function objectLiteralPropertiesFromType(type: TypeObjectLiteral, seen?: Set<Type>): TypePropertySignature[];
|
|
6
|
+
export declare function objectLiteralIndexType(type: TypeObjectLiteral, seen?: Set<Type>): Type | undefined;
|
|
7
|
+
export declare function isMarkerType(type: Type): boolean;
|
|
8
|
+
export declare function allowsUndefined(type: Type): boolean;
|
|
9
|
+
export declare function allowsNull(type: Type): boolean;
|
|
10
|
+
export declare function resolveClassType(value: ClassType | (() => ClassType)): ClassType;
|
|
11
|
+
export declare function tryResolveClassType(value: ClassType | (() => ClassType)): ClassType | undefined;
|
|
12
|
+
export declare function normalizeTypeMetadata(value: unknown, seen?: Set<unknown>): void;
|
|
13
|
+
export declare function isClass(value: unknown): value is ClassType;
|
|
14
|
+
export declare function expandUtilityTypeMetadata(record: Record<string, unknown>): void;
|
|
15
|
+
export declare function recordPropertiesFromKeyType(keyType: Type, valueType: Type): TypePropertySignature[];
|
|
16
|
+
export declare function recordLiteralKeysFromType(type: Type): Array<string | number>;
|
|
17
|
+
export declare function flattenRuntimeUnionTypes(type: Type): Type[];
|
|
18
|
+
export declare function isExtractAssignable(source: Type, target: Type): boolean;
|
|
19
|
+
export declare function typesOverlap(left: Type, right: Type): boolean;
|
|
20
|
+
export declare function literalMatchesType(value: unknown, type: Type): boolean;
|
|
21
|
+
export declare function utilitySourcePropertiesFromType(type: Type): TypePropertySignature[];
|
|
22
|
+
export declare function mergeUtilityProperties(properties: TypePropertySignature[]): TypePropertySignature[];
|
|
23
|
+
export declare function cloneUtilityProperty(property: TypePropertySignature): TypePropertySignature;
|
|
24
|
+
export declare function isUtilityTypeName(value: unknown): value is 'Pick' | 'Omit' | 'Partial' | 'Required' | 'Extract' | 'Record' | 'OptionalNulls';
|
|
25
|
+
export declare function getUtilityTypeName(record: Record<string, unknown>): 'Pick' | 'Omit' | 'Partial' | 'Required' | 'Extract' | 'Record' | 'OptionalNulls' | undefined;
|
|
26
|
+
export declare function visitType(type: Type, visitor: (type: Type) => void): void;
|
|
27
|
+
export declare function visitTypeSurface(type: Type, visitor: (type: Type) => void): void;
|
|
28
|
+
export declare function findNested<T>(type: Type, predicate: (type: Type) => T | undefined): T | undefined;
|
|
29
|
+
export declare function findNestedSurface<T>(type: Type, predicate: (type: Type) => T | undefined): T | undefined;
|
|
30
|
+
export declare function hasNestedType(type: Type, predicate: (type: Type) => boolean): boolean;
|
|
31
|
+
export declare function literalNumber(type: Type | undefined): number | undefined;
|
|
32
|
+
export declare function resolveRuntimeValue(type: Type | undefined): unknown;
|
|
33
|
+
export declare function joinPath(base: string, key: string): string;
|
|
34
|
+
//# sourceMappingURL=type-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-utils.d.ts","sourceRoot":"","sources":["../../src/reflection/type-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,iBAAiB,EAEtB,KAAK,qBAAqB,EAC7B,MAAM,YAAY,CAAC;AAEpB,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAYhD;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,IAAI,GAAG,iBAAiB,GAAG,SAAS,CAOzF;AAWD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,IAAI,GAAG,qBAAqB,EAAE,CA6B7E;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,YAAkB,GAAG,qBAAqB,EAAE,CAmBxH;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,YAAkB,GAAG,IAAI,GAAG,SAAS,CAYxG;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAEhD;AA0CD,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAMnD;AAED,wBAAgB,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