1.0.3 • Published 6 months ago
@types/opencc-js v1.0.3
Installation
npm install --save @types/opencc-js
Summary
This package contains type definitions for opencc-js (https://github.com/nk2028/opencc-js).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/opencc-js.
index.d.ts
// Type definitions for opencc-js 1.0
// Project: https://github.com/nk2028/opencc-js
// Definitions by: Pig Fang <https://github.com/g-plane>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export type Locale = 'cn' | 'tw' | 'twp' | 'hk' | 'jp' | 't';
export interface ConverterOptions {
from?: Locale;
to?: Locale;
}
export type ConvertText = (text: string) => string;
export function Converter(options: ConverterOptions): ConvertText;
export function CustomConverter(dictionary: ReadonlyArray<[string, string]>): ConvertText;
export function HTMLConverter(
converter: ConvertText,
rootNode: Element,
langAttrInitial: string,
langAttrNew: string,
): HTMLConvertHandler;
export interface HTMLConvertHandler {
convert(): void;
restore(): void;
}
Additional Details
- Last updated: Wed, 28 Jul 2021 15:31:34 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by Pig Fang.