Skip to content

Instantly share code, notes, and snippets.

@Pythonista7
Last active October 9, 2021 10:12
Show Gist options
  • Save Pythonista7/e0e2f487ef90cf4a85d32b692c713fa9 to your computer and use it in GitHub Desktop.
Save Pythonista7/e0e2f487ef90cf4a85d32b692c713fa9 to your computer and use it in GitHub Desktop.
/* eslint-disable no-use-before-define */
interface SlidevConfig {
title: string
/**
* String template to compose title
*
* @example "%s - Slidev" - to suffix " - Slidev" to all pages
* @defult '%s'
*/
titleTemplate: string
/**
* @see https://sli.dev/themes/use.html
* @defult 'default'
*/
// IGNORE theme: string
/**
* @defult true
*/
// IGNORE remoteAssets: boolean | 'dev' | 'build'
/**
* Enable Monaco
*
* @see https://sli.dev/custom/config-monaco.html
* @defult 'dev'
*/
// IGNORE monaco: boolean | 'dev' | 'build'
/**
* Show a download button in the SPA build,
* could also be a link to custom pdf
*
* @default true
*/
// IGNORE download: boolean | string
/**
* Information shows on the built SPA
* Can be a markdown string
*
* @default true
*/
info: string | boolean
/**
* Prefer highlighter
*
* @see https://sli.dev/custom/highlighters.html
* @default prism
*/
highlighter: 'prism' | 'shiki'
/**
* Show line numbers in code blocks
*
* @default false
*/
lineNumbers: boolean
/**
* Force slides color schema
*
* @default 'auto'
*/
colorSchema: 'dark' | 'light' | 'all' | 'auto'
/**
* Router mode for vue-router
*
* @default 'hash'
*/
// IGNORE routerMode: 'hash' | 'history'
/**
* Aspect ratio for slides
* should be like `16/9` or `1:1`
*
* @default '16/9'
*/
aspectRatio: number
/**
* The actual width for slides canvas.
* unit in px.
*
* @default '980'
*/
// IGNORE canvasWidth: number
/**
* Controls whether texts in slides are selectable
*
* @default false
*/
// IGNORE selectable: boolean
/**
* Configure for themes, will inject intro root styles as
* `--slidev-theme-x` for attribute `x`
*
* This allows themes to have customization options in frontmatter
* Refer to themes' document for options avaliable
*
* @default {}
*/
// IGNORE themeConfig: SlidevThemeConfig
/**
* Configure fonts for the slides and app
*
* @default {}
*/
fonts: ResolvedFontOptions
/**
* Options for drawings
*/
drawings: ResolvedDrawingsOptions
}
export interface SlideInfoBase {
raw: string
content: string
note?: string // concat all notes by <br>
frontmatter: Record<string, any>
title?: string
}
export interface SlideInfo extends SlideInfoBase {
index: number
source?: SlideInfoWithPath
}
export interface SlideInfoWithPath extends SlideInfoBase {
filepath: string
}
export interface SlideInfoExtended extends SlideInfo {
notesHTML: string
}
/**
* Metadata for "slidev" field in themes' package.json
*/
// IGNORE
// export interface SlidevThemeMeta {
// defaults?: Partial<SlidevConfig>
// colorSchema?: 'dark' | 'light' | 'both'
// highlighter?: 'prism' | 'shiki' | 'both'
// }
export type SlidevThemeConfig = Record<string, string | number>
export interface SlidevFeatureFlags {
katex: boolean
monaco: boolean
tweet: boolean
mermaid: boolean
}
export interface SlidevMarkdown {
slides: SlideInfo[]
raw: string
config: SlidevConfig
features: SlidevFeatureFlags
headmatter: Record<string, unknown>
filepath?: string
entries?: string[]
themeMeta?: SlidevThemeMeta
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment