import Decimal from "decimal.js" {%- if mode.is_entity() %} import { DateOnly, ObjectId, File } from "@teocloud/teo" {%- endif %} export type ExistKeys = { [key in keyof T]: T[key] extends false | undefined | null ? never : key }[keyof T] type HasSelect = { select: any } type HasInclude = { include: any } export type CheckSelectInclude = T extends HasSelect ? U : T extends HasInclude ? U : S export type SelectSubset = U extends HasSelect ? { [K in ExistKeys]: K extends keyof T ? T[K] : never } : T export type Enumerable = T | Array export type Subset = { [key in keyof T]: key extends keyof U ? T[key] : never } export type GetScalarType = O extends object ? { [P in keyof T]: P extends keyof O ? O[P] : never } : never type Teo__Pick = { [P in K]: T[P]; } type PickEnumerable | keyof T> = Teo__Pick> export type Boolean = True | False export type True = 1 export type False = 0 export type Not = { 0: 1 1: 0 }[B] type NoExpand = T extends unknown ? T : never; type Key = string | number | symbol; type AtBasic = K extends keyof O ? O[K] : never; type AtStrict = O[K & keyof O]; type AtLoose = O extends unknown ? AtStrict : never; export type At = { 1: AtStrict; 0: AtLoose; }[strict]; export type IntersectOf = ( U extends unknown ? (k: U) => void : never ) extends (k: infer I) => void ? I : never export type Overwrite = { [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; } & {}; type _Merge = IntersectOf; }>>; export type ComputeRaw = A extends Function ? A : { [K in keyof A]: A[K]; } & {}; export type OptionalFlat = { [K in keyof O]?: O[K]; } & {}; type _Record = { [P in K]: T; }; type AtLeast = NoExpand< O extends unknown ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O : never>; type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; export type Strict = ComputeRaw<_Strict>; export type Merge = ComputeRaw<_Merge>>; type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T export type Union = any export type Extends = [A1] extends [never] ? 0 // anything `never` is false : A1 extends A2 ? 1 : 0 export type Has = Not< Extends, U1> > export type Or = { 0: { 0: 0 1: 1 } 1: { 0: 1 1: 1 } }[B1][B2] export type Keys = U extends unknown ? keyof U : never type Cast = A extends B ? A : B; type IsObject = T extends Array ? False : T extends Date ? False : T extends Uint8Array ? False : T extends object ? True : False type FieldPaths< T, U = Omit > = IsObject extends True ? U : T type GetHavingFields = { [K in keyof T]: Or< Or, Extends<'AND', K>>, Extends<'NOT', K> > extends True ? // infer is only needed to not hit TS limit // based on the brilliant idea of Pierre-Antoine Mills // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 T[K] extends infer TK ? GetHavingFields extends object ? Merge> : never> : never : {} extends FieldPaths ? never : K }[keyof T] export type UnEnumerate = T extends Array ? U : T export type SubsetIntersection = { [key in keyof T]: key extends keyof U ? T[key] : never } & K type _TupleToUnion = T extends (infer E)[] ? E : never type TupleToUnion = _TupleToUnion type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T {%- if conf.is_client() %} export declare class TeoError extends Error { type: string errors: {[key: string]: string} | null constructor(responseError: std.ResponseError) get name(): string } {%- endif -%} {{ render_namespace(main_namespace, conf, main_namespace, mode.clone()) }}