ldc-supportweb/resources/ts/index.d.ts

75 lines
2 KiB
TypeScript
Raw Normal View History

export {};
2022-08-25 13:31:42 +02:00
import * as Swal from "sweetalert2";
import { AxiosStatic } from "axios";
import type { VueSelectProps } from "vue-select";
// * CustomLabel
type SelectModelType = {
color: string;
label: string;
value: string;
};
2022-08-25 13:31:42 +02:00
type EnumType = {
label: string;
value: number | string;
};
// * Recursive List<string>
type StringList = Record<PropertyKey, string>;
2022-08-25 13:31:42 +02:00
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface NestedStringListInterface
extends Record<PropertyKey, NestedStringListInterface | StringList> {}
// * Recursive List<number>
type NumberList = Record<PropertyKey, number>;
2022-08-25 13:31:42 +02:00
// 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
>;
2022-08-25 13:31:42 +02:00
// 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;
2022-08-25 13:31:42 +02:00
type Enum = EnumType;
interface Window {
$displayMenu: (show: boolean) => void;
$toggleBasketMenu: () => void;
axios: AxiosStatic;
2022-08-25 13:31:42 +02:00
Swal: typeof Swal;
__SESSION_WATCH: Record<string, unknown>;
__SYSTEM: {
_asset: string;
_locale: string;
_routes: Record<string, string>;
_translations: {
json: NestedStringList;
php: NestedStringList;
};
};
}
}