Files
hudozka/src/types.ts
T
tmshv 9ee9bce197 Normalize interface naming — remove I prefix convention (#255)
* update pr workflow

* interface to types

* use consistent import

* import type syntax

* test plan note
2026-02-08 15:57:11 +07:00

159 lines
2.4 KiB
TypeScript

export type MenuItem = {
name: string
href: string
}
export type BreadcrumbPart = {
name: string
href: string
}
export type PageCardDto = {
id: number
url: string
title: string
featured: boolean
date: string | null
cover: Pic
}
export type FileDefinition = {
url: string
slug: string
name: string
cover?: Pic
file: {
name: string
size: number
type: string
src: string
}
}
export type Page = {
id: string
title: string
url: string
data: string
date: string
cover: Pic
description: string
tokens: Token[]
tags: Tag[]
breadcrumb?: BreadcrumbPart[]
featured: boolean
}
export type Sign = {
date: string
person: string
position: string
signature: string
}
export type DocFile = {
// category: string
fileName: string
fileSize: number
fileUrl: string
imageUrl: string
title: string
url: string
}
export type Meta = {
url: string
siteName: string
locale: string
type: string
description: string
domain: string
title: string
image: string
imageWidth: number
imageHeight: number
twitterCard: string
twitterSite: string
twitterCreator: string
}
export type Tag = {
id: number
name: string
slug: string
href: string
count: number
}
export type Pic = {
src: string
alt?: string
width: number
height: number
caption?: string
blur?: string
}
export type TextToken = {
token: "text"
data: string
}
export type ImageToken = {
token: "image"
wide: boolean
data: Pic
}
export type FileTokenData = {
url: string
slug: string
image_url: string
file_url: string
title: string
file_size?: number
file_format: string
}
export type FileToken = {
token: "file"
data: FileTokenData
}
export type HtmlToken = {
token: "html"
data: string
}
export type YoutubeToken = {
token: "youtube"
data: {
url: string
}
}
export type InstagramToken = {
token: "instagram"
data: {
url: string
embed: string
}
}
export type GridToken = {
token: "grid"
data: {
items: PageCardDto[]
}
}
export type Token =
| TextToken
| ImageToken
| FileToken
| HtmlToken
| YoutubeToken
| InstagramToken
| GridToken