type changes

This commit is contained in:
matthieu42morin 2024-03-30 05:04:43 +01:00
parent c08635b4c6
commit fdb2b9b4ed
6 changed files with 67 additions and 20 deletions

6
src/lib/types/images.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export type ImageLinkArgs = {
urlOrPublicId: string;
h: number;
w: number;
max?: boolean;
};

View File

@ -1,7 +1,7 @@
export type InstagramPost = {
export interface InstagramPost {
id: string;
media_type: string;
media_url: string;
caption: string;
timestamp: string;
}
}

21
src/lib/types/mdMetadata.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
export interface MarkdownHeading {
title: string;
slug: string;
level: number;
children: MarkdownHeading[];
}
export interface MarkdownMetadata {
headings: MarkdownHeading[];
frontmatter: MarkdownFrontmatter;
}
// Type for markdown frontmatter
export interface MarkdownFrontmatter {
title: string;
date: string;
tags: Tag[];
published?: boolean;
};
export type Tag = 'PMU' | 'permanentní makeup' | 'vizáž' | 'depilace' | 'vakuslim' | 'ošetření' | 'makeup' | 'pleť' | 'péče' | 'beauty' | 'salon' | 'salón' | 'kosmetika' | '';

14
src/lib/types/ogMetadata.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
export type OGType = "Article" | "Website";
export type OGImageType = "image/png" | "image/jpg" | "image/webp" | "image/gif" // fill this out and correct it please
export type OGImageHeight = 512
export type OGImageWidth = 1024
// make the logic so that we have either a image width and heigh a 2:1 or 16:9 ratio , ie choose one or the other
// should I declare other properties when they will be defined outside of this type in the component? I guess url will be gotten conditionally
export interface OpenGraphMetadata {
type: OGType;
image: string;
imageType: OGImageType;
imageWidth: OGImageWidth;
imageHeight: OGImageHeight;
url: string;
};

View File

@ -1,8 +0,0 @@
export type Product = {
id: string;
name: string;
price: number;
description: string;
image: string;
url: string;
}

View File

@ -1,10 +1,24 @@
export type Service = {
category: string;
items: {
name: string;
description: string;
id: string;
price: number | string;
duration: number | string;
}[];
};
import type { MarkdownMetadata } from '$lib/types/mdMetadata';
import type { OpenGraphMetadata } from '$lib/types/ogMetadata';
// Base service item type
export interface Service {
title: string;
description: string;
id: string;
image: string;
price: number | string;
duration: number | string;
};
export interface Category {
title: string;
description: string;
id: string;
image: string;
services: Service[];
}
// Extended service item type with OpenGraph metadata
export type ExtendedService = Service & OpenGraphMetadata & MarkdownMetadata;
export type ExtendedCategory = Category & OpenGraphMetadata & MarkdownMetadata;