ldc-crm/resources/ts/index.d.ts
2025-08-04 16:03:38 +02:00

111 lines
2.7 KiB
TypeScript

export { };
import type VueTagsInput from "@sipec/vue3-tags-input";
import { AxiosStatic } from "axios";
import { Chart } from "chart.js";
import * as printJsType from "print-js";
// * Enum
interface EnumInterface {
label: string;
value: number | string;
name: string;
}
// * Laravel Paginator
interface PaginatorLink {
url: null | string;
label: string;
active: boolean;
}
interface Paginator {
current_page: number;
data: Array<LaravelModel>;
first_page_url: string;
from: number;
last_page: number;
last_page_url: string;
links: Array<PaginatorLink>;
next_page_url: string | null;
path: string;
per_page: number;
prev_page_url: string | null;
to: number;
total: number;
}
// * Recursive List<string>
type StringList = Record<PropertyKey, string>;
interface NestedStringListInterface
extends Record<PropertyKey, NestedStringListInterface | StringList> {}
// * Recursive List<number>
type NumberList = Record<PropertyKey, number>;
interface NestedNumberListInterface
extends Record<PropertyKey, NestedNumberListInterface | NumberList> {}
// * Recursive List<Model>
type Model = Record<
string,
| string
| boolean
| number
| object
| NestedStringList
| NestedNumberList
| NestedModelInterface
| ModelListInterface
>;
interface NestedModelInterface extends Model {}
type NestedStringList = NestedStringListInterface | StringList | string;
type NestedNumberList = NestedNumberListInterface | NumberList | number;
type ModelList = Array<Model>;
interface ModelListInterface extends ModelList {}
type VselectOptionType = {
id: number;
name: string;
};
type UserRelation = {
user: LaravelModel|null;
}
type ClaimRelations = {
brand: LaravelModel;
claim_subject: LaravelModel;
}
declare global {
type CustomTag = LaravelModel & VueTagsInput.ITag;
type LaravelModel = Model;
type LaravelModelList = ModelList;
type LaravelModelUserRelation = UserRelation;
type LaravelModelClaimRelations = ClaimRelations;
type LaravelPaginator = Paginator;
type LaravelPaginatorLink = PaginatorLink;
type VselectOption = VselectOptionType;
type Enum = EnumInterface;
type LaravelValidationErrors = Record<string, string[]>;
type ValueOf<T> = T[keyof T];
interface Window {
axios: AxiosStatic;
Swal: Function;
vueDebug: boolean | undefined;
printJS: typeof printJsType.default;
ChartJS: typeof Chart;
__SYSTEM: {
_asset: string;
_locale: string;
_routes: Record<string, string>;
_translations: {
json: NestedStringList;
php: NestedStringList;
};
};
}
}