moved type definitions to a separate directory and fixed some documentations under utils/

This commit is contained in:
2024-11-17 18:06:59 +09:00
parent 1ab17242f7
commit 1c4947e4e3
11 changed files with 3 additions and 4 deletions

43
utils/types/slide.ts Normal file
View File

@@ -0,0 +1,43 @@
/**
* Types for Slide component
* @module utils/slide.ts
*/
/**
* Entries to show in the slide show
* @property {string} imagePath path to the image
* @property {string} title text to show in the h1 element
* @property {string} content text to show in the p element
* @property {string=} link optional link to a page
* @example
* let entry: SlideEntry = {
* imagePath: "/images/slide/1.jpg",
* title: "First Slide",
* content: "This is first slide",
* link: "/to-some-page",
* };
*/
interface SlideEntry {
imagePath: string;
title: string;
content: string;
link?: string;
}
/**
* Interface for Slide component
* @property {Array<SlideEntry>} entries slides to show
* @property {number} duration duration for each slide to show in milliseconds
* @property {string} width css width property value
* @property {string} height css height property value
* @example
* <Slide :entries="slideEntries" duration="5000" width="200px" height="150px" />
*/
interface SlideProperty {
entries: Array<SlideEntry>;
duration: number;
width: string;
height: string;
}
export type { SlideEntry, SlideProperty };