ldc-showroom/index.d.ts

184 lines
4.7 KiB
TypeScript
Raw Permalink Normal View History

2023-10-16 16:35:11 +02:00
export { };
import type { RouteLocation as NRouteLocation } from "vue-router";
import type { ipcRendererObject, versions } from "./electron/preload";
2024-01-08 16:15:23 +01:00
// * --- MODELS From JSON Schema
2024-01-17 17:44:12 +01:00
type Locale = string;
type i18nFieldList = "name" | "slug" | "description" | "sub_title" | "footer_phrase";
2024-01-31 16:59:54 +01:00
type i18nField = Record<string, string>;
type i18nModel = SettingsModel | BrandModel | RangeModel | ProductModel;
2024-01-17 17:44:12 +01:00
2024-01-08 16:15:23 +01:00
/** Showroom Bo json data format */
type AppModel = {
/** Version de l'application */
version: string;
settings: SettingsModel;
items: Array<BrandModel>;
2024-01-16 10:25:13 +01:00
fonts: Array<FontModel>;
2024-01-08 16:15:23 +01:00
}
/** Settings from Showroom Bo */
type SettingsModel = {
/** Langues disponibles dans l'application */
locales: Array<string>
/** Sous-titre de l'application */
sub_title: i18nField;
/** Texte en bas de page */
footer_phrase: i18nField;
2024-01-08 16:15:23 +01:00
/** Logo de l'application, chemin tel que présent dans le zip */
logo: string;
/** Couleur de l'application (hex color) */
color: string;
2024-01-15 10:22:37 +01:00
/** Temps en secondes avant retour sur la page home lorsque inactif */
home_timeout: number;
created_at: string;
updated_at: string;
2024-01-08 16:15:23 +01:00
};
/** A font from Showroom Bo */
type FontModel = {
/** The unique identifier for a font */
id: number;
/** Nom de la marque */
font_name: string;
/** Chemin vers fichier de la font, chemin tel que présent dans le zip*/
2024-01-16 10:25:13 +01:00
font: string|null;
created_at: string;
updated_at: string;
};
2024-01-08 16:15:23 +01:00
/** A brand from Showroom Bo */
type BrandModel = {
/** The unique identifier for a brand */
2024-01-08 16:15:23 +01:00
id: number;
/** Nom de la marque */
2024-01-17 17:44:12 +01:00
name: i18nField;
2024-01-08 16:15:23 +01:00
/** Slug de la marque */
2024-01-17 17:44:12 +01:00
slug: i18nField;
2024-01-08 16:15:23 +01:00
/** Couleur de la marque (hex color) */
color: string;
/** Logo de la marque, chemin tel que présent dans le zip */
picture: string;
/** Les enfant sont rendus sur un étagere */
shelf: boolean;
/** Visible ? (présent dans l'export). Toujours à true in Showroom App */
status: boolean;
2024-01-08 16:15:23 +01:00
created_at: string;
updated_at: string;
ranges: Array<RangeModel>;
};
/** A range from Showroom Bo */
type RangeModel = {
/** The unique identifier for a range */
id: number;
/** Nom de la gamme */
2024-01-17 17:44:12 +01:00
name: i18nField;
2024-01-08 16:15:23 +01:00
/** Slug de la gamme */
2024-01-17 17:44:12 +01:00
slug: i18nField;
2024-01-08 16:15:23 +01:00
/** Logo de la gamme, chemin tel que présent dans le zip */
picture: string;
/** Couleur de la gamme */
color: string;
/** Largeur de la gamme 1 colonne ou 2 colonnes (pleine largeur)e */
width: number;
/** Ordre d'affichage de la gamme */
order: number;
/** Les enfant sont rendus sur un étagere */
shelf: boolean;
/** Visible ? (présent dans l'export). Toujours à true in Showroom App */
status: boolean;
2024-01-08 16:15:23 +01:00
/** Clé étrangère de la marque */
brand_id: number;
/** Clé étrangère de la police */
font_id: number;
2024-01-08 16:15:23 +01:00
created_at: string;
updated_at: string;
products: Array<ProductModel>;
};
/** A product from Showroom Bo */
type ProductModel = {
/** The unique identifier for a product */
id: number;
/** Nom du produit */
2024-01-17 17:44:12 +01:00
name: i18nField;
2024-01-08 16:15:23 +01:00
/** Slug du produit */
2024-01-17 17:44:12 +01:00
slug: i18nField;
2024-01-08 16:15:23 +01:00
/** Description du produit, texte WYSYWYG */
2024-01-17 17:44:12 +01:00
description: i18nField;
2024-01-08 16:15:23 +01:00
/** Logo du produit, chemin tel que présent dans le zip */
picture: string;
/** Visible ? (présent dans l'export). Toujours à true in Showroom App */
status: boolean;
2024-01-08 16:15:23 +01:00
/** Clé étrangère de la gamme */
range_id: number;
2024-01-08 16:15:23 +01:00
created_at: string;
updated_at: string;
};
// * --- END MODELS
type ItemObject = {
2023-10-16 16:35:11 +02:00
id: number
name: string
teaser: string
img: string
description: string
}
type ModalSettings = {
ctaBtnText: string;
ctaDisclaimerText: string;
ctaSaveBtn: string;
}
2023-10-17 15:43:44 +02:00
type ContactModel = {
product_id: number;
email: string;
consent: boolean;
}
2024-01-04 17:34:13 +01:00
type DataModel = {
logo: {
src: string,
width: string
},
title: string,
modalSettings: ModalSettings,
itemsByLine: number,
items: Array<ItemObject>
};
declare global {
2024-01-04 17:34:13 +01:00
type Data = DataModel
2023-10-16 16:35:11 +02:00
type Item = ItemObject
type Settings = ModalSettings;
2023-10-17 15:43:44 +02:00
type Contact = ContactModel;
// * App Models
type TypeApp = AppModel;
type TypeSettings = SettingsModel;
type TypeBrand = BrandModel;
type TypeRange = RangeModel;
type TypeProduct = ProductModel;
2024-01-16 10:25:13 +01:00
type TypeFont = FontModel;
2024-01-17 17:44:12 +01:00
type Typei18nField = i18nField;
2024-01-31 16:59:54 +01:00
type Typei18nFieldList = i18nFieldList;
type Typei18nModel = i18nModel;
type ToastTypeEnum = ToastType;
2024-01-08 16:15:23 +01:00
// Nuxt
type RouteLocation = NRouteLocation;
2023-10-16 16:35:11 +02:00
interface Window {
versions: typeof versions
ipcRendererObject: typeof ipcRendererObject
2023-10-16 16:35:11 +02:00
}
}