md/src/types/index.ts

34 lines
947 B
TypeScript
Raw Normal View History

import type { PropertiesHyphen } from 'csstype'
2024-09-16 17:07:47 +08:00
export type Block = `h1` | `h2` | `h3` | `h4` | `p` | `blockquote` | `blockquote_p` | `code_pre` | `code` | `image` | `ol` | `ul` | `footnotes` | `figure` | `hr`
export type Inline = `listitem` | `codespan` | `link` | `wx_link` | `strong` | `table` | `thead` | `td` | `footnote` | `figcaption` | `em`
interface CustomCSSProperties {
[`--md-primary-color`]?: string
[key: `--${string}`]: string | undefined
}
export type ExtendedProperties = PropertiesHyphen & CustomCSSProperties
export interface Theme {
base: ExtendedProperties
block: Record<Block, PropertiesHyphen>
inline: Record<Inline, PropertiesHyphen>
}
export interface IOpts {
theme: Theme
fonts: string
size: string
2024-09-16 17:07:47 +08:00
legend?: string
status?: boolean
}
export type ThemeStyles = Record<Block | Inline, ExtendedProperties>
2024-09-16 17:07:47 +08:00
export interface IConfigOption<VT = string> {
2024-08-24 23:38:39 +08:00
label: string
2024-09-16 17:07:47 +08:00
value: VT
2024-08-24 23:38:39 +08:00
desc: string
}