/** * `excaliplant markdown …` — command logic with injected I/O. The module does * no file-system access itself; `bin/excaliplant.mjs` supplies real `io`. * @module markdown/cli */ export type MarkdownIo = { /** * UTF-8 text; rejects when missing. */ readFile: (file: string) => Promise; /** * UTF-8 text; creates parent directories. */ writeFile: (file: string, data: string) => Promise; /** * Needed for the `-` input. */ readStdin?: () => Promise; stdout: { write(chunk: string): unknown; }; stderr: { write(chunk: string): unknown; }; /** * Optional `!include` resolver. */ include?: import("../core/preprocess/preprocessor.mjs").IncludeResolver; /** * File resolver for an opted-in directory. */ openIncludes?: (root: string, input: string) => { include: import("../core/preprocess/preprocessor.mjs").IncludeResolver; sourcePath: string; }; }; /** * I/O the command needs. Paths are passed through exactly as given on the * command line (assets are joined onto the target document's directory). * @typedef {object} MarkdownIo * @property {(file: string) => Promise} readFile UTF-8 text; rejects when missing. * @property {(file: string, data: string) => Promise} writeFile UTF-8 text; creates parent directories. * @property {() => Promise} [readStdin] Needed for the `-` input. * @property {{ write(chunk: string): unknown }} stdout * @property {{ write(chunk: string): unknown }} stderr * @property {import("../core/preprocess/preprocessor.mjs").IncludeResolver} [include] Optional `!include` resolver. * @property {(root: string, input: string) => { include: import("../core/preprocess/preprocessor.mjs").IncludeResolver, sourcePath: string }} [openIncludes] File resolver for an opted-in directory. */ export declare const MARKDOWN_HELP: string; export type ParsedArgs = { inputs: string[]; output?: string; inPlace: boolean; mode: "inline" | "file"; assetsDir?: string; includeDir?: string; keep: false | "comment" | "details" | undefined; check: boolean; theme?: string; clean: boolean; seed?: string; width?: number; maxBlocks?: number; quiet: boolean; help: boolean; }; /** * Run `excaliplant markdown`. Never throws; resolves to the process exit code * (0 success, 1 render errors or `--check` found stale files, 2 usage error). * @param {string[]} argv Arguments after the `markdown` word. * @param {MarkdownIo} io * @returns {Promise} * @public */ export declare function runMarkdownCommand(argv: string[], io: MarkdownIo): Promise;