index.ts (1518B)
1 import type { IError } from "@radroots/types-bindings"; 2 3 export type ResolveStatus = "info" | "warning" | "error" | "success"; 4 5 export type FileBytesFormat = `kb` | `mb` | `gb`; 6 export type FileMimeType = string; 7 export type FilePath = { file_path: string; file_name: string; mime_type: FileMimeType; } 8 export type FilePathBlob = { blob_path: string; blob_name: string; mime_type?: FileMimeType; } 9 10 export type WebFilePath = FilePath | FilePathBlob; 11 12 export type ValStr = string | undefined | null; 13 14 export type IdbClientConfig = { 15 database: string; 16 store: string; 17 }; 18 19 export type ValidationRegex = { 20 value: RegExp; 21 charset: RegExp; 22 } 23 24 export type CallbackPromise = () => Promise<void>; 25 export type CallbackPromiseFigureResult<Ti, Tr> = (value: Ti) => Promise<Tr | undefined>; 26 export type CallbackPromiseFull<Ti, Tr> = (value: Ti) => Promise<Tr>; 27 export type CallbackPromiseGeneric<T> = (value: T) => Promise<void>; 28 export type CallbackPromiseReturn<T> = () => Promise<T>; 29 export type CallbackPromiseResult<Tr> = () => Promise<Tr | undefined>; 30 31 export type ResultId = { id: string; }; 32 export type ResultPass = { pass: true; }; 33 export type ResultBool = ResultObj<boolean>; 34 export type ResultsList<T> = { results: T[]; }; 35 export type ResultObj<T> = { result: T; }; 36 export type ResultPublicKey = { public_key: string; }; 37 export type ResultSecretKey = { secret_key: string; }; 38 39 export type ResolveError<T> = T | IError<string>; 40 export type ResolveErrorMsg<TRes, TMsg extends string> = TRes | IError<TMsg>;