@types/opencc-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/opencc-js

Weekly Downloads

3,724

Version

1.0.3

License

MIT

Unpacked Size

3.71 kB

Total Files

5

Last publish

Collaborators

  • types