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

1.3.3 • Public • Published

Installation

npm install --save @types/kyujitai

Summary

This package contains type definitions for kyujitai (https://github.com/hakatashi/kyujitai.js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kyujitai.

index.d.ts

export as namespace Kyujitai;

/**
 * Utility collections for making Japanese text old-fashioned.
 */
declare class Kyujitai {
    constructor(options?: Kyujitai.Options, callback?: Kyujitai.InitializeCallback);
    constructor(callback: Kyujitai.InitializeCallback);

    /**
     * Encode string from shinjitai to kyujitai.
     * @param str Input string
     * @param [options]
     */
    encode(str: string, options?: Kyujitai.EncodeOptions): string;

    /**
     * Decode string from kyujitai to shinjitai.
     */
    decode(str: string, options?: Kyujitai.DecodeOptions): string;
}

declare namespace Kyujitai {
    interface Options {
        /**
         * the path to ivd.json file.
         * Valid only in browser.
         * Default is the same directory to the ivs.js file.
         */
        ivd?: string | undefined;

        kyujitai?: string | undefined;
    }

    /**
     * Called when construction completed
     */
    type InitializeCallback = (error: Error | null) => void;

    interface EncodeOptions {
        /**
         * `true` if you want to allow IVS for the encoded string
         * @default false
         */
        IVD?: boolean | undefined;
    }

    /** unused */
    interface DecodeOptions {
        [key: string]: unknown;
    }
}

export = Kyujitai;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: none

Credits

These definitions were written by Piotr Błażejewicz.

Dependents (0)

Package Sidebar

Install

npm i @types/kyujitai

Weekly Downloads

0

Version

1.3.3

License

MIT

Unpacked Size

5.16 kB

Total Files

5

Last publish

Collaborators

  • types