UNPKG

@marp-team/marp-cli

Version:

A CLI interface for Marp and Marpit based converters

41 lines (40 loc) 1.19 kB
import fs from 'node:fs'; import { Server as HttpServer } from 'node:http'; import type { Express } from 'express'; import TypedEmitter from 'typed-emitter'; import { Converter, ConvertedCallback } from './converter'; declare const Server_base: new () => TypedEmitter<Server.Events>; export declare class Server extends Server_base { readonly converter: Converter; readonly inputDir: string; readonly options: Server.Options; readonly port: number; directoryIndex: string[]; httpServer: HttpServer | undefined; server: Express | undefined; private static script; constructor(converter: Converter, opts?: Server.Options); start(): Promise<void>; stop(): Promise<void>; private convertMarkdown; private loadScript; private preprocess; private setup; private template; private validateMarkdown; } export declare namespace Server { type Events = { converted: ConvertedCallback; error: (err: Error) => void; }; interface Options { directoryIndex?: string[]; } interface ValidateResult { path: string; stats?: fs.Stats; valid: boolean; } } export {};