UNPKG

digit-to-words-nepali

Version:

A comprehensive TypeScript library for converting numbers to words in English and Nepali languages. Supports numbers up to 10^39 (Adanta Singhar), currency formatting, decimal handling with individual digit pronunciation, and BigInt. Zero dependencies, fu

20 lines (19 loc) 684 B
import { BaseConverter } from '../converters/baseConverter'; /** * ConverterFactory * Singleton factory for creating and reusing converter instances. * Ensures only one instance per converter class for performance. */ export declare class ConverterFactory { private static instances; /** * Get or create an instance of a converter. * @param className The class name of the converter * @param creator Factory function to create a new instance if needed */ static getInstance<T extends BaseConverter>(className: string, creator: () => T): T; /** * Clear all cached instances (useful for testing) */ static clearInstances(): void; }