feat(types): update
This commit is contained in:
parent
d68e6d9e2e
commit
f1496cc99b
|
@ -0,0 +1,18 @@
|
|||
import type { IParagraphStyleOptions } from 'docx'
|
||||
|
||||
// Normal paragraphs.
|
||||
export type ThemeKey = 'normal' |
|
||||
// Heading.
|
||||
'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'h7' | 'h8' | 'h9' |
|
||||
// Table header and imageFooter.
|
||||
'tableHeader' | 'imageFooter' |
|
||||
// Title, subtitle, and cover info.
|
||||
'title' | 'subtitle' | 'coverInfo' |
|
||||
// Content and abstract.
|
||||
'contentTitle' | 'abstractTitle' | 'keywords' |
|
||||
// Code, mark.
|
||||
'code' | 'mark'
|
||||
|
||||
export interface ThemeConfig extends IParagraphStyleOptions {
|
||||
id: ThemeKey
|
||||
}
|
|
@ -1 +1,2 @@
|
|||
export * from './types'
|
||||
export * from './config'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import type { IRunOptions } from 'docx'
|
||||
|
||||
export interface ReportConfig{
|
||||
title: string
|
||||
logo?: string
|
||||
|
@ -11,4 +13,28 @@ export interface ReportConfig{
|
|||
export interface ReportMarkdown{
|
||||
raw: string
|
||||
frontmatter: ReportConfig
|
||||
content: ReportMarkdownSection[]
|
||||
}
|
||||
|
||||
export type MarkdownItTokenType = 'strong_open' | 'em_open' | 's_open' | 'mark_open' | 'html_inline' | 'text' | 'code_inline'
|
||||
|
||||
export interface ContentBase{
|
||||
type: string
|
||||
children?: ContentBase[]
|
||||
}
|
||||
|
||||
export interface ReportMarkdownSection extends ContentBase {
|
||||
type: 'section'
|
||||
children: ReportMarkdownParagraph[]
|
||||
}
|
||||
|
||||
export interface ReportMarkdownParagraph extends ContentBase{
|
||||
type: 'paragraph' | 'heading'
|
||||
children: ReportMarkdownParagraphChild[]
|
||||
level?: number
|
||||
}
|
||||
|
||||
export interface ReportMarkdownParagraphChild extends ContentBase{
|
||||
type: 'text' | 'image'
|
||||
config: IRunOptions
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue