legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
65 lines • 2.38 kB
TypeScript
/**
* Modern Browser Entry Point for Legal Markdown Processing
*
* This module provides a browser-optimized version that uses the full
* remark-based processing pipeline. It requires a modern bundler (Vite)
* that can handle ESM dependencies properly.
*
* Features:
* - Full remark AST-based processing
* - All Legal Markdown syntax support
* - Async-only API for better performance
* - No legacy fallbacks
*
* @module browser-modern
*/
import { processLegalMarkdownWithRemark, LegalMarkdownProcessorOptions, LegalMarkdownProcessorResult } from './extensions/remark/legal-markdown-processor';
export type { LegalMarkdownProcessorOptions, LegalMarkdownProcessorResult };
/**
* Process Legal Markdown content using the modern remark pipeline
*
* This is the primary API for browser usage. It provides full feature
* parity with the CLI version, including all syntax features and
* processing capabilities.
*
* @param content - The Legal Markdown content to process
* @param options - Processing options
* @returns Promise resolving to processed content and metadata
*
* @example
* ```typescript
* const result = await processLegalMarkdown(content, {
* enableFieldTracking: true,
* debug: false
* });
* console.log(result.content); // Processed markdown
* console.log(result.metadata); // Extracted metadata
* ```
*/
export declare function processLegalMarkdown(content: string, options?: LegalMarkdownProcessorOptions): Promise<LegalMarkdownProcessorResult>;
/**
* Legacy sync API - throws error with migration instructions
*
* This function exists only to provide a clear migration path for
* users of the old synchronous API.
*
* @deprecated Use the async processLegalMarkdown() instead
* @throws Error with migration instructions
*/
export declare function processLegalMarkdownSync(): never;
/**
* Default export for UMD compatibility
*
* Provides the modern API in a format compatible with script tags
* and legacy module systems.
*/
declare const LegalMarkdown: {
processLegalMarkdown: typeof processLegalMarkdown;
processLegalMarkdownSync: typeof processLegalMarkdownSync;
processLegalMarkdownWithRemark: typeof processLegalMarkdownWithRemark;
process: typeof processLegalMarkdown;
version: string;
isModernBundle: boolean;
};
export default LegalMarkdown;
//# sourceMappingURL=browser-modern.d.ts.map