| 1 | import type { AxiosError, AxiosResponse } from "axios" |
| 2 | import type { FlaskBaseResponse } from "./flask" |
| 3 | |
| 4 | export type OsTypesFull = "Unknown" | "Windows" | "MacOS" | "UNIX" | "Linux" |
| 5 | export type OsTypesLower = "linux" | "windows" | "macos" |
| 6 | export type SafeAny = string | number | boolean | object | Date | null |
| 7 | export type ApiError = AxiosError<FlaskBaseResponse> |
| 8 | export type ApiCommonResponse<T = unknown> = AxiosResponse<FlaskBaseResponse & T> |
| 9 | export type DeepNullable<T> = { |
| 10 | [K in keyof T]: DeepNullable<T[K]> | null |
| 11 | } |
| 12 | |
| 13 | export type Nullable<T> = { |
| 14 | [K in keyof T]: T[K] | null |
| 15 | } |
| 16 | |
| 17 | export type RecursiveKeyOf<TObj extends object> = { |
| 18 | [TKey in keyof TObj & (string | number)]: TObj[TKey] extends object |
| 19 | ? `${TKey}` | `${TKey}.${RecursiveKeyOf<TObj[TKey]>}` |
| 20 | : `${TKey}` |
| 21 | }[keyof TObj & (string | number)] |