refactor(types): remove unused types
This commit is contained in:
parent
7df26af941
commit
04b51f03cb
|
@ -1,18 +1,25 @@
|
||||||
import type { IParagraphStyleOptions } from 'docx'
|
import type { IStylesOptions } from 'docx'
|
||||||
|
|
||||||
// Normal paragraphs.
|
export interface IMarkdownReportConfig {
|
||||||
export type ThemeKey = 'normal' |
|
/**
|
||||||
// Heading.
|
* Creator of the document.
|
||||||
'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'h7' | 'h8' | 'h9' |
|
*/
|
||||||
// Table header and imageFooter.
|
creator: string
|
||||||
'tableHeader' | 'imageFooter' |
|
|
||||||
// Title, subtitle, and cover info.
|
/**
|
||||||
'title' | 'subtitle' | 'coverInfo' |
|
* Global style options.
|
||||||
// Content and abstract.
|
*/
|
||||||
'contentTitle' | 'abstractTitle' | 'keywords' |
|
styles: IStylesOptions
|
||||||
// Code, mark.
|
|
||||||
'code' | 'mark'
|
|
||||||
|
|
||||||
export interface ThemeConfig extends IParagraphStyleOptions {
|
}
|
||||||
id: ThemeKey
|
|
||||||
|
export enum StyleName {
|
||||||
|
'normal' = 'normal',
|
||||||
|
'h1' = 'heading1',
|
||||||
|
'h2' = 'heading2',
|
||||||
|
'h3' = 'heading3',
|
||||||
|
'h4' = 'heading4',
|
||||||
|
'h5' = 'heading5',
|
||||||
|
'h6' = 'heading6',
|
||||||
|
'table' = 'table',
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
export * from './types'
|
export { IMarkdownReportConfig, StyleName } from './config'
|
||||||
export * from './config'
|
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
import type { IRunOptions } from 'docx'
|
|
||||||
|
|
||||||
export interface ReportConfig{
|
|
||||||
title: string
|
|
||||||
logo?: string
|
|
||||||
subtitle?: string
|
|
||||||
subtitlePos?: 'up' | 'down'
|
|
||||||
coverInfo?: Record<string, any>
|
|
||||||
disablePageNumber?: boolean
|
|
||||||
disablePageHeader?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
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