Files
web/types/rte/attrs.ts
2024-09-24 09:47:31 +02:00

50 lines
1.1 KiB
TypeScript

import {
ImageVaultAsset,
ImageVaultAssetResponse,
} from "../components/imageVault"
import { RTEItemTypeEnum } from "./enums"
import type { Lang } from "@/constants/languages"
import type { EmbedTypesEnum, RTEItemType } from "./enums"
export interface Attributes {
[key: string]: any
"class-name"?: string
type: RTEItemType
}
export interface RTEAssetAttrs extends Attributes {
alt: string
"asset-alt": string
"asset-link": string
"asset-name": string
"asset-type": "image/png" | "image/jpg" | "image/jpeg"
"asset-uid": string
"display-type": EmbedTypesEnum.display
"content-type-uid": "sys_assets"
inline: false
type: RTEItemTypeEnum.asset
}
export interface RTEAnchorAttrs extends Attributes {
target: string
url: string
}
export interface RTELinkAttrs extends Attributes {
"display-type": EmbedTypesEnum.link
"class-name": string
"content-type-uid": string
"entry-uid": string
locale: Lang
href: string
target: HTMLAnchorElement["target"]
type: RTEItemTypeEnum.entry
}
export type RTEImageVaultAttrs = Attributes & {
height: string
style: string[]
width: string
} & (ImageVaultAssetResponse | ImageVaultAsset)