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
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: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: none
Credits
These definitions were written by Pig Fang.