# API `@deepkit/type`

```shell
npm install @deepkit/type
```

## API reference of @deepkit/type

### nodeBufferToTypedArray (function)

```typescript
<K>(buf: Uint8Array, type: TypedArrayClassType<K>): K
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L82

### base64ToTypedArray (function)

Decodes base64 into a new TypedArray that does not share its ArrayBuffer.

```typescript
<K>(base64: string, type: TypedArrayClassType<K>): K
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L100

### base64ToArrayBuffer (function)

Creates a new fresh ArrayBuffer with given data.

```typescript
(base64: string): ArrayBuffer
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L107

### nodeBufferToArrayBuffer (function)

When using Buffer.from() node is using a buffer from the buffer pool.
This makes it necessary to create the a new ArrayType using slice to make a copy.

This makes a copy.

```typescript
<K>(buf: Uint8Array | ArrayBuffer): ArrayBuffer
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L117

### typedArrayToBuffer (function)

In node environment the TypedArray.buffer is probably a larger buffer from the buffer pool.
This makes it necessary to create a Buffer with offset & length so that it accurately represents
the given TypedArray.

Returns a Buffer where available (Node, Bun, Deno), otherwise a Uint8Array.

```typescript
<K>(typedArray: TypedArray): Uint8Array
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L129

### arrayBufferToBase64 (function)

```typescript
(arrayBuffer: ArrayBuffer): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L136

### typedArrayToBase64 (function)

```typescript
(typedArray: TypedArray): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L142

### arrayBufferFrom (function)

Same as Buffer.from() but creates a ArrayBuffer that is not shared.

```typescript
(data: string, encoding?: string): ArrayBuffer
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L151

### arrayBufferTo (function)

Same as Buffer.from(arrayBuffer).toString(encoding), but more in line with the current API.

```typescript
(arrayBuffer: ArrayBuffer | Uint8Array, encoding?: string | "utf8" | "base64" | "ascii"): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L172

### unpopulatedSymbol (variable)

```typescript
unique symbol
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L20

### TypeSettings (type)

```typescript
interface TypeSettings {
    registeredEntities: { [name: string]: ClassType };
    unpopulatedCheck: UnpopulatedCheck;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L22

### typeSettings (variable)

```typescript
TypeSettings
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L27

### TypedArrayClassType (type)

```typescript
interface TypedArrayClassType<T> {
    new(...args: any[]): T;

    readonly BYTES_PER_ELEMENT: number;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L29

### TypedArray (type)

```typescript
interface TypedArray {
    /**
     * The size in bytes of each element in the array.
     */
    readonly BYTES_PER_ELEMENT: number;

    /**
     * The ArrayBuffer instance referenced by the array.
     */
    readonly buffer: ArrayBufferLike;

    /**
     * The length of the array.
     */
    readonly length: number;

    /**
     * The length in bytes of the array.
     */
    readonly byteLength: number;

    /**
     * The offset in bytes of the array.
     */
    readonly byteOffset: number;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/core.ts#L35

### atomicChange (function)

```typescript
<T extends object>(object: T): AtomicChangeInstance<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L152

### NumberFields (type)

```typescript
type NumberFields<T> = { [K in keyof T]: T[K] extends number | bigint ? K : never }[keyof T]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L13

### Expression (type)

```typescript
type Expression<T> = { [P in keyof T & string]?: string; }
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L14

### Partial (type)

```typescript
type Partial<T> = { [P in keyof T & string]?: T[P] }
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L15

### DeepPartial (type)

```typescript
type DeepPartial<T> = {
    [P in keyof T]?: T[P]
} & { [deepPath: string]: any };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L17

### ChangesInterface (type)

```typescript
interface ChangesInterface<T> {
    $set?: DeepPartial<T> | T;
    $unset?: { [path: string]: number };
    $inc?: Partial<Pick<T, NumberFields<T>>>;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L21

### Changes (class)

```typescript
export class Changes<T extends object> {
    $set?: DeepPartial<T> | T;
    $unset?: {
        [path: string]: number;
    };
    $inc?: Partial<Pick<T, NumberFields<T>>>;
    empty;
    fieldNames: string[];
    constructor(changes?: ChangesInterface<T>);
    clear(): void;
    getReturning(): string[];
    replaceSet($set: DeepPartial<T> | T);
    mergeSet($set: Partial<T> | T);
    increase(property: NumberFields<T>, increase: number = );
    set(property: keyof T & string, value: any);
    unset(property: keyof T & string, unset = true);
    has(name: keyof T & string): boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L27

### ItemChanges (class)

```typescript
export class ItemChanges<T extends object> extends Changes<T> {
    constructor(changes: ChangesInterface<T> = {}, protected item: T);
    increase(property: NumberFields<T>, increase: number = );
    set(property: keyof T & string, value: any);
    unset(property: keyof T & string, unset: boolean = true);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L112

### changeSetSymbol (variable)

```typescript
unique symbol
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L136

### AtomicChangeInstance (class)

```typescript
export class AtomicChangeInstance<T extends object> {
    readonly changeSet: Changes<T>;
    constructor(protected object: any);
    increase(property: NumberFields<T>, increase: number = );
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/changes.ts#L138

### isWithDeferredDecorators (function)

```typescript
(obj: any): obj is { __decorators: DeferredDecorator[]; }
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator.ts#L129

### t (function)

```typescript
PropertyDecoratorResult<typeof TDecorator>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator.ts#L70

### entity (function)

```typescript
ClassDecoratorResult<typeof EntityDecorator>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator.ts#L120

### createFluidDecorator (function)

```typescript
<API extends APIClass<any> | APIProperty<any>, D extends Function>(api: API, modifier: { name: string; args?: any; Ω?: any; }[], collapse: (modifier: { name: string; args?: any; }[], target: any, property?: string, parameterIndexOrDescriptor?: any) => void, returnCollapse?: boolean, fluidFunctionSymbol?: symbol): FluidDecorator<ExtractClass<API>, D>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L22

### mergeDecorator (function)

```typescript
<T extends any[]>(...args: T): Merge<Omit<UnionToIntersection<T[number]>, "_fetch" | "t">>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L90

### createClassDecoratorContext (function)

```typescript
<API extends APIClass<any>, T = ExtractApiDataType<API>>(apiType: API): ClassDecoratorResult<API>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L210

### createPropertyDecoratorContext (function)

```typescript
<API extends APIProperty<any>>(apiType: API): PropertyDecoratorResult<API>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L264

### createFreeDecoratorContext (function)

```typescript
<API extends APIClass<any>, T = ExtractApiDataType<API>>(apiType: API): FreeDecoratorResult<API>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L331

### isDecoratorContext (function)

```typescript
<API extends APIClass<any>>(context: FreeDecoratorResult<API>, fn: Function): fn is FreeFluidDecorator<API>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L366

### ClassDecoratorFn (type)

```typescript
type ClassDecoratorFn = (classType: AbstractClassType, property?: string, parameterIndexOrDescriptor?: any) => void;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L13

### PropertyDecoratorFn (type)

```typescript
type PropertyDecoratorFn = (prototype: object, property?: number | string | symbol, parameterIndexOrDescriptor?: any) => void;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L14

### FluidDecorator (type)

```typescript
type FluidDecorator<T, D extends Function> = {
    [name in keyof T]: T[name] extends (...args: infer K) => any ? (...args: K) => D & FluidDecorator<T, D>
        : D & FluidDecorator<T, D>
        & { _data: ExtractApiDataType<T> };
};
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L16

### UnionToIntersection (type)

```typescript
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L82

### Merge (type)

```typescript
type Merge<U> = { [K in keyof U]: U[K] extends ((...a: infer A) => infer R) ? R extends DualDecorator ? (...a: A) => PropertyDecoratorFn & R & U : (...a: A) => R : never };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L83

### DualDecorator (type)

A dual decorator is a decorator that can be used on a class and class property.

```typescript
type DualDecorator = void & { __DualDecorator?: true };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L88

### ClassApiTypeInterface (type)

```typescript
interface ClassApiTypeInterface<T> {
    t: T,
    onDecorator?: (classType: ClassType, property?: string, parameterIndexOrDescriptor?: any) => void
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L199

### APIClass (type)

```typescript
type APIClass<T> = ClassType<ClassApiTypeInterface<T>>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L204

### ExtractClass (type)

```typescript
type ExtractClass<T> = T extends ClassType<infer K> ? K : never;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L205

### ExtractApiDataType (type)

```typescript
type ExtractApiDataType<T> = T extends AbstractClassType<infer K> ? K extends { t: infer P } ? P : never : (T extends { t: infer P } ? P : never);
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L206

### ClassDecoratorResult (type)

```typescript
type ClassDecoratorResult<API extends APIClass<any>> = FluidDecorator<ExtractClass<API>, ClassDecoratorFn> & DecoratorAndFetchSignature<API, ClassDecoratorFn>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L208

### PropertyApiTypeInterface (type)

```typescript
interface PropertyApiTypeInterface<T> {
    t: T,
    onDecorator?: (target: ClassType, property: string | undefined, parameterIndexOrDescriptor?: any) => void
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L252

### APIProperty (type)

```typescript
type APIProperty<T> = ClassType<PropertyApiTypeInterface<T>>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L257

### DecoratorAndFetchSignature (type)

```typescript
type DecoratorAndFetchSignature<API extends APIProperty<any>, FN extends (...args: any[]) => any> = & FN
    & { _fetch: (...args: Parameters<FN>) => ExtractApiDataType<API> | undefined };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L259

### PropertyDecoratorResult (type)

```typescript
type PropertyDecoratorResult<API extends APIProperty<any>> = FluidDecorator<ExtractClass<API>, PropertyDecoratorFn> & DecoratorAndFetchSignature<API, PropertyDecoratorFn>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L262

### FreeDecoratorFn (type)

```typescript
type FreeDecoratorFn<API> =
    { (target?: any, property?: number | string | symbol, parameterIndexOrDescriptor?: any): ExtractApiDataType<API> }
    & { _data: ExtractApiDataType<API> };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L319

### FreeFluidDecorator (type)

```typescript
type FreeFluidDecorator<API> = {
    [name in keyof ExtractClass<API>]: ExtractClass<API>[name] extends (...args: infer K) => any
        ? (...args: K) => FreeFluidDecorator<API>
        : FreeFluidDecorator<API>
} & FreeDecoratorFn<API>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L323

### FreeDecoratorResult (type)

```typescript
type FreeDecoratorResult<API extends APIClass<any>> = FreeFluidDecorator<API> & { _fluidFunctionSymbol: symbol };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/decorator-builder.ts#L329

### isReferenceInstance (function)

```typescript
(obj: any): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L16

### getReferenceInfo (function)

```typescript
<T>(obj: T): ReferenceInfo<T> | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L20

### getReferenceItemInfo (function)

```typescript
<T>(obj: T): ReferenceItemInfo<T> | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L24

### getOrCreateReferenceItemInfo (function)

```typescript
<T>(obj: T): ReferenceItemInfo<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L28

### isReferenceHydrated (function)

```typescript
(obj: any): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L33

### markAsHydrated (function)

```typescript
(item: any): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L39

### createReference (function)

```typescript
<T>(type: ClassType<T> | Type | ReflectionClass<any>, pk: { [name: string]: any; }): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L54

### createReferenceClass (function)

```typescript
<T>(reflection: ReflectionClass<any>): ClassType<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L69

### ReferenceInfo (type)

```typescript
interface ReferenceInfo<T> {
    hydrator?: (item: T) => Promise<void>;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L43

### ReferenceItemInfo (type)

```typescript
interface ReferenceItemInfo<T> {
    hydrated: boolean,
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L47

### referenceSymbol (variable)

```typescript
unique symbol
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L51

### referenceItemSymbol (variable)

```typescript
unique symbol
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reference.ts#L52

### getPartialType (function)

```typescript
(type: TypeClass | TypeObjectLiteral): any
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L165

### getPartialSerializeFunction (function)

Creates a (cached) Partial<T> of the given type and returns a (cached) serializer function for the given registry (serialize or deserialize).

```typescript
(type: TypeClass | TypeObjectLiteral, registry: TemplateRegistry, namingStrategy?: NamingStrategy): SerializeFunction<any, any>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L182

### getSerializeFunction (function)

Returns a (cached) serializer function for the given registry (serialize or deserialize).

```typescript
(type: Type, registry: TemplateRegistry, namingStrategy?: NamingStrategy, path?: string, jitStack?: JitStack): SerializeFunction
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L189

### createSerializeFunction (function)

```typescript
(type: Type, registry: TemplateRegistry, namingStrategy?: NamingStrategy, path?: string | RuntimeCode | (string | RuntimeCode)[], jitStack?: JitStack): SerializeFunction
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L202

### createTypeGuardFunction (function)

```typescript
(type: Type, stateIn?: Partial<TemplateState>, serializerToUse?: Serializer, withLoose?: boolean): undefined | Guard<any>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L232

### collapsePath (function)

```typescript
(path: (string | RuntimeCode)[], prefix?: string): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L289

### getPropertyNameString (function)

```typescript
(propertyName?: string | RuntimeCode): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L293

### noopTemplate (function)

Just sets the state.setter to state.accessor without any modification.

```typescript
(type: Type, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L628

### callExtractedFunctionIfAvailable (function)

To avoid circular builds, class/object literal code is extract to its own function.
if this returns true, code is put into state to call an already existing function.

```typescript
(state: TemplateState, type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L782

### extractStateToFunctionAndCallIt (function)

```typescript
(state: TemplateState, type: Type): { setFunction: (fn: Function) => { fn: Function | undefined; }; id: number; state: TemplateState; }
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L796

### buildFunction (function)

```typescript
(state: TemplateState, type: Type): Function
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L804

### executeTemplates (function)

```typescript
(state: TemplateState, type: Type, withLoose?: boolean, withCache?: boolean): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L845

### createConverterJSForMember (function)

```typescript
(property: ReflectionProperty | TypeProperty | TypePropertySignature | TypeIndexSignature, state: TemplateState, undefinedSetterCode?: string, nullSetterCode?: string): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L931

### inAccessor (function)

```typescript
(accessor: ContainerAccessor | string): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1011

### deserializeEmbedded (function)

```typescript
(type: TypeClass | TypeObjectLiteral, state: TemplateState, container?: string): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1016

### getIndexCheck (function)

```typescript
(context: CompilerContext, i: string, type: Type): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1094

### sortSignatures (function)

Sort, so the order is literal, number, string, symbol.  literal comes first as its the most specific type.
We need to do that for numbers since all keys are string|symbol in runtime, and we need to check if a string is numeric first before falling back to string.

```typescript
(signatures: TypeIndexSignature[]): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1124

### getStaticDefaultCodeForProperty (function)

```typescript
(member: TypeProperty | TypePropertySignature, setter: string | ContainerAccessor, state: TemplateState): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1132

### getEmbeddedProperty (function)

```typescript
(type: TypeClass | TypeObjectLiteral): TypeProperty | TypePropertySignature | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1144

### serializeObjectLiteral (function)

```typescript
(type: TypeObjectLiteral | TypeClass, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1179

### typeGuardEmbedded (function)

```typescript
(type: TypeClass | TypeObjectLiteral, state: TemplateState, embedded: EmbeddedOptions): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1385

### typeGuardObjectLiteral (function)

```typescript
(type: TypeObjectLiteral | TypeClass, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1408

### serializeArray (function)

```typescript
(type: TypeArray, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1567

### typeGuardArray (function)

```typescript
(elementType: Type, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1590

### getSetTypeToArray (function)

```typescript
(type: TypeClass): TypeArray
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1724

### getMapTypeToArray (function)

```typescript
(type: TypeClass): TypeArray
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1735

### getNTypeToArray (function)

```typescript
(type: TypeClass, n: number): TypeArray
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1754

### executeTypeArgumentAsArray (function)

```typescript
(type: TypeClass, typeIndex: number, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1766

### forwardSetToArray (function)

```typescript
(type: TypeClass, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1770

### forwardMapToArray (function)

```typescript
(type: TypeClass, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1774

### serializePropertyOrParameter (function)

```typescript
(type: TypePropertySignature | TypeProperty | TypeParameter, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1778

### validatePropertyOrParameter (function)

```typescript
(type: TypePropertySignature | TypeProperty | TypeParameter, state: TemplateState): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1798

### describeValueType (function)

The type of a value for error messages: `string`, `number`, `array`, `object`, `null`, `undefined`, or the class name, e.g. `Date`.

```typescript
(value: any): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L1870

### handleUnion (function)

```typescript
(type: TypeUnion, state: TemplateState, typeGuards?: TypeGuardRegistry): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L2024

### getNameExpression (function)

```typescript
(name: string | number | symbol | undefined, state: TemplateState): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L2211

### NamingStrategy (class)

Make sure to change the id when a custom naming strategy is implemented, since caches are based on it.

```typescript
export class NamingStrategy {
    constructor(public id: string = );
    getPropertyName(type: TypeProperty | TypePropertySignature, forSerializer: string): string | undefined;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L73

### underscoreNamingStrategy (variable)

```typescript
(Anonymous class)
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L86

### SerializationOptions (type)

Options that can be passed to the serialization/deserialization functions
and change the behavior in runtime (not embedded in JIT).

```typescript
interface SerializationOptions {
    /**
     * Which groups to include. If a property is not assigned to
     * a given group, it will be excluded.
     * Use an empty array to include only non-grouped properties.
     */
    groups?: string[];

    /**
     * Which groups to exclude. If a property is assigned to at least
     * one given group, it will be excluded. Basically the opposite of
     * `groups`, but you can combine both.
     * Use an empty array to exclude only non-grouped properties.
     */
    groupsExclude?: string[];

    /**
     * Allows more loosely data for certain types. e.g.
     *
     * - '1', '0', 'true', 'false' will be converted to true|false for boolean type.
     * - '1' will be converted to number for number type.
     * - 1 will be converted to string for string type.
     *
     * This will activate all registered type guards with negative specifically.
     *
     * This is enabled by default.
     */
    loosely?: boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L102

### SerializeFunction (type)

```typescript
type SerializeFunction<T = any, R = any> = (data: T, state?: SerializationOptions) => R;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L163

### Guard (type)

```typescript
type Guard<T> = (data: any, state?: { errors?: ValidationErrorItem[] }) => data is T;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L230

### SerializationError (error)

```typescript
export class SerializationError extends CustomError {
    constructor(public originalMessage: string, public code: string = , public path: string = );
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L278

### RuntimeCode (class)

```typescript
export class RuntimeCode {
    constructor(public code: string);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L284

### JitStack (class)

internal: The jit stack cache is used in both serializer and guards, so its cache key needs to be aware of it

```typescript
export class JitStack {
    getStack(registry?: TemplateRegistry);
    has(registry: TemplateRegistry, type: Type): boolean;
    get(registry: TemplateRegistry, type: Type);
    prepare(registry: TemplateRegistry, type: Type): {
        id: number;
        prepare: (fn: Function) => {
            fn: Function | undefined;
        };
    };
    getOrCreate(registry: TemplateRegistry | undefined, type: Type, create: () => Function): {
        fn: Function | undefined;
        id: number;
    };
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L300

### ContainerAccessor (class)

```typescript
export class ContainerAccessor {
    constructor(public container: string | ContainerAccessor, public property: string);
    toString();
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L348

### TemplateState (class)

```typescript
export class TemplateState {
    /**
     * Before and after template content is rendered before/after all other templates.
     * When a template is put into its own function, before/after templates are run outside of this function.
     */
    template;
    ended;
    setter: string | ContainerAccessor;
    accessor: string | ContainerAccessor;
    /**
     * Strict means only use type guards of specificality of 1 (used for is()/validation()).
     * For deserialization loose is used.
     */
    validation?:  | ;
    /**
     * Object type guards return the number of matching properties instead of true, to pick the closest union member.
     * Only set for the guards of union members (not inherited by forks), since the counting slows down validation.
     */
    scoreObject?: boolean;
    /**
     * Set for the code of type guard functions. Their `_path` is only used for the messages in `state.errors`.
     */
    typeGuard?: boolean;
    /**
     * When this is set all specificalities are used (used in union type guards to detect which member to pick).
     */
    allSpecificalities?: TypeGuardRegistry;
    propertyName?: string | RuntimeCode;
    setterDisabled: boolean;
    parentTypes: Type[];
    target:  | ;
    constructor(public originalSetter: string | ContainerAccessor, public originalAccessor: string | ContainerAccessor, public compilerContext: CompilerContext, public registry: TemplateRegistry, public namingStrategy: NamingStrategy = new NamingStrategy, public jitStack: JitStack = new JitStack(), public path: (string | RuntimeCode)[] = []);
    isValidation(): boolean;
    withScoreObject(): this;
    withValidation(validation: this[]): this;
    includeAllSpecificalities(guardRegistry: TypeGuardRegistry): this;
    replaceTemplate(template: string);
    /**
     * Forks as state, with an empty propertyName.
     */
    fork(setter?: string | ContainerAccessor, accessor?: string | ContainerAccessor, path?: (string | RuntimeCode)[]): TemplateState;
    fullFork();
    forRegistry(registry: TemplateRegistry);
    forPropertyName(name?: string | number | symbol | RuntimeCode): this;
    disableSetter(): this;
    enableSetter(): this;
    /**
     * Can be used to track which annotation was already handled. Necessary to use with `isAnnotationHandled` to avoid infinite recursive loops
     * when a serializer template issues sub calls depending on annotation data.
     */
    annotationHandled(annotation: AnnotationDefinition<any>): void;
    isAnnotationHandled(annotation: AnnotationDefinition<any>): boolean;
    get isSerialization(): boolean;
    get isDeserialization(): boolean;
    extendPath(path: string | RuntimeCode | number | symbol): this;
    /**
     * Type error `Expected ${expected}, got ${type of the value}`, e.g. `Expected 'a' | 'b', got number`.
     */
    assignExpectedError(expected: string);
    assignValidationError(code: string, message: string);
    throwCode(type: Type | string, error?: string, accessor: string | ContainerAccessor = this.originalAccessor);
    /**
     * Adds template code for setting the `this.setter` variable. The expression evaluated in `code` is assigned to `this.setter`.
     * `this.accessor` will point now to `this.setter`.
     */
    addSetter(code: string | {
        toString(): string;
    });
    addSetterAndReportErrorIfInvalid(errorCode: string, message: string, code: string);
    /**
     * Adds a converter function that is executed on the current `this.accessor` value.
     *
     * @example
     * ```typescript
     * serializer.deserializeRegistry.registerClass(Date, (type, state) => {
     *     // make sure to check `v` as it is any!
     *     state.convert((v: any) => {
     *         if ('number' !== typeof v) throw new SerializationError('Expected number');
     *         return new Date(v);
     *     });
     * });
     *
     * serializer.serializeRegistry.registerClass(Date, (type, state) => {
     *     // in serialization `v` is always the specific type
     *     state.convert((v: Date) => v.getTime());
     * });
     * ```
     */
    convert(callback: (value: any) => any);
    /**
     * Allows to add a custom code that is executed on the current `this.accessor` value.
     *
     * @example
     * ```typescript
     * serializer.deserializeRegistry.addDecorator(
     *     isCustomTypeClass,
     *     (type, state) => {
     *         state.touch((value) => {
     *              if ('onLoad' in value) value.onLoad();
     *         });
     *     }
     * );
     * ```
     */
    touch(callback: (value: any) => void);
    /**
     * Stop executing next templates.
     */
    stop();
    setVariable(name: string, value?: any): string;
    setContext(values: {
        [name: string]: any;
    });
    addCode(code: string);
    /**
     * Adds template code for setting the `this.setter` variable manually, so use `${state.setter} = value`.
     * `this.accessor` will point now to `this.setter`.
     */
    addCodeForSetter(code: string);
    hasSetterCode(): boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L357

### Template (type)

```typescript
type Template<T extends Type> = (type: T, state: TemplateState) => void;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L621

### TemplateHook (type)

```typescript
type TemplateHook = (type: Type, state: TemplateState) => void;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L623

### TemplateRegistry (class)

```typescript
export class TemplateRegistry {
    id: number;
    /**
     * Cache key of getSerializeFunction() with the default naming strategy.
     */
    readonly defaultFunctionKey: string;
    preHooks: TemplateHook[];
    postHooks: TemplateHook[];
    classTemplates;
    constructor(public serializer: Serializer = new EmptySerializer());
    clear();
    get(type: Type): Template<Type>[];
    getDecorator(type: Type): Template<Type>[];
    /**
     * Registers a template for all binary classes: ArrayBuffer, Uint8Array, Int8Array, etc.
     */
    registerBinary(template: Template<TypeClass>);
    /**
     * Registers a template for a given class type.
     *
     * As soon as a single template has registered for the given classType the template registry
     * only returns templates for this particular classType and omits all general purpose ReflectionKind.class templates for this particular classType.
     */
    registerClass(classType: ClassType, template: Template<TypeClass>);
    prependClass(classType: ClassType, template: Template<TypeClass>);
    appendClass(classType: ClassType, template: Template<TypeClass>);
    addPreHook(callback: TemplateHook);
    addPostHook(callback: TemplateHook);
    /**
     * Removes all registered templates.
     */
    unregister(kind: ReflectionKind);
    /**
     * Registers a new template and replaces all existing (added via register,prepend,append).
     */
    register<T extends ReflectionKind>(kind: T, template: Template<FindType<Type, T>>);
    /**
     * Registers additional templates that handle type decorators/annotations. The templates can safely assume that the given type in `state.accessor`
     * is already type-checked to be `T`.
     *
     * Decorator templates run last (after normal templates and postHook).
     *
     * This split between register and registerForDecorator is made to have a distinction between native type templates and additional user-made templates.
     * This allows to fetch only decorator templates and decide upon the result whether additional code is necessary or not. (this would not be possible
     * if everything is added to the `register` call that does always the basic checks).
     */
    addDecorator(predicate: (type: Type) => boolean, template: Template<Type>);
    /**
     * Removes all registered decorators for a certain type.
     */
    removeDecorator(type: Type);
    prepend<T extends ReflectionKind>(kind: T, template: Template<FindType<Type, T>>);
    append<T extends ReflectionKind>(kind: T, template: Template<FindType<Type, T>>);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L637

### TypeGuardRegistry (class)

```typescript
export class TypeGuardRegistry {
    registry: {
        [specificality: number]: TemplateRegistry;
    };
    /**
     * Lowest specificality first
     */
    getSortedTemplateRegistries();
    constructor(public serializer: Serializer);
    clear();
    /**
     *
     * @see register() for specificality explanation.
     */
    getRegistry(specificality: number): TemplateRegistry;
    /**
     * Registers a new template and replaces all existing (added via register,prepend,append).
     *
     * Specificality defines when the given template guard is executed.
     *
     * - 1 means its used for JS types - exact types. For example for type string `'string' ==== typeof v` is used. Same for number, bigint, and boolean.
     *   Guards of this specificality are used for the `is()` function.
     *
     * - >1 means it acts as a fallback. For example in a union `number | Date`, when a string is given, the Date can allow `string` type as well, so it gets converted to a Date.
     *
     * - >0 && <1 means its acts as a priority guard. For example in a `string | Date`, a string of date-format is converted to a Date instead of a string. This is necessary
     *   to support regular JSON.
     *
     * - <0, anything below 0 means it can optionally be used for loosely types. This is handy when data comes from a string-only encoding like URL query strings.
     *   In this specificality a numeric string is converted to a number or bigint, a 1|0|true|false string converted to boolean .
     */
    register<T extends ReflectionKind>(specificality: number, kind: T, template: Template<FindType<Type, T>>);
    /**
     * @see register
     */
    registerClass(specificality: number, classType: ClassType, template: Template<TypeClass>);
    /**
     * @see register
     */
    registerBinary(specificality: number, template: Template<TypeClass>);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L2218

### Serializer (class)

Default serializer that can convert JS data structures to the target type.
It coerces types, converts object literals to class instances, and has type guards for JS types.

JSONSerializer has the same but for JSON data structures.

```typescript
export class Serializer {
    serializeRegistry;
    deserializeRegistry;
    typeGuards;
    validators;
    constructor(public name: string = );
    setExplicitUndefined(type: Type, state: TemplateState): boolean;
    clear();
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L2304

### serializableKinds (variable)

```typescript
ReflectionKind[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L2775

### EmptySerializer (class)

```typescript
export class EmptySerializer extends Serializer {
    constructor(name: string = );
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L2801

### serializer (variable)

```typescript
Serializer
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer.ts#L2845

### cast (function)

Casts/coerces a given data structure to the target data type and validates all attached validators.

Same as validatedDeserialize().

```typescript
<T>(data: JSONPartial<T> | unknown, options?: SerializationOptions, serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L26

### castFunction (function)

Same as cast but returns a ready to use function. Used to improve performance.

```typescript
<T>(serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): (data: JSONPartial<T> | unknown, options?: SerializationOptions) => T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L36

### deserialize (function)

Deserialize given data structure from JSON data objects to JavaScript objects, without running any validators.

Types that are already correct will be used as-is.

```typescript
interface Data {
    created: Date;
}

const data = deserialize<Data>({created: '2009-02-13T23:31:30.123Z'});
//data is {created: Date(2009-02-13T23:31:30.123Z)}

```typescript
<T>(data: JSONPartial<T> | unknown, options?: SerializationOptions, serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L61

### deserializeFunction (function)

Same as deserialize but returns a ready to use function. Used to improve performance.

```typescript
<T>(serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): SerializeFunction<any, T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L69

### patch (function)

Patch serialization for deep dot paths, e.g. `{'user.shippingAddress.street': 'abc'}`
If a naming strategy is used, it could be converted to `{'user.shipping_address.street': 'abc'}`.

```typescript
<T>(data: DeepPartial<T>, options?: SerializationOptions, serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): (data: JSONPartial<T> | unknown) => T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L77

### getPatchSerializeFunction (function)

Create a serializer/deserializer function including validator for the given type for a patch structure.
This is handy for deep patch structures like e.g '{user.address.street: "new street"}'.

```typescript
(type: TypeClass | TypeObjectLiteral, registry: TemplateRegistry, namingStrategy?: NamingStrategy): (data: any, state?: SerializationOptions, patch?: { normalizeArrayIndex: boolean; }) => any
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L87

### serialize (function)

Serialize given data structure to JSON data objects (not a JSON string).

The resulting JSON object can be stringified using JSON.stringify().

```typescript
interface Data {
    created: Date;
}

const json = serialize<Data>({created: new Date(1234567890123)});
//json is {created: '2009-02-13T23:31:30.123Z'}

const jsonString = JSON.stringify(json);
//jsonString is '{"created":"2009-02-13T23:31:30.123Z"}'
```

```typescript
<T>(data: T, options?: SerializationOptions, serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): JSONSingle<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L181

### serializeFunction (function)

Same as serialize but returns a ready to use function. Used to improve performance.

```typescript
<T>(serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): SerializeFunction<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L189

### cloneClass (function)

Clones a class instance deeply.

```typescript
<T>(target: T, options?: SerializationOptions): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L196

### validatedDeserialize (function)

Tries to deserialize given data as T, and throws an error if it's not possible or validation after conversion fails.

```typescript
<T>(data: any, options?: SerializationOptions, serializerToUse?: Serializer, namingStrategy?: NamingStrategy, type?: ReceiveType<T>): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/serializer-facade.ts#L211

### getValidatorFunction (function)

```typescript
const validator = getValidatorFunction<MyType>();

const errors: ValidationErrorItem[] = [];
const valid = validator(data, {errors})

if (errors.length) console.log(errors); //validation failed if not empty
```

```typescript
<T>(serializerToUse?: Serializer, receiveType?: ReceiveType<T>): Guard<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/typeguard.ts#L17

### is (function)

```typescript
<T>(data: any, serializerToUse?: Serializer, errors?: ValidationErrorItem[], receiveType?: ReceiveType<T>): data is T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/typeguard.ts#L31

### guard (function)

```typescript
<T>(serializerToUse?: Serializer, receiveType?: ReceiveType<T>): Guard<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/typeguard.ts#L37

### assert (function)

```typescript
<T>(data: any, serializerToUse?: Serializer, receiveType?: ReceiveType<T>): asserts data is T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/typeguard.ts#L45

### AutoId (type)

```typescript
type AutoId = number & PrimaryKey & AutoIncrement & Positive;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/types.ts#L4

### uuid (function)

Returns a new UUID v4 as string.

```typescript
(): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L24

### writeUuid (function)

Writes a new uuid v4 into an existing buffer, and returns the same buffer.

```typescript
(buffer: Uint8Array, offset?: number): Uint8Array
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L31

### stringifyUuid (function)

Stringify an exising Uint8Array buffer.

```typescript
(buffer: Uint8Array, offset?: number): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L42

### regExpFromString (function)

```typescript
(v: string): RegExp
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L90

### NoTypeReceived (error)

```typescript
export class NoTypeReceived extends Error {
    constructor(message: string =  + runtimeTypeHelp);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L12

### Binary (type)

```typescript
type Binary = ArrayBuffer | Uint8Array | Int8Array | Uint8ClampedArray | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L47

### JSONPartial (type)

```typescript
type JSONPartial<T> = T extends Date ? string :
    T extends Array<infer K> ? Array<JSONPartial<K>> :
        // T extends TypedArrays ? string :
        T extends Binary ? string :
            T extends object ? JSONPartialObject<T> :
                T extends string ? number | T :
                    T extends boolean ? number | string | T :
                        T extends bigint ? number | string | T :
                            T extends number ? bigint | string | T :
                                T;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L49

### JSONPartialObject (type)

```typescript
type JSONPartialObject<T> = { [name in keyof T]?: T[name] | null };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L60

### JSONSingle (type)

```typescript
type JSONSingle<T> = T extends Date ? string | Date :
    T extends Array<infer K> ? Array<JSONSingle<K>> :
        T extends Binary ? string :
            T extends object ? JSONEntity<T> :
                T extends string ? string | number | boolean | undefined :
                    T extends boolean ? T | number | string :
                        T extends number ? T | string : T;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L62

### JSONEntity (type)

```typescript
type JSONEntity<T> = { [name in keyof T]: JSONSingle<T[name]> };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/utils.ts#L69

### validate (function)

Returns empty array when valid, or ValidationErrorItem[] with detailed error messages if not valid.

Returns validation error items when failed. If successful returns an empty array.

```typescript
<T>(data: any, type?: ReceiveType<T>): ValidationErrorItem[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L131

### validateFunction (function)

```typescript
<T>(serializerToUse?: Serializer, type?: ReceiveType<T>): (data: T) => ValidationErrorItem[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L137

### validates (function)

Returns true when valid, and false if not.

```typescript
<T>(data: any, type?: ReceiveType<T>): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L149

### ValidatorMeta (type)

```typescript
type ValidatorMeta<Name extends string, Args extends [...args: any[]] = []> = TypeAnnotation<'validator', [Name, Args]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L8

### ValidateFunction (type)

```typescript
type ValidateFunction = (value: any, type: Type, options: any) => ValidatorError | void;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L10

### Validate (type)

```typescript
type Validate<T extends ValidateFunction, Options extends Parameters<T>[2] = unknown> = ValidatorMeta<'function', [T, Options]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L11

### Pattern (type)

```typescript
type Pattern<T extends RegExp> = ValidatorMeta<'pattern', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L12

### Alpha (type)

```typescript
type Alpha = ValidatorMeta<'alpha'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L13

### Alphanumeric (type)

```typescript
type Alphanumeric = ValidatorMeta<'alphanumeric'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L14

### Ascii (type)

```typescript
type Ascii = ValidatorMeta<'ascii'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L15

### Decimal (type)

```typescript
type Decimal<MinDigits extends number = 1, MaxDigits extends number = 100> = ValidatorMeta<'decimal', [MinDigits, MaxDigits]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L16

### MultipleOf (type)

```typescript
type MultipleOf<Num extends number> = ValidatorMeta<'multipleOf', [Num]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L17

### MinLength (type)

```typescript
type MinLength<Length extends number> = ValidatorMeta<'minLength', [Length]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L18

### MaxLength (type)

```typescript
type MaxLength<Length extends number> = ValidatorMeta<'maxLength', [Length]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L19

### Includes (type)

```typescript
type Includes<T extends string | number | boolean> = ValidatorMeta<'includes', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L21

### Excludes (type)

```typescript
type Excludes<T extends string | number | boolean> = ValidatorMeta<'excludes', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L22

### Minimum (type)

```typescript
type Minimum<T extends number | bigint> = ValidatorMeta<'minimum', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L24

### Maximum (type)

```typescript
type Maximum<T extends number | bigint> = ValidatorMeta<'maximum', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L25

### Positive (type)

Includes 0. Use PositiveNoZero to exclude 0.

```typescript
type Positive = ValidatorMeta<'positive', unknown & [true]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L30

### Negative (type)

Includes 0. Use NegativeNoZero to exclude 0.

```typescript
type Negative = ValidatorMeta<'negative', [true]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L35

### PositiveNoZero (type)

```typescript
type PositiveNoZero = ValidatorMeta<'positive', [false]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L37

### NegativeNoZero (type)

```typescript
type NegativeNoZero = ValidatorMeta<'negative', [false]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L38

### ExclusiveMinimum (type)

```typescript
type ExclusiveMinimum<T extends number | bigint> = ValidatorMeta<'exclusiveMinimum', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L40

### ExclusiveMaximum (type)

```typescript
type ExclusiveMaximum<T extends number | bigint> = ValidatorMeta<'exclusiveMaximum', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L41

### BeforeDate (type)

```typescript
type BeforeDate<T extends number> = ValidatorMeta<'beforeDate', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L43

### AfterDate (type)

```typescript
type AfterDate<T extends number> = ValidatorMeta<'afterDate', [T]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L44

### BeforeNow (type)

```typescript
type BeforeNow = ValidatorMeta<'beforeNow'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L45

### AfterNow (type)

```typescript
type AfterNow = ValidatorMeta<'afterNow'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L46

### EMAIL_REGEX (variable)

```typescript
RegExp
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L48

### Email (type)

```typescript
type Email = string & Pattern<typeof EMAIL_REGEX>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L49

### ValidatorError (class)

Used in validator functions.

```typescript
export class ValidatorError {
    constructor(public readonly code: string, public readonly message: string, public readonly path?: string);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L54

### ValidationErrorItem (class)

The structure of a validation error.

Path defines the shallow or deep path (using dots).
Message is an arbitrary message in english.

In validators please use and return `new ValidatorError('code', 'message')` instead.

```typescript
export class ValidationErrorItem {
    /**
     * The path to the property. Might be a deep path separated by dot.
     */
    constructor(public readonly path: string, public readonly code: string, public readonly message: string, public readonly value?: any);
    toString(prefix: string = );
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L71

### ValidationError (error)

```typescript
@entity.name()
export class ValidationError extends CustomError {
    constructor(public readonly errors: ValidationErrorItem[], type?: Type);
    static from(errors: {
        path: string;
        message: string;
        code?: string;
        value?: any;
    }[]);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validator.ts#L112

### validators (variable)

```typescript
{ [x: string]: ((...args: any[]) => (value: any) => ValidatorError | undefined) | undefined; }
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/validators.ts#L5

### getConverterForSnapshot (function)

Creates a new JIT compiled function to convert the class instance to a snapshot.
A snapshot is essentially the class instance as `plain` serialization while references are
stored only as their primary keys.

Generated function is cached.

```typescript
(reflectionClass: ReflectionClass<any>): (value: any) => any
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/snapshot.ts#L155

### createSnapshot (function)

Creates a snapshot using getConverterForSnapshot().

```typescript
<T>(reflectionClass: ReflectionClass<T>, item: T): any
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/snapshot.ts#L169

### getPrimaryKeyExtractor (function)

Extracts the primary key of a snapshot and converts to class type.

```typescript
<T>(reflectionClass: ReflectionClass<T>): (value: any) => Partial<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/snapshot.ts#L176

### getPrimaryKeyHashGenerator (function)

Creates a primary key hash generator that takes an item from any format
converts it to class format, then to plain, then uses the primitive values to create a string hash.

This function is designed to work on the plain values (db records or json values)

```typescript
(reflectionClass: ReflectionClass<any>, serializerToUse?: Serializer): (value: any) => string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/snapshot.ts#L193

### getSimplePrimaryKeyHashGenerator (function)

```typescript
(reflectionClass: ReflectionClass<any>): (data: PrimaryKeyFields<any>) => string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/snapshot.ts#L220

### snapshotSerializer (variable)

```typescript
SnapshotSerializer
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/snapshot.ts#L146

### genericEqual (function)

This is a comparator function for the snapshots. They are either string, number, boolean, array, or objects.
No date, moment, or custom classes involved here.

```typescript
(a: any, b: any): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/change-detector.ts#L47

### getChangeDetector (function)

```typescript
<T extends object>(classSchema: ReflectionClass<T>): (last: any, current: any, item: T) => ItemChanges<T> | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/change-detector.ts#L274

### buildChanges (function)

```typescript
<T extends object>(classSchema: ReflectionClass<T>, lastSnapshot: any, item: T): Changes<T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/change-detector.ts#L284

### resolvePath (function)

```typescript
<T>(path: string, type?: ReceiveType<T>): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/path.ts#L61

### pathResolver (function)

```typescript
<T>(type?: ReceiveType<T>, jitStack?: JitStack): Resolver
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/path.ts#L69

### Resolver (type)

```typescript
type Resolver = (path: string) => Type | undefined;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/path.ts#L6

### serializeType (function)

Converts a (possibly circular/nested) type into a JSON.stringify'able structure suited to be transmitted over the wire and deserialized back to the correct Type object.

```typescript
(type: Type, state?: Partial<SerializerState>): SerializedTypes
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L563

### deserializeType (function)

```typescript
(types?: SerializedTypes, state?: Partial<DeserializeState>): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L811

### SerializedTypeAnnotations (type)

```typescript
interface SerializedTypeAnnotations {
    entityOptions?: EntityOptions;

    typeName?: string;

    typeArguments?: SerializedTypeReference[];

    indexAccessOrigin?: { container: SerializedTypeReference, index: SerializedTypeReference };

    // annotations will be generated on deserialization from the decorators
    // annotations?: Annotations; //parsed decorator types as annotations

    decorators?: SerializedTypeReference[]; //original decorator type
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L30

### SerializedTypeBaseMember (type)

```typescript
interface SerializedTypeBaseMember extends SerializedTypeAnnotations {
    visibility: ReflectionVisibility,
    abstract?: true;
    optional?: true,
    readonly?: true;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L102

### SerializedTypeMethod (type)

```typescript
interface SerializedTypeMethod extends SerializedTypeBaseMember {
    kind: ReflectionKind.method,
    visibility: ReflectionVisibility,
    name: number | string | symbol;
    parameters: SerializedTypeParameter[];
    optional?: true,
    abstract?: true;
    return: SerializedTypeReference;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L109

### SerializedTypeUnion (type)

```typescript
interface SerializedTypeUnion extends SerializedTypeAnnotations {
    kind: ReflectionKind.union,
    types: SerializedTypeReference[];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L147

### SerializedTypeIntersection (type)

```typescript
interface SerializedTypeIntersection extends SerializedTypeAnnotations {
    kind: ReflectionKind.intersection,
    types: SerializedTypeReference[];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L152

### SerializedTypeTypeParameter (type)

```typescript
interface SerializedTypeTypeParameter extends SerializedTypeAnnotations {
    kind: ReflectionKind.typeParameter,
    name: string,
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L185

### SerializedType (type)

```typescript
type SerializedType =
    SimpleSerializedType
    | SerializedTypeLiteral
    | SerializedTypeTemplateLiteral
    | SerializedTypeParameter
    | SerializedTypeFunction
    | SerializedTypeMethod
    | SerializedTypeProperty
    | SerializedTypePromise
    | SerializedTypeClassType
    | SerializedTypeEnum
    | SerializedTypeUnion
    | SerializedTypeIntersection
    | SerializedTypeArray
    | SerializedTypeObjectLiteral
    | SerializedTypeIndexSignature
    | SerializedTypePropertySignature
    | SerializedTypeMethodSignature
    | SerializedTypeTypeParameter
    | SerializedTypeInfer
    | SerializedTypeTuple
    | SerializedTypeTupleMember
    | SerializedTypeRest;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L211

### SerializedTypes (type)

```typescript
type SerializedTypes = SerializedType[];
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L235

### SerializerState (type)

```typescript
interface SerializerState {
    types: SerializedTypes;
    disableMethods?: true;
    refs: Map<Type, number>;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/type-serialization.ts#L250

### TypeRegistry (class)

```typescript
export class TypeRegistry<T> {
    classes;
    clear(): void;
    get(type: Type): T | undefined;
    decorator(predicate: (type: Type) => boolean, v: T): void;
    /**
     * Registers a template for all binary classes: ArrayBuffer, Uint8Array, Int8Array, etc.
     */
    setBinary(v: T): void;
    setNumeric(v: T): void;
    /**
     * Registers a template for a given class type.
     *
     * As soon as a single template has registered for the given classType the template registry
     * only returns templates for this particular classType and omits all general purpose ReflectionKind.class templates for this particular classType.
     */
    setClass(classType: ClassType, v: T): void;
    /**
     * Removes all registered templates.
     */
    remove(kind: ReflectionKind): void;
    /**
     * Registers a new template and replaces all existing (added via register,prepend,append).
     */
    set(kind: ReflectionKind | ReflectionKind[] | ((type: Type) => boolean), v: T): void;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/registry.ts#L9

### defaultValue (function)

Returns a sensible default value for a given type.
Sensible means it satisfies the type checker, but not necessarily attached validators.

```typescript
(type: Type): any
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/default.ts#L7

### mixin (function)

Function to mixin multiple classes together and create a new class, which can be extended from.

The first entry of the mixin() call will be used as base class.

```typescript
<T extends AbstractClassType[]>(...classTypes: T): ClassType<UnionToIntersection<ExtractClassType<T[number]>>>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/mixin.ts#L32

### applyScheduledAnnotations (function)

```typescript
(type: Type): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L132

### hasTypeInformation (function)

```typescript
(object: ClassType | Function): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L147

### getTypeJitContainer (function)

```typescript
(type: Type): JitContainer
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L156

### clearTypeJitContainer (function)

```typescript
(type: Type): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L161

### isIntegerType (function)

```typescript
(type: Type): type is TypeNumber
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L195

### isType (function)

```typescript
(entry: any): entry is Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L546

### isBinary (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L550

### isPrimitive (function)

```typescript
<T extends Type>(type: T): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L554

### isPropertyType (function)

```typescript
(type: Type): type is TypePropertySignature | TypeProperty
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L559

### isPropertyMemberType (function)

Returns true if the type is TypePropertySignature | TypeProperty and not a static member.

```typescript
(type: Type): type is TypePropertySignature | TypeProperty
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L566

### getConstructorProperties (function)

Return all properties created in the constructor (via `constructor(public title: string)`)

If a non-property parameter is in the constructor, the type is given instead, e.g. `constructor(public title: string, anotherOne:number)` => [TypeProperty, TypeNumber]

```typescript
(type: TypeClass | TypeObjectLiteral): { parameters: (TypeProperty | Type)[]; properties: TypeProperty[]; }
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L576

### isWithAnnotations (function)

```typescript
(type: ParentLessType): type is WithAnnotations
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L619

### getAnnotations (function)

```typescript
(type: WithAnnotations): Annotations
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L626

### isSameType (function)

Checks if the structure of a and b are identical.

```typescript
(a: Type, b: Type, stack?: StackEntry[]): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L646

### addType (function)

```typescript
<T extends Type>(container: T, type: Type): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L818

### isTypeIncluded (function)

```typescript
(types: Type[], type: Type, stack?: StackEntry[]): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L847

### flatten (function)

`true | (string | number)` => `true | string | number`

```typescript
<T extends Type>(type: T): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L858

### flattenUnionTypes (function)

Flatten nested union types.

```typescript
(types: Type[]): Type[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L868

### unboxUnion (function)

empty union => never
union with one member => member
otherwise the union is returned

```typescript
(union: TypeUnion): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L888

### findMember (function)

```typescript
(index: string | number | symbol | TypeTemplateLiteral, types: Type[]): TypePropertySignature | TypeMethodSignature | TypeMethod | TypeProperty | TypeIndexSignature | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L930

### emptyObject (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L986

### indexAccess (function)

Query a container type and return the result.

container[index]

e.g. {a: string}['a'] => string
e.g. {a: string, b: number}[keyof T] => string | number
e.g. [string, number][0] => string
e.g. [string, number][number] => string | number

```typescript
(container: Type, index: Type): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1078

### merge (function)

```typescript
(types: (TypeObjectLiteral | TypeClass)[]): TypeObjectLiteral
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1239

### narrowOriginalLiteral (function)

```typescript
(type: Type): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1263

### copyAndSetParent (function)

This function does not do a deep copy, only shallow. A deep copy makes it way to inefficient, so much that router.spec.ts takes up to 20-30seconds
to complete instead of barely 30ms.

```typescript
<T extends ParentLessType>(inc: T, parent?: Type): FindType<Type, T["kind"]>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1280

### widenLiteral (function)

```typescript
(type: Type): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1338

### assertType (function)

```typescript
<K extends ReflectionKind, T>(t: Type | undefined, kind: K): asserts t is FindType<Type, K>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1351

### getClassType (function)

```typescript
(type: Type): ClassType
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1355

### isMember (function)

```typescript
(type: Type): type is TypePropertySignature | TypeProperty | TypeMethodSignature | TypeMethod
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1360

### hasMember (function)

```typescript
(type: TypeObjectLiteral | TypeClass, memberName: number | string | symbol, memberType?: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1365

### getMember (function)

```typescript
(type: TypeObjectLiteral | TypeClass, memberName: number | string | symbol): TypeMethodSignature | TypeMethod | TypePropertySignature | TypeProperty | void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1369

### getTypeObjectLiteralFromTypeClass (function)

```typescript
<T extends Type>(type: T): T extends TypeClass ? TypeObjectLiteral : T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1373

### isOptional (function)

Checks whether `undefined` is allowed as type.

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1403

### hasDefaultValue (function)

Whether a property has an initializer/default value.

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1414

### isNullable (function)

Checks whether `null` is allowed as type.

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1421

### isUUIDType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1703

### isPrimaryKeyType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1707

### isAutoIncrementType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1711

### isMongoIdType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1715

### isBinaryBigIntType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1719

### isReferenceType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1723

### getReferenceType (function)

```typescript
(type: Type): ReferenceOptions | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1727

### isBackReferenceType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1731

### resolveProperty (function)

```typescript
(type: Type): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1735

### getBackReferenceType (function)

```typescript
(type: Type): BackReferenceOptionsResolved
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1742

### isDateType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1748

### isSetType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1752

### isMapType (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1756

### getKeyType (function)

Get the key type of a Map or object literal with index signatures.

```typescript
(type: Type): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1763

### getValueType (function)

Get the value type of a Map or object literal with index signatures.

```typescript
(type: Type): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1780

### hasEmbedded (function)

```typescript
(type: Type): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1801

### registerTypeDecorator (function)

```typescript
(decorator: TypeDecorator): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2008

### getAnnotationMeta (function)

Type annotations are object literals with a single optional __meta in it
that has as type a tuple with the name of the annotation as first entry.
The tuple is intersected with the `never` type to make sure it does not
interfere with type checking.

The processor has currently implemented to not resolve `never & x` to `never`,
so we still have the intersection type in runtime to resolve __meta correctly.

```typescript
type MyAnnotation1 = TypeAnnotation<'myAnnotation'>
type MyAnnotation1<T> = TypeAnnotation<'myAnnotation', T>

//under the hood it is:
type lowLevel1 = { __meta?: never & ['myAnnotation'] }
type lowLevel2<T> = { __meta?: never & ['myAnnotation', T] }
```

```typescript
(type: TypeObjectLiteral): { id: string; options: Type; } | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2030

### typeToObject (function)

```typescript
(type?: Type, state?: { stack: Type[]; }): any
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2211

### memberNameToString (function)

```typescript
(name: number | string | symbol): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2272

### isGlobalTypeClass (function)

Returns true if the given type is Date, ArrayBuffer, Uint8Array, etc.

```typescript
(type: Type): type is TypeClass
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2295

### isCustomTypeClass (function)

Returns true if the given type is TypeClass and references a custom (non-global) class.

```typescript
(type: Type): type is TypeClass
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2303

### isTypeClassOf (function)

Returns a type predicate that checks if the given type is a class and is of the given classType.
If withInheritance is true, it also checks if the type is a subclass of the given classType.

```typescript
(classType: ClassType, withInheritance?: boolean): (type: Type) => boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2311

### resolveTypeMembers (function)

Returns the members of a class or object literal.

```typescript
(type: TypeClass | TypeObjectLiteral): (TypeProperty | TypePropertySignature | TypeMethodSignature | TypeMethod | TypeIndexSignature | TypeCallSignature)[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2324

### stringifyResolvedType (function)

```typescript
(type: Type): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2328

### stringifyShortResolvedType (function)

```typescript
(type: Type, stateIn?: Partial<StringifyTypeOptions>): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2332

### getDeepConstructorProperties (function)

Returns all (including inherited) constructor properties of a class.

```typescript
(type: TypeClass): TypeParameter[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2339

### getEnumValueIndexMatcher (function)

Returns the index to `type.values` if the given value is part of the enum, exactly or case-insensitive.
Returns -1 if not found.

```typescript
(type: TypeEnum): (value: string | number | undefined | null) => number
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2361

### stringifyType (function)

```typescript
(type: Type, stateIn?: Partial<StringifyTypeOptions>): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2387

### annotateClass (function)

```typescript
<T>(clazz: ClassType | AbstractClassType, type?: ReceiveType<T>): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2826

### TypeDecorator (type)

```typescript
type TypeDecorator = (annotations: Annotations, decorator: TypeObjectLiteral) => boolean;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L75

### Annotations (type)

```typescript
type Annotations = any;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L77

### TypeAnnotations (type)

```typescript
interface TypeAnnotations {
    // if defined, it is a nominal type. the number is unique for each nominal type.
    id?: number;

    origin?: Type;

    /**
     * True when this type comes from an inline type, e.g.
     *
     * `type A = T;`. Type of `T` is inlined.
     * `type A = {}`. Type of `{}` is not inlined.
     *
     * If the type is not inlined and the result of a type function, then we assign parents of members accordingly. This is not the caee when a type was inlined.
     */
    inlined?: true;

    /**
     * If the type was created by a type function, this contains the alias name.
     */
    typeName?: string;

    /**
     * If the type was created by a type function, this contains the arguments passed the function.
     */
    typeArguments?: Type[];

    /**
     * Set for index access expressions, e.g. Config['property'].
     */
    indexAccessOrigin?: { container: TypeClass | TypeObjectLiteral, index: Type };

    /**
     * type User = {id: number, user: string};
     * type UserCreate = Pick<User, 'user'>;
     * typeOf<UserCreate>().originTypes[0].typeName = 'Pick'
     * typeOf<UserCreate>().originTypes[0].typeArguments = [User, 'user']
     */
    originTypes?: { typeName: string, typeArguments?: Type[] }[];

    annotations?: Annotations; //parsed decorator types as annotations
    decorators?: Type[]; //original decorator type

    scheduleDecorators?: TypeObjectLiteral[];

    /**
     * A place where arbitrary jit functions and its cache data is stored.
     */
    jit?: JitContainer;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L82

### JitContainer (type)

Object to hold runtime jit data.

```typescript
type JitContainer = any;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L154

### TypeNever (type)

```typescript
interface TypeNever extends TypeAnnotations {
    kind: ReflectionKind.never,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L165

### TypeAny (type)

```typescript
interface TypeAny extends TypeAnnotations {
    kind: ReflectionKind.any,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L170

### TypeUnknown (type)

```typescript
interface TypeUnknown extends TypeAnnotations {
    kind: ReflectionKind.unknown,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L175

### TypeVoid (type)

```typescript
interface TypeVoid extends TypeAnnotations {
    kind: ReflectionKind.void,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L180

### TypeObject (type)

```typescript
interface TypeObject extends TypeAnnotations {
    kind: ReflectionKind.object,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L185

### TypeString (type)

```typescript
interface TypeString extends TypeAnnotations {
    kind: ReflectionKind.string,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L190

### TypeNumber (type)

```typescript
interface TypeNumber extends TypeAnnotations {
    kind: ReflectionKind.number,
    brand?: TypeNumberBrand; //built in brand
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L199

### TypeBoolean (type)

```typescript
interface TypeBoolean extends TypeAnnotations {
    kind: ReflectionKind.boolean,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L205

### TypeBigInt (type)

```typescript
interface TypeBigInt extends TypeAnnotations {
    kind: ReflectionKind.bigint,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L210

### TypeSymbol (type)

```typescript
interface TypeSymbol extends TypeAnnotations {
    kind: ReflectionKind.symbol,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L215

### TypeNull (type)

```typescript
interface TypeNull extends TypeAnnotations {
    kind: ReflectionKind.null,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L220

### TypeUndefined (type)

```typescript
interface TypeUndefined extends TypeAnnotations {
    kind: ReflectionKind.undefined,
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L225

### TypeLiteral (type)

```typescript
interface TypeLiteral extends TypeAnnotations {
    kind: ReflectionKind.literal,
    literal: symbol | string | number | boolean | bigint | RegExp;
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L230

### TypeTemplateLiteral (type)

```typescript
interface TypeTemplateLiteral extends TypeAnnotations {
    kind: ReflectionKind.templateLiteral,
    types: (TypeString | TypeAny | TypeNumber | TypeLiteral | TypeInfer)[]
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L236

### TypeRegexp (type)

```typescript
interface TypeRegexp extends TypeAnnotations {
    kind: ReflectionKind.regexp;
    parent?: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L242

### TypeBaseMember (type)

```typescript
interface TypeBaseMember extends TypeAnnotations {
    visibility: ReflectionVisibility,
    abstract?: true;
    static?: true;
    optional?: true,
    readonly?: true;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L258

### TypeParameter (type)

```typescript
interface TypeParameter extends TypeAnnotations {
    kind: ReflectionKind.parameter,
    name: string;
    type: Type;
    parent: TypeFunction | TypeMethod | TypeMethodSignature | TypeCallSignature;

    //parameter could be a property as well if visibility is set
    visibility?: ReflectionVisibility,
    readonly?: true;
    optional?: true,
    description?: string;

    /**
     * Set when the parameter has a default value aka initializer.
     */
    default?: () => any
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L266

### TypeMethod (type)

```typescript
interface TypeMethod extends TypeBaseMember {
    kind: ReflectionKind.method,
    parent: TypeClass;
    name: number | string | symbol;
    description?: string;
    parameters: TypeParameter[];
    return: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L284

### TypeProperty (type)

```typescript
interface TypeProperty extends TypeBaseMember {
    kind: ReflectionKind.property,
    parent: TypeClass;
    visibility: ReflectionVisibility,
    name: number | string | symbol;
    description?: string;
    type: Type;

    /**
     * Set when the property has a default value aka initializer.
     */
    default?: () => any
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L293

### TypeFunction (type)

```typescript
interface TypeFunction extends TypeAnnotations {
    kind: ReflectionKind.function,
    parent?: Type;
    name?: number | string | symbol,
    description?: string;
    function?: Function; //reference to the real function if available
    parameters: TypeParameter[];
    return: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L307

### TypeCallSignature (type)

```typescript
interface TypeCallSignature extends TypeAnnotations {
    kind: ReflectionKind.callSignature,
    parent?: Type;
    parameters: TypeParameter[];
    return: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L317

### TypePromise (type)

```typescript
interface TypePromise extends TypeAnnotations {
    kind: ReflectionKind.promise,
    parent?: Type;
    type: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L324

### TypeClass (type)

```typescript
interface TypeClass extends TypeAnnotations {
    kind: ReflectionKind.class,
    parent?: Type;
    classType: ClassType;
    description?: string;

    /**
     * When the class extends another class and uses on it generic type arguments, then those arguments
     * are in this array.
     * For example `class A extends B<string, boolean> {}` then extendsArguments = [string, boolean].
     * The reference to `B` is not part of TypeClass since this information is available in JavaScript runtime
     * by using `Object.getPrototypeOf(type.classType)`.
     */
    extendsArguments?: Type[];

    /**
     * When the class implements another interface/type, then those types are in this array.
     *
     * For example `class A implements B<string, boolean> {}` then implements = [B<string, boolean>].
     */
    implements?: Type[];

    /**
     * When class has generic type arguments, e.g. MyClass<string>, it contains
     * all type arguments. If no type arguments are given, it's undefined.
     */
    arguments?: Type[];

    /**
     * properties/methods.
     */
    types: (TypeIndexSignature | TypeProperty | TypeMethod)[];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L330

### TypeEnum (type)

```typescript
interface TypeEnum extends TypeAnnotations {
    kind: ReflectionKind.enum,
    parent?: Type;
    enum: { [name: string]: string | number | undefined | null };
    values: (string | number | undefined | null)[];
    indexType: Type;
    description?: string;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L364

### TypeEnumMember (type)

```typescript
interface TypeEnumMember extends TypeAnnotations {
    kind: ReflectionKind.enumMember,
    parent: TypeEnum;
    name: string;
    default?: () => string | number;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L373

### TypeTypeParameter (type)

```typescript
interface TypeTypeParameter extends TypeAnnotations {
    kind: ReflectionKind.typeParameter,
    parent?: Type;
    name: string,
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L380

### TypeUnion (type)

```typescript
interface TypeUnion extends TypeAnnotations {
    kind: ReflectionKind.union,
    parent?: Type;
    types: Type[];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L386

### TypeIntersection (type)

```typescript
interface TypeIntersection extends TypeAnnotations {
    kind: ReflectionKind.intersection,
    parent?: Type;
    types: Type[];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L392

### TypeArray (type)

```typescript
interface TypeArray extends TypeAnnotations {
    kind: ReflectionKind.array,
    parent?: Type;
    type: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L398

### TypePropertySignature (type)

```typescript
interface TypePropertySignature extends TypeAnnotations {
    kind: ReflectionKind.propertySignature,
    parent: TypeObjectLiteral;
    name: number | string | symbol;
    optional?: true;
    readonly?: true;
    description?: string;
    type: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L404

### TypeMethodSignature (type)

```typescript
interface TypeMethodSignature extends TypeAnnotations {
    kind: ReflectionKind.methodSignature,
    parent: TypeObjectLiteral;
    name: number | string | symbol;
    optional?: true;
    description?: string;
    parameters: TypeParameter[];
    return: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L414

### TypeObjectLiteral (type)

Object literals or interfaces.

```typescript
interface TypeObjectLiteral extends TypeAnnotations {
    kind: ReflectionKind.objectLiteral,

    parent?: Type;
    description?: string;
    types: (TypeIndexSignature | TypePropertySignature | TypeMethodSignature | TypeCallSignature)[];

    /**
     * When the interface extends another interface/type, then those types are in this array.
     *
     * For example `interface A extends B<string, boolean> {}` then implements = [B<string, boolean>].
     */
    implements?: Type[];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L427

### TypeIndexSignature (type)

```typescript
interface TypeIndexSignature extends TypeAnnotations {
    kind: ReflectionKind.indexSignature,
    parent: TypeClass | TypeObjectLiteral;
    index: Type;
    type: Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L442

### TypeInfer (type)

```typescript
interface TypeInfer extends TypeAnnotations {
    kind: ReflectionKind.infer,
    parent?: Type;

    set(type: Type): void;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L449

### TypeTupleMember (type)

```typescript
interface TypeTupleMember extends TypeAnnotations {
    kind: ReflectionKind.tupleMember,
    parent: TypeTuple;
    type: Type;
    optional?: true;
    name?: string;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L456

### TypeTuple (type)

```typescript
interface TypeTuple extends TypeAnnotations {
    kind: ReflectionKind.tuple,
    parent?: Type;
    types: TypeTupleMember[]
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L464

### TypeRest (type)

```typescript
interface TypeRest extends TypeAnnotations {
    kind: ReflectionKind.rest,
    parent: TypeTypeParameter | TypeTupleMember;
    type: Type
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L470

### Type (type)

```typescript
type Type =
    TypeNever
    | TypeAny
    | TypeUnknown
    | TypeVoid
    | TypeObject
    | TypeString
    | TypeNumber
    | TypeBoolean
    | TypeBigInt
    | TypeSymbol
    | TypeNull
    | TypeUndefined
    | TypeLiteral
    | TypeTemplateLiteral
    | TypeParameter
    | TypeFunction
    | TypeMethod
    | TypeProperty
    | TypePromise
    | TypeClass
    | TypeEnum
    | TypeEnumMember
    | TypeUnion
    | TypeIntersection
    | TypeArray
    | TypeObjectLiteral
    | TypeIndexSignature
    | TypePropertySignature
    | TypeMethodSignature
    | TypeTypeParameter
    | TypeInfer
    | TypeTuple
    | TypeTupleMember
    | TypeRest
    | TypeRegexp
    | TypeCallSignature
    ;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L479

### Widen (type)

```typescript
type Widen<T> =
    T extends string ? string
        : T extends number ? number
            : T extends bigint ? bigint
                : T extends boolean ? boolean
                    : T extends symbol ? symbol : T;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L518

### FindType (type)

```typescript
type FindType<T extends Type, LOOKUP extends ReflectionKind> = T extends {
    kind: infer K
} ? K extends LOOKUP ? T : never : never;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L525

### InlineRuntimeType (type)

Merge dynamic runtime types with static types. In the type-system resolves as any, in runtime as the correct type.

```typescript
const stringType = {kind: ReflectionKind.string};
type t = {a: InlineRuntimeType<typeof stringType>}

const value = 34;
type t = {a: InlineRuntimeType<typeof value>}
```

```typescript
type InlineRuntimeType<T extends ReceiveType<unknown> | undefined | ReflectionClass<any> | Type | number | string | boolean | bigint, R = any> = T extends ReflectionClass<infer K>
    ? K : T extends ReceiveType<unknown>
        ? R : T extends Type ? R
            : T extends undefined
                ? never : T;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L540

### WithAnnotations (type)

```typescript
type WithAnnotations =
    TypeAny
    | TypeUnknown
    | TypeString
    | TypeNumber
    | TypeBigInt
    | TypeBoolean
    | TypeArray
    | TypeTuple
    | TypeLiteral
    | TypeNull
    | TypeUndefined
    | TypeClass
    | TypeObjectLiteral
    | TypeObject
    | TypeTemplateLiteral
    | TypeRegexp
    | TypeSymbol;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L600

### CartesianProduct (class)

```typescript
export class CartesianProduct {
    toGroup(type: Type): Type[];
    add(item: Type);
    calculate(): Type[][];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L990

### ParentLessType (type)

```typescript
type ParentLessType = RemoveDeepParent<Type>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1274

### integer (type)

Integer

```typescript
type integer = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1429

### int8 (type)

Integer 8 bit.
Min value -127, max value 128

```typescript
type int8 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1435

### uint8 (type)

Unsigned integer 8 bit.
Min value 0, max value 255

```typescript
type uint8 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1441

### int16 (type)

Integer 16 bit.
Min value -32768, max value 32767

```typescript
type int16 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1447

### uint16 (type)

Unsigned integer 16 bit.
Min value 0, max value 65535

```typescript
type uint16 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1453

### int32 (type)

Integer 8 bit.
Min value -2147483648, max value 2147483647

```typescript
type int32 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1459

### uint32 (type)

Unsigned integer 32 bit.
Min value 0, max value 4294967295

```typescript
type uint32 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1465

### float (type)

Float (same as number, but different semantic for databases).

```typescript
type float = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1470

### float32 (type)

Float 32 bit.

```typescript
type float32 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1475

### float64 (type)

Float 64 bit.

```typescript
type float64 = number;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1480

### AnnotationDefinition (class)

```typescript
export class AnnotationDefinition<T = true> {
    symbol: symbol;
    constructor(public readonly id: string);
    register(annotations: Annotations, data: T);
    reset(annotations: Annotations);
    registerType<TType extends Type>(type: TType, data: T): TType;
    replace(annotations: Annotations, annotation: T[]);
    replaceType(type: Type, annotation: T[]);
    getAnnotations(type: Type): T[];
    getFirst(type: Type): T | undefined;
    hasAnnotations(type: Type): boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1482

### AnnotationType (type)

```typescript
type AnnotationType<T extends AnnotationDefinition<any>> = T extends AnnotationDefinition<infer K> ? K : never;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1528

### ReferenceActions (type)

```typescript
type ReferenceActions = 'RESTRICT' | 'NO ACTION' | 'CASCADE' | 'SET NULL' | 'SET DEFAULT';
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1530

### ReferenceOptions (type)

```typescript
interface ReferenceOptions {
    /**
     * Default is CASCADE.
     */
    onDelete?: ReferenceActions,

    /**
     * Default is CASCADE.
     */
    onUpdate?: ReferenceActions
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1532

### EntityOptions (type)

note: if this is adjusted, make sure to adjust ReflectionClass, entityAnnotation, and type serializer accordingly.

```typescript
interface EntityOptions {
    name?: string;
    description?: string;
    collection?: string;
    database?: string;
    singleTableInheritance?: boolean;
    indexes?: { names: string[], options: IndexOptions }[];
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1547

### Entity (type)

Type to decorate an interface/object literal with entity information.

```typescript
interface User extends Entity<{name: 'user'}> {
    id: number & PrimaryKey & AutoIncrement;
    username: string & Unique;
}
```

```typescript
type Entity<T extends EntityOptions> = {} & TypeAnnotation<'entity', T>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1566

### PrimaryKey (type)

Marks a property as primary key.
```typescript
class Entity {
    id: number & Primary = 0;
}
```

```typescript
type PrimaryKey = TypeAnnotation<'primaryKey'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1576

### PrimaryKeyFields (type)

```typescript
type PrimaryKeyFields<T> = any extends T ? any : { [P in keyof T]: Required<T[P]> extends Required<PrimaryKey> ? T[P] : never };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1579

### PrimaryKeyType (type)

```typescript
type PrimaryKeyType<T> = any extends T ? any : TypeKeyOf<PrimaryKeyFields<T>>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1580

### ReferenceFields (type)

```typescript
type ReferenceFields<T> = { [P in keyof T]: Required<T[P]> extends Required<Reference> | Required<BackReference> ? T[P] : never };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1582

### AutoIncrement (type)

Marks a primary property key as auto-increment.

```typescript
class Entity {
    id: number & Primary & AutoIncrement = 0;
}
```

```typescript
type AutoIncrement = TypeAnnotation<'autoIncrement'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1593

### UUID (type)

UUID v4, as string, serialized as string in JSON, and binary in database.
Use `uuid()` as handy initializer.

```typescript
class Entity {
    id: UUID = uuid();
}
```

```typescript
type UUID = string & TypeAnnotation<'UUIDv4'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1605

### MongoId (type)

MongoDB's ObjectID type. serialized as string in JSON, ObjectID in database.

```typescript
type MongoId = string & TypeAnnotation<'mongoId'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1610

### BinaryBigInt (type)

Same as `bigint` but serializes to unsigned binary with unlimited size (instead of 8 bytes in most databases).
Negative values will be converted to positive (abs(x)).

```typescript
class Entity {
    id: BinaryBigInt = 0n;
}
```

```typescript
type BinaryBigInt = bigint & TypeAnnotation<'binaryBigInt'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1622

### SignedBinaryBigInt (type)

Same as `bigint` but serializes to signed binary with unlimited size (instead of 8 bytes in most databases).
The binary has an additional leading sign byte and is represented as an uint: 255 for negative, 0 for zero, or 1 for positive.

```typescript
class Entity {
    id: SignedBinaryBigInt = 0n;
}
```

```typescript
type SignedBinaryBigInt = bigint & TypeAnnotation<'signedBinaryBigInt'>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1634

### BackReferenceOptions (type)

```typescript
interface BackReferenceOptions {
    /**
     * Necessary for normalised many-to-many relations. This defines the class of the pivot table/collection.
     */
    via?: ClassType | {};

    /**
     * A reference/backReference can define which reference on the other side
     * reference back. This is necessary when there are multiple outgoing references
     * to the same entity.
     */
    mappedBy?: string,
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1636

### Reference (type)

```typescript
type Reference<Options extends ReferenceOptions = {}> = TypeAnnotation<'reference', Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1650

### BackReference (type)

```typescript
type BackReference<Options extends BackReferenceOptions = {}> = TypeAnnotation<'backReference', Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1651

### EmbeddedMeta (type)

```typescript
type EmbeddedMeta<Options> = TypeAnnotation<'embedded', Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1652

### Embedded (type)

```typescript
type Embedded<T, Options extends { prefix?: string } = {}> = T & EmbeddedMeta<Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1653

### MapName (type)

```typescript
type MapName<Alias extends string, ForSerializer extends string = ''> = TypeAnnotation<'mapName', [Alias, ForSerializer]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1655

### referenceAnnotation (variable)

```typescript
AnnotationDefinition<ReferenceOptions>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1657

### entityAnnotation (variable)

```typescript
(Anonymous class)
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1658

### mapNameAnnotation (variable)

```typescript
AnnotationDefinition<{ name: string; serializer?: string | undefined; }>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1673

### autoIncrementAnnotation (variable)

```typescript
AnnotationDefinition<true>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1675

### primaryKeyAnnotation (variable)

```typescript
(Anonymous class)
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1676

### BackReferenceOptionsResolved (type)

```typescript
interface BackReferenceOptionsResolved {
    /**
     * Necessary for normalised many-to-many relations. This defines the class of the pivot table/collection.
     */
    via?: TypeClass | TypeObjectLiteral;

    /**
     * A reference/backReference can define which reference on the other side
     * reference back. This is necessary when there are multiple outgoing references
     * to the same entity.
     */
    mappedBy?: string,
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1682

### backReferenceAnnotation (variable)

```typescript
AnnotationDefinition<BackReferenceOptionsResolved>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1696

### validationAnnotation (variable)

```typescript
AnnotationDefinition<{ name: string; args: Type[]; }>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1697

### UUIDAnnotation (variable)

```typescript
AnnotationDefinition<true>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1698

### mongoIdAnnotation (variable)

```typescript
AnnotationDefinition<true>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1699

### uuidAnnotation (variable)

```typescript
AnnotationDefinition<true>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1700

### defaultAnnotation (variable)

```typescript
AnnotationDefinition<Type>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1701

### EmbeddedOptions (type)

```typescript
interface EmbeddedOptions {
    prefix?: string;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1795

### embeddedAnnotation (variable)

```typescript
AnnotationDefinition<EmbeddedOptions>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1799

### Group (type)

Assigns one or multiple groups to a type.

```typescript
/**
 * Assigns one or multiple groups to a type.
 *
 * @example
 * ```typescript
 * interface User {
 *     username: string;
 *     password: string & Group<'credentials'>;
 * }
 * ```
 */
export type Group<Name extends string> = TypeAnnotation<'group', Name>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1820

### Excluded (type)

Excludes the type from serialization of all kind.

```typescript
type Excluded<Name extends string = '*'> = TypeAnnotation<'excluded', Name>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1833

### Data (type)

Assigns arbitrary data to a type that can be read in runtime.

```typescript
type Data<Name extends string, Value> = TypeAnnotation<'data', [Name, Value]>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1846

### ResetAnnotation (type)

Resets an already set decorator to undefined.

The required Name is the name of the type decorator (its first tuple entry).

```typescript
type Password = string & MinLength<6> & Excluded;

interface UserCreationPayload {
    password: Password & ResetAnnotation<'excluded'>
}
```

```typescript
type ResetAnnotation<Name extends string> = TypeAnnotation<'reset', Name>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1861

### IndexOptions (type)

```typescript
type IndexOptions = {
    name?: string;
    //index size. Necessary for blob/longtext, etc.
    size?: number,

    unique?: boolean,
    spatial?: boolean,
    sparse?: boolean,

    //only in mongodb
    fulltext?: boolean,
    where?: string,

    expireAfterSeconds?: number,
};
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1863

### Unique (type)

```typescript
type Unique<Options extends IndexOptions = {}> = TypeAnnotation<'index', Options & { unique: true }>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1879

### Index (type)

```typescript
type Index<Options extends IndexOptions = {}> = TypeAnnotation<'index', Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1880

### DatabaseFieldOptions (type)

```typescript
interface DatabaseFieldOptions {
    /**
     * The name of the column in the database.
     * e.g. `userName: string & DatabaseField<{name: 'user_name'}>`
     *
     * Can alternatively also be configured by using a different NamingStrategy.
     */
    name?: string;

    /**
     *
     * e.g. `field: string & MySQL<{type: 'VARCHAR(255)'}>`
     */
    type?: string;

    /**
     * If the property is on a class, its initializer/default value is per default used.
     * This can be overridden using this option.
     * e.g. `field: string & MySQL<{default: 'abc'}>`
     */
    default?: any;

    /**
     * e.g. `field: string & MySQL<{defaultExpr: 'NOW()'}>`
     */
    defaultExpr?: any;

    /**
     * If true no default column value is inferred from the property initializer/default value.
     * e.g. `field: string & MySQL<{noDefault: true}> = ''`
     */
    noDefault?: true;

    /**
     * Skip this property in all queries and database migration files.
     */
    skip?: true;

    /**
     * Skip this property in database migration files. This excludes the property from the database, but
     * keeps it in the queries.
     */
    skipMigration?: true;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1882

### MySQLOptions (type)

```typescript
interface MySQLOptions extends DatabaseFieldOptions {
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1927

### PostgresOptions (type)

```typescript
interface PostgresOptions extends DatabaseFieldOptions {
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1930

### SqliteOptions (type)

```typescript
interface SqliteOptions extends DatabaseFieldOptions {
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1933

### MySQL (type)

```typescript
type MySQL<Options extends MySQLOptions> = Database<'mysql', Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1937

### Postgres (type)

```typescript
type Postgres<Options extends PostgresOptions> = Database<'postgres', Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1938

### SQLite (type)

```typescript
type SQLite<Options extends SqliteOptions> = Database<'sqlite', Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1939

### DatabaseField (type)

```typescript
type DatabaseField<Options extends DatabaseFieldOptions, Name extends string = '*'> = Database<Name, Options>;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1940

### binaryBigIntAnnotation (variable)

```typescript
AnnotationDefinition<BinaryBigIntType>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1947

### groupAnnotation (variable)

```typescript
AnnotationDefinition<string>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1948

### excludedAnnotation (variable)

```typescript
(Anonymous class)
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1949

### dataAnnotation (variable)

```typescript
(Anonymous class)
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1955

### typeAnnotation (variable)

All raw data from `TypeAnnotation<Name, Options>` types.

```typescript
(Anonymous class)
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1972

### indexAnnotation (variable)

```typescript
AnnotationDefinition<IndexOptions>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1991

### databaseAnnotation (variable)

```typescript
(Anonymous class)
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L1992

### typeDecorators (variable)

```typescript
TypeDecorator[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2058

### binaryTypes (variable)

```typescript
ClassType<any>[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/type.ts#L2279

### encodeOps (function)

```typescript
(ops: ReflectionOp[]): string
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L83

### pack (function)

Pack a pack structure (op instructions + pre-defined stack) and create a encoded version of it.

```typescript
(packOrOps: PackStruct | ReflectionOp[]): Packed
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L90

### unpack (function)

```typescript
(pack: Packed): PackStruct
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L103

### resolvePacked (function)

```typescript
(type: Packed, args?: any[], options?: ReflectOptions): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L116

### resolveRuntimeType (function)

Computes a type of given object. This function caches the result on the object itself.
This is the slow path, using the full type virtual machine to resolve the type.
If you want to handle some fast paths (including cache), try using resolveReceiveType() instead.

```typescript
(o: ClassType | Function | Packed | any, args?: any[], options?: ReflectOptions): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L129

### typeInfer (function)

```typescript
(value: any): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L1855

### getEnumType (function)

```typescript
(values: any[]): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L2032

### RuntimeStackEntry (type)

```typescript
type RuntimeStackEntry = Type | Object | (() => ClassType | Object) | string | number | boolean | bigint;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L65

### Packed (type)

```typescript
type Packed<T = any> = (RuntimeStackEntry | string)[] & { __is?: (data: any) => boolean } & { __type?: Type } & { __unpack?: PackStruct };
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L67

### PackStruct (class)

```typescript
export class PackStruct {
    constructor(public ops: ReflectionOp[] = [], public stack: RuntimeStackEntry[] = []);
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L69

### ReflectOptions (type)

```typescript
interface ReflectOptions {
    /**
     *
     */
    reuseCached?: boolean;

    inline?: boolean;

    typeName?: string;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L305

### Processor (class)

```typescript
export class Processor {
    static typeProcessor?: Processor;
    static get(): Processor;
    reflect(object: ClassType | Function | Packed | any, inputs: RuntimeStackEntry[] = [], options: ReflectOptions = {}): Type;
    _reflect(object: ClassType | Function | Packed | any, inputs: RuntimeStackEntry[] = [], options: ReflectOptions = {}): Type;
    run(ops: ReflectionOp[], initialStack: RuntimeStackEntry[], inputs: RuntimeStackEntry[] = [], object?: ClassType | Function | Packed | any): Type;
    runProgram(program: Program): Type;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/processor.ts#L319

### isExtendable (function)

The check of `extends` in Typescript. This function can be read as `left extends right`.

See https://www.typescriptlang.org/docs/handbook/type-compatibility.html#any-unknown-object-void-undefined-null-and-never-assignability
This algo follows strict mode.

Warning: If you do not pass Type objects, typeInfer() is used which does not use cache (it is designed to be called withing type processor)

```typescript
(leftValue: AssignableType, rightValue: AssignableType, extendStack?: StackEntry[]): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/extends.ts#L68

### _isExtendable (function)

```typescript
(left: Type, right: Type, extendStack?: StackEntry[]): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/extends.ts#L102

### createPromiseObjectLiteral (function)

We don't want to embed in each and every file the type definition of Promise<t>,
so we do it ondemand at runtime instead. This saves bundle size.

```typescript
(type: TypePromise): TypeObjectLiteral
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/extends.ts#L355

### parametersToTuple (function)

```typescript
(parameters: TypeParameter[]): TypeTuple
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/extends.ts#L408

### extendTemplateLiteral (function)

```typescript
(left: TypeLiteral | TypeTemplateLiteral, right: TypeTemplateLiteral): boolean
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/extends.ts#L435

### resolveReceiveType (function)

```typescript
(type?: Packed | Type | Function | ClassType | AbstractClassType | ReflectionClass<any>): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L76

### reflect (function)

```typescript
(o: any, ...args: any[]): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L118

### reflectOrUndefined (function)

```typescript
(o: any, ...args: any[]): Type | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L122

### valuesOf (function)

```typescript
<T>(args?: any[], p?: ReceiveType<T>): (string | number | symbol | Type)[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L130

### propertiesOf (function)

```typescript
<T>(args?: any[], p?: ReceiveType<T>): (string | number | symbol | Type)[]
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L150

### getNominalId (function)

```typescript
<T>(args?: any[], p?: ReceiveType<T>): number | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L164

### typeOf (function)

```typescript
<T>(args?: any[], p?: ReceiveType<T>): Type
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L170

### removeTypeName (function)

```typescript
<T extends Type>(type: T): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L178

### removeNominal (function)

```typescript
<T extends Type | undefined | Type[]>(type: T): T
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L186

### getProperty (function)

```typescript
(type: TypeObjectLiteral | TypeClass, memberName: number | string | symbol): TypeProperty | TypePropertySignature | undefined
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L198

### toSignature (function)

```typescript
(type: TypeProperty | TypeMethod | TypePropertySignature | TypeMethodSignature): TypePropertySignature | TypeMethodSignature
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L205

### hasCircularReference (function)

```typescript
(type: Type): any
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L214

### visit (function)

```typescript
(type: Type, visitor: (type: Type, path: string) => false | void, onCircular?: () => void): void
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L238

### resolveForeignReflectionClass (function)

```typescript
(property: ReflectionProperty): ReflectionClass<any>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L541

### resolveClassType (function)

Resolved the class/object ReflectionClass of the given TypeClass|TypeObjectLiteral

```typescript
(type: Type): ReflectionClass<any>
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L556

### ReceiveType (type)

Receives the runtime type of template argument or runtime symbols like
class references, functions, or packed types.

Use

```typescript
function f<T>(type?: ReceiveType<T>): Type {
    return resolveReceiveType(type);
}
```

```typescript
type ReceiveType<T> = Packed<T> | ClassType<T> | Type;
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L74

### ReflectionParameter (class)

```typescript
export class ReflectionParameter {
    type: Type;
    constructor(public readonly parameter: TypeParameter, public readonly reflectionFunction: ReflectionMethod | ReflectionFunction);
    getType(): Type;
    getName(): string;
    get name(): string;
    isOptional(): boolean;
    hasDefault(): boolean;
    isValueRequired(): boolean;
    getDefaultValue(): any;
    hasDefaultFunctionExpression(): boolean;
    applyDecorator(t: TData);
    getVisibility(): ReflectionVisibility | undefined;
    isPublic(): boolean;
    isProtected(): boolean;
    isPrivate(): boolean;
    isReadonly(): boolean;
    /**
     * True if the parameter becomes a property in the class.
     * This is the case for parameters in constructors with visibility or readonly.
     *
     * ```typescript
     * class User {
     *    constructor(public name: string) {}
     * }
     */
    isProperty(): boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L326

### ReflectionFunction (class)

```typescript
export class ReflectionFunction {
    parameters: ReflectionParameter[];
    description: string;
    constructor(public readonly type: TypeMethod | TypeMethodSignature | TypeFunction);
    static from(fn: Function): ReflectionFunction;
    getParameterNames(): (string)[];
    hasParameter(name: string | number | symbol): boolean;
    getParameterOrUndefined(name: string | number | symbol): ReflectionParameter | undefined;
    getParameter(name: string | number | symbol): ReflectionParameter;
    getParameterType(name: string | number | symbol): Type | undefined;
    getParameters(): ReflectionParameter[];
    getReturnType(): Type;
    getName(): number | string | symbol;
    getDescription(): string;
    get name(): string;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L418

### ReflectionMethod (class)

```typescript
export class ReflectionMethod extends ReflectionFunction {
    /**
     * Whether this method acts as validator.
     */
    validator: boolean;
    constructor(public type: TypeMethod | TypeMethodSignature, public reflectionClass: ReflectionClass<any>);
    setType(method: TypeMethod | TypeMethodSignature);
    applyDecorator(data: TData);
    clone(reflectionClass?: ReflectionClass<any>, method?: TypeMethod | TypeMethodSignature): ReflectionMethod;
    isOptional(): boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L502

### ReflectionProperty (class)

```typescript
export class ReflectionProperty {
    jsonType?: Type;
    serializer?: SerializerFn;
    deserializer?: SerializerFn;
    data: {
        [name: string]: any;
    };
    /**
     * The type of the property, not the property itself.
     *
     * Note: If the property is optional via `property?: T`, this information
     * is not available here. It's on `property`.
     * Use `isOptional()` instead, which handles this case plus the case
     * where optionality is given via union of T and undefined.
     */
    type: Type;
    symbol: symbol;
    constructor(public property: TypeProperty | TypePropertySignature, public reflectionClass: ReflectionClass<any>);
    setType(type: Type);
    isPrimaryKey(): boolean;
    isEmbedded(): boolean;
    /**
     * Returns the sub type if available (for arrays for example).
     *
     * @throws Error if the property type does not support sub types.
     */
    getSubType(): Type;
    /**
     * If undefined, it's not an embedded class.
     */
    getEmbedded(): {
        prefix?: string;
    } | undefined;
    isBackReference(): boolean;
    isDatabaseSkipped(database: string): boolean;
    isDatabaseMigrationSkipped(database: string): boolean;
    getBackReference(): BackReferenceOptionsResolved;
    isAutoIncrement(): boolean;
    isReference(): boolean;
    isArray(): boolean;
    isDate(): boolean;
    isNumber(): boolean;
    getForeignKeyName(): string;
    getReference(): ReferenceOptions | undefined;
    getGroups(): string[];
    isInGroup(...group: string[]): boolean;
    getExcluded(): string[];
    isSerializerExcluded(name: string): boolean;
    getData(): {
        [name: string]: any;
    };
    /**
     * Returns the ReflectionClass of the reference class/object literal.
     *
     * @throws Error if the property is not from type TypeClass or TypeObjectLiteral
     */
    getResolvedReflectionClass(): ReflectionClass<any>;
    /**
     * If undefined the property is not an index.
     * A unique property is defined as index with IndexOptions.unique=true.
     */
    getIndex(): IndexOptions | undefined;
    /**
     * Returns database specific options, if defined
     *
     * ```typescript
     * interface User {
     *     logins: number & DatabaseField<{type: 'integer(8)'}>;
     *
     *     //of for a specific db engine
     *     logins: number & Sqlite<{type: 'integer(8)'}>;
     * }
     *
     * ```
     */
    getDatabase<T extends DatabaseFieldOptions>(name: string): T | undefined;
    clone(reflectionClass?: ReflectionClass<any>, property?: TypeProperty | TypePropertySignature): ReflectionProperty;
    applyDecorator(data: TData);
    getName(): number | string | symbol;
    getNameAsString(): string;
    get name(): string;
    getKind(): ReflectionKind;
    getType(): Type;
    getDescription(): string;
    /**
     * Whether a value is required from serialization point of view.
     * If this property has for example a default value (set via constructor or manually via t.default),
     * then the value is not required to instantiate the property value.
     */
    isValueRequired(): boolean;
    /**
     * Returns true when `undefined` or a missing value is allowed at the class itself.
     * This is now only true when `optional` is set, but also when type is `any`.
     */
    isActualOptional(): boolean;
    /**
     * If the property is actual optional or is an union with undefined in it.
     */
    isOptional(): boolean;
    setOptional(v: boolean): void;
    isNullable(): boolean;
    isReadonly(): boolean;
    isAbstract(): boolean;
    hasDefault(): boolean;
    getDefaultValue(): any;
    hasDefaultFunctionExpression(): boolean;
    getDefaultValueFunction(): (() => any) | undefined;
    getVisibility(): ReflectionVisibility | undefined;
    isPublic(): boolean;
    isProtected(): boolean;
    isPrivate(): boolean;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L567

### reflectionClassSymbol (variable)

```typescript
unique symbol
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L854

### SerializerFn (type)

```typescript
interface SerializerFn {
    (value: any, property: ReflectionProperty): any;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L856

### TData (class)

```typescript
export class TData {
    validator: boolean;
    validators: ValidateFunction[];
    type?: Packed | Type | ClassType;
    data: {
        [name: string]: any;
    };
    serializer?: SerializerFn;
    deserializer?: SerializerFn;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L860

### EntityData (class)

```typescript
export class EntityData {
    name?: string;
    collectionName?: string;
    databaseSchemaName?: string;
    disableConstructor: boolean;
    data: {
        [name: string]: any;
    };
    indexes: {
        names: string[];
        options: IndexOptions;
    }[];
    singleTableInheritance?: true;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L869

### ReflectionClass (class)

```typescript
export class ReflectionClass<T> {
    /**
     * The description, extracted from the class JSDoc @description.
     */
    description: string;
    /**
     * A place where arbitrary data is stored, usually set via decorator t.data.
     */
    data: {
        [name: string]: any;
    };
    /**
     * The unique entity name.
     *
     * ```typescript
     * @entity.name('user')
     * class User {
     *
     * }
     * ```
     */
    name?: string;
    databaseSchemaName?: string;
    disableConstructor: boolean;
    /**
     * The collection name, used in database context (also known as table name).
     *
     * Usually, if this is not set, `name` will be used.
     *
     * ```typescript
     * @entity.collection('users').name('user')
     * class User {
     *
     * }
     * ```
     */
    collectionName?: string;
    /**
     * True when @entity.singleTableInheritance was set.
     */
    singleTableInheritance: boolean;
    /**
     * Contains all indexed, multi-field using entity.index and all indexes from properties.
     *
     * ```typescript
     * @entity
     *    .collection('users')
     *    .name('user')
     *    .index(['username', 'email'])
     *    .index(['email', 'region'], {unique: true})
     * class User {
     *     username: string;
     *     email: string;
     * }
     * ```
     */
    indexes: {
        names: string[];
        options: IndexOptions;
    }[];
    /**
     * If a custom validator method was set via @t.validator, then this is the method name.
     */
    validationMethod?: string | symbol | number | TypeTemplateLiteral;
    /**
     * A class using @t.singleTableInheritance registers itself in this array in its super class.
     */
    subClasses: ReflectionClass<any>[];
    constructor(public readonly type: TypeClass | TypeObjectLiteral, public readonly parent?: ReflectionClass<any>);
    clone(): ReflectionClass<any>;
    toString(): string;
    getPropertiesDeclaredInConstructor(): ReflectionProperty[];
    clearJitContainer();
    getJitContainer();
    getClassType(): ClassType;
    getClassName(): string;
    createDefaultObject(): object;
    getName(): string;
    getDescription(): string;
    getCollectionName(): string;
    hasProperty(name: string | symbol | number): boolean;
    hasMethod(name: string | symbol | number): boolean;
    getPrimary(): ReflectionProperty;
    getAutoIncrement(): ReflectionProperty | undefined;
    isSchemaOf(classType: ClassType): boolean;
    hasPrimary(): boolean;
    getPrimaries(): ReflectionProperty[];
    /**
     * Returns the ReflectionClass object from parent/super class, if available.
     */
    getSuperReflectionClass(): ReflectionClass<any> | undefined;
    removeProperty(name: string | number | symbol);
    registerProperty(property: ReflectionProperty);
    addProperty(prop: {
        name: number | string | symbol;
        optional?: true;
        readonly?: true;
        description?: string;
        visibility?: ReflectionVisibility;
        type: Type;
    }): ReflectionProperty;
    registerMethod(method: ReflectionMethod);
    add(member: Type);
    assignedSingleTableInheritanceSubClassesByIdentifier?: {
        [id: string]: ReflectionClass<any>;
    };
    getAssignedSingleTableInheritanceSubClassesByIdentifier(): {
        [id: string]: ReflectionClass<any>;
    } | undefined;
    hasSingleTableInheritanceSubClasses(): boolean;
    getSingleTableInheritanceDiscriminantName(): string;
    applyDecorator(data: EntityData);
    static from<T>(classTypeIn?: ReceiveType<T> | AbstractClassType<T> | TypeClass | TypeObjectLiteral | ReflectionClass<any>, args: any[] = []): ReflectionClass<T>;
    getIndexSignatures();
    getPropertyNames(): (string | number | symbol)[];
    getProperties(): ReflectionProperty[];
    getPropertiesInGroup(...group: string[]): ReflectionProperty[];
    getMethodNames(): (string | number | symbol)[];
    getMethods(): ReflectionMethod[];
    /**
     * Returns references and back references.
     */
    getReferences(): ReflectionProperty[];
    getConstructorOrUndefined(): ReflectionMethod | undefined;
    getPropertyOrUndefined(name: string | number | symbol | TypeTemplateLiteral): ReflectionProperty | undefined;
    getProperty(name: string | number | symbol): ReflectionProperty;
    getMethodParameters(name: string | number | symbol): ReflectionParameter[];
    getMethodOrUndefined(name: string | number | symbol | TypeTemplateLiteral): ReflectionMethod | undefined;
    getMethod(name: string | number | symbol): ReflectionMethod;
    hasCircularReference(): boolean;
    serializeType(): SerializedTypes;
    /**
     * All references have a counter-part. This methods finds it and errors if not possible.
     *
     * If the given reference is a owning reference it finds the correct backReference,
     *    which can be found by checking all reference options.mappedBy.
     *
     * If the given reference is a back reference it finds the owning reference,
     *    which can be found by using its options.mappedBy.
     *
     * Alternatively we simply check for resolvedClassType to be given `classType`, and if only one
     * found, we return it. When more than one found, we throw an error saying the user he
     * should make its relation mapping not ambiguous.
     */
    findReverseReference(toClassType: ClassType, fromReference: ReflectionProperty): ReflectionProperty;
    extractPrimaryKey(item: object): Partial<T>;
}
```

Source: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/src/reflection/reflection.ts#L891
