legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
64 lines • 2.32 kB
TypeScript
/**
* @fileoverview Core Helpers Module - Ruby Legal Markdown Compatibility
*
* This module provides the basic helper functions that were present in the
* original Ruby legal-markdown gem. It focuses on core functionality that
* maintains 1:1 compatibility with the Ruby implementation.
*
* Core helpers include:
* - Basic date functionality (@today support)
* - Simple date formatting compatible with Ruby output
* - Template processing utilities for core legal-markdown features
*
* For advanced helper functions (currency formatting, advanced date manipulation,
* string utilities), see src/extensions/helpers/
*
* @example
* ```typescript
* import { today, formatBasicDate } from '../helpers/index.js';
*
* // Core functionality from Ruby legal-markdown
* const currentDate = today();
* const formatted = formatBasicDate(currentDate, 'DD/MM/YYYY');
* ```
*/
export * from './date-helpers.js';
import { today, formatBasicDate, parseToday } from './date-helpers.js';
/**
* Registry of core helper functions for template processing
*
* This object provides the basic helper functions that were available
* in the original Ruby legal-markdown implementation. It serves as the
* foundation for template processing and mixin resolution.
*
* {Object} coreHelpers
* @example
* ```typescript
* import { coreHelpers } from '../helpers/index.js';
*
* // Use in core template processing (Ruby compatible)
* const todayDate = coreHelpers.today();
* const formatted = coreHelpers.formatBasicDate(new Date(), 'YYYY-MM-DD');
* ```
*/
export declare const coreHelpers: {
today: typeof today;
formatBasicDate: typeof formatBasicDate;
parseToday: typeof parseToday;
formatDate: typeof formatBasicDate;
};
/**
* Core helper function names for validation and processing
*
* List of helper function names that are part of the core Ruby-compatible
* functionality. Used for validating template expressions and determining
* which helpers are available in core processing.
*
* {string[]} CORE_HELPER_NAMES
*/
export declare const CORE_HELPER_NAMES: readonly ["today", "formatBasicDate", "formatDate", "parseToday"];
/**
* Type definition for core helper function names
*/
export type CoreHelperName = (typeof CORE_HELPER_NAMES)[number];
//# sourceMappingURL=index.d.ts.map