mdka
Version:
A HTML to Markdown converter that balances conversion quality with runtime efficiency written in Rust
55 lines (44 loc) • 2.14 kB
TypeScript
/* auto-generated by NAPI-RS */
/* eslint-disable */
/** ファイル変換の結果。 */
export interface ConvertResult {
/** 変換した入力ファイルのパス。 */
src: string
/** 書き出した出力ファイルのパス。 */
dest?: string
/** 変換失敗時のエラーメッセージ(バルク変換のみ)。 */
error?: string
}
export declare function htmlFilesToMarkdown(paths: Array<string>, outDir: string): Promise<Array<ConvertResult>>
export declare function htmlFilesToMarkdownWith(paths: Array<string>, outDir: string, options?: JsConversionOptions | undefined | null): Promise<Array<ConvertResult>>
/**
* 単一の HTML ファイルを変換する(既定モード)。
*
* `outDir` が null/undefined の場合は入力と同じディレクトリに `.md` を出力。
*
* ```js
* // 同じディレクトリに出力
* const r = await htmlFileToMarkdown('index.html')
* console.log(r.src, '->', r.dest)
*
* // 別ディレクトリに出力
* const r = await htmlFileToMarkdown('index.html', 'out/')
* ```
*/
export declare function htmlFileToMarkdown(path: string, outDir?: string | undefined | null): Promise<ConvertResult>
/** 単一の HTML ファイルを指定オプションで変換する。 */
export declare function htmlFileToMarkdownWith(path: string, outDir?: string | undefined | null, options?: JsConversionOptions | undefined | null): Promise<ConvertResult>
export declare function htmlToMarkdown(html: string): string
export declare function htmlToMarkdownAsync(html: string): Promise<string>
export declare function htmlToMarkdownWith(html: string, options?: JsConversionOptions | undefined | null): string
export declare function htmlToMarkdownWithAsync(html: string, options?: JsConversionOptions | undefined | null): Promise<string>
export interface JsConversionOptions {
/** "balanced" | "strict" | "minimal" | "semantic" | "preserve" */
mode?: string
preserveIds?: boolean
preserveClasses?: boolean
preserveDataAttrs?: boolean
preserveAriaAttrs?: boolean
dropInteractiveShell?: boolean
}
export declare function version(): string