interface RequiredInterface { filePath: string, name: string, exports: T } type RequireAsyncReturn = PlataPromise> type RequireFolderReturn = PlataPromise[]> type RequiredFolder = Awaited> type StringKeyOfObject = Exclude<{ [name in keyof T]: name extends string ? name : name extends number ? `${name}` : undefined }[keyof T], undefined>; type AnyRecord = { [P in string]: T; } type LooseAutocomplete = T | (string & {}) type Replace = T extends O ? Exclude | U : T type PlataEnvDefaults = "prod" | "homolog" | "debug" type PlataEnv = LooseAutocomplete type PlataFunctionWrapperReturn any, T> = (...a: Parameters) => T type RemovePlataResult = T extends PlataResult ? Exclude : T type RemovePlataResultOnArray = T extends [ infer U ] ? [ RemovePlataResult> ] : T extends [ infer U, ...infer V ] ? [ RemovePlataResult>, ...RemovePlataResultOnArray ] : [] //: T extends Promise[] ? RemovePlataResult[] //: never ; type RemovePlataResultOnPromiseAll = RemovePlataResultOnArray // extends [ infer U ] ? RemovePlataResultOnArray // : T extends Promise[] ? 'RemovePlataResult' // : 'never' ; interface PlataProcess { _plata_cache?: Map<() => unknown, unknown> } type Prettify = { [K in keyof T]: T[K]; } & {}; interface PlataEnvAutoComplete extends NodeJS.ProcessEnv { ENV?: PlataEnv PORT?: string _PLATA_API_ROOT?: string _PLATA_API_SSL_KEY?: string _PLATA_API_SSL_CERT?: string _PLATA_API_SSL_PASS?: string _PLATA_API_JSON_SIZE?: string _PLATA_WORKER_NAME?: string _PLATA_WORKER_TYPE?: 'WORKER' | 'CONTROLLER' _PLATA_SQL_CACHETABLE?: string _PLATA_SQL_CACHETABLETIME?: string } interface PlataRuntime { } interface Plata extends PlataRuntime { } declare const Plata: Plata declare const process: NodeJS.Process & PlataProcess interface EnvConfig { env: PlataEnv } interface PlataError { errorID: string msg: string, error?: any } type MaybePlataError = null | PlataError type PlataResult = (T & { errorID?: undefined }) | PlataError type PlataPromise = Promise> interface PlataRef { readonly value: T applyTo(key: K, target: Omit): Readonly } type Dictionary = { [key: string]: T } type DictionaryRecord = { [key in K]: T } interface PlataEnvConfig { env: PlataEnv } type DeepWritable = Prettify<{ -readonly [K in keyof T]: T[K] extends Dictionary ? T[K] extends Date ? Date : T[K] extends Brand ? Brand : DeepWritable : T[K] }> type ArrayCombine = T extends readonly [ infer U extends T[number] ] ? U : T extends readonly [ infer U extends T[number], ...infer R] ? U & ArrayCombine : never ; interface Brands { } type Brand = Brands[K] & { z__brand: K } interface PType { checkType(a: T): unknown testType(a: T, result: T extends R ? true : false) } declare const PType: PType interface PlataClosable { close(): Promise | void } type PlataDisposable = T & Disposable & AsyncDisposable