|
1 | 1 | declare module '@mermaid-js/mermaid-cli' {
|
2 |
| - import {Browser} from "puppeteer"; |
| 2 | + // https://www.npmjs.com/package/@mermaid-js/mermaid-cli/v/11.4.0?activeTab=code |
3 | 3 |
|
4 |
| - function renderMermaid(browser: Browser, definition: string, outputFormat: 'svg' | 'png' | 'pdf', opt: object): Promise<{data: Buffer}>; |
5 |
| - |
6 |
| - export {renderMermaid} |
| 4 | + export type ParseMDDOptions = { |
| 5 | + viewport?: puppeteer.Viewport | undefined; |
| 6 | + backgroundColor?: string | undefined; |
| 7 | + mermaidConfig?: import('mermaid').MermaidConfig | undefined; |
| 8 | + myCSS?: string | undefined; |
| 9 | + pdfFit?: boolean | undefined; |
| 10 | + svgId?: string | undefined; |
| 11 | + }; |
| 12 | + export type MarkdownImageProps = { |
| 13 | + url: string; |
| 14 | + alt: string; |
| 15 | + title?: string | null | undefined; |
| 16 | + }; |
| 17 | + export function run( |
| 18 | + input: `${string}.${'md' | 'markdown'}` | string | undefined, |
| 19 | + output: `${string}.${'md' | 'markdown' | 'svg' | 'png' | 'pdf'}` | '/dev/stdout', |
| 20 | + { |
| 21 | + puppeteerConfig, |
| 22 | + quiet, |
| 23 | + outputFormat, |
| 24 | + parseMMDOptions, |
| 25 | + }?: |
| 26 | + | { |
| 27 | + puppeteerConfig?: puppeteer.LaunchOptions | undefined; |
| 28 | + quiet?: boolean | undefined; |
| 29 | + outputFormat?: 'svg' | 'png' | 'pdf' | undefined; |
| 30 | + parseMMDOptions?: ParseMDDOptions | undefined; |
| 31 | + } |
| 32 | + | undefined, |
| 33 | + ): Promise<void>; |
| 34 | + export function renderMermaid( |
| 35 | + browser: import('puppeteer').Browser | import('puppeteer').BrowserContext, |
| 36 | + definition: string, |
| 37 | + outputFormat: 'svg' | 'png' | 'pdf', |
| 38 | + { |
| 39 | + viewport, |
| 40 | + backgroundColor, |
| 41 | + mermaidConfig, |
| 42 | + myCSS, |
| 43 | + pdfFit, |
| 44 | + svgId, |
| 45 | + }?: ParseMDDOptions | undefined, |
| 46 | + ): Promise<{ |
| 47 | + title: string | null; |
| 48 | + desc: string | null; |
| 49 | + data: Uint8Array; |
| 50 | + }>; |
| 51 | + export function cli(): Promise<void>; |
| 52 | + export function error(message: string): never; |
| 53 | + import puppeteer from 'puppeteer'; |
7 | 54 | }
|
0 commit comments