ldc-supportweb/resources/ts/index.d.ts
2022-08-30 13:21:07 +00:00

74 lines
2 KiB
TypeScript

export {};
import * as Swal from "sweetalert2";
import { AxiosStatic } from "axios";
import type { VueSelectProps } from "vue-select";
// * CustomLabel
type SelectModelType = {
color: string;
label: string;
value: string;
};
type EnumType = {
label: string;
value: number | string;
};
// * Recursive List<string>
type StringList = Record<PropertyKey, string>;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface NestedStringListInterface
extends Record<PropertyKey, NestedStringListInterface | StringList> {}
// * Recursive List<number>
type NumberList = Record<PropertyKey, number>;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface NestedNumberListInterface
extends Record<PropertyKey, NestedNumberListInterface | NumberList> {}
// * Recursive List<Model>
type Model = Record<
string,
| string
| boolean
| number
| object
| NestedStringList
| NestedNumberList
| NestedModelInterface
>;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface NestedModelInterface extends Model {}
type NestedStringList = NestedStringListInterface | StringList | string;
type NestedNumberList = NestedNumberListInterface | NumberList | number;
type ModelList = Array<Model>;
declare global {
type CustomTag = LaravelModel;
type LaravelModel = Model;
type LaravelModelList = ModelList;
type VSelectProps = VueSelectProps;
type SelectModel = SelectModelType;
type Enum = EnumType;
interface Window {
$displayMenu: (show: boolean) => void;
$toggleBasketMenu: () => void;
axios: AxiosStatic;
Swal: typeof Swal;
__SESSION_WATCH: Record<string, unknown>;
__SYSTEM: {
_asset: string;
_locale: string;
_routes: Record<string, string>;
_translations: {
json: NestedStringList;
php: NestedStringList;
};
};
}
}