ldc-op-insta/resources/ts/index.d.ts
2023-04-21 14:49:53 +00:00

121 lines
3.1 KiB
TypeScript

export {};
import { AxiosStatic } from "axios";
import type VueTagsInput from "@sipec/vue3-tags-input";
// * InstaMedia Type
declare enum InstaMediaTypeEnum {
IMAGE,
CAROUSEL_ALBUM,
}
// * InstaMedia
type InstaMediaModel = {
/** A unique instagram id that can be used for api calls. */
insta_id: number;
/** The instagram object type, commonly IMAGE or CAROUSEL_ALBUM. */
type: InstaMediaTypeEnum;
/** The instagram user name, scrapped using OG description. */
username: string;
/** The object text content. */
caption: string;
/** The uri where is stored the Instagram object. */
permalink: string;
/** UTC timestamp from instagram api. */
timestamp: string;
/** The number of comments. */
comments_count: number;
/** The number of likes. */
like_count: null | number;
/** VIRTUAL COLUMN ONLY FOR VUE COMPONENT */
checked: boolean;
};
type InstaMediaList = Array<InstaMediaModel>;
interface InstaMediaListInterface extends InstaMediaList {}
// * Enum
interface EnumInterface {
label: string;
value: number | string;
}
// * Laravel Paginator
interface PaginatorLink {
url: null | string;
label: string;
active: boolean;
}
interface Paginator {
current_page: number;
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 {}
declare global {
type CustomTag = LaravelModel & VueTagsInput.ITag;
type LaravelModel = Model;
type LaravelModelList = ModelList;
type LaravelPaginator = Paginator;
type LaravelPaginatorLink = PaginatorLink;
type InstaMediaList = InstaMediaListInterface;
type InstaMedia = InstaMediaModel;
type InstaMediaType = InstaMediaTypeEnum;
type Enum = EnumInterface;
interface Window {
axios: AxiosStatic;
Swal: Function;
vueDebug: boolean | undefined;
__SYSTEM: {
_asset: string;
_locale: string;
_routes: Record<string, string>;
_translations: {
json: NestedStringList;
php: NestedStringList;
};
};
}
}