/* tslint:disable */
/* eslint-disable */

/**
 * Kitoken tokenizer.
 * A fast and versatile tokenizer for language models.
 */
export class Kitoken {
    free(): void;
    [Symbol.dispose](): void;
    /**
     * Returns the configuration of the tokenizer.
     */
    config(): any;
    /**
     * Decodes the given sequence of tokens into text.
     *
     * `decode_specials` specifies which tokens from the special vocabulary are included in the output.
     * Accepted are arrays of strings "control", "priority", "unknown", and boolean values `true` and `false`.
     *
     * Returns a list of bytes, or an error if no byte sequence for a token exists in the decoder and no unknown token is set in the configuration.
     */
    decode(tokens: Uint32Array, decode_specials: any): Uint8Array;
    /**
     * Decodes the given sequences of tokens into texts.
     *
     * `decode_specials` specifies which tokens from the special vocabulary are included in the output.
     * Accepted are arrays of strings "control", "priority", "unknown", and boolean values `true` and `false`.
     *
     * Returns a list of lists of bytes, or an error if no byte sequence for a token exists in the decoder and no unknown token is set in the configuration.
     */
    decode_all(tokens: any[], decode_specials: any): any[];
    /**
     * Returns the definition of the tokenizer.
     */
    definition(): any;
    /**
     * Encodes the given text into a sequence of tokens.
     *
     * `encode_specials` specifies which special tokens are tokenized with the special vocabulary instead of the regular vocabulary.
     * Accepted are arrays of strings "control", "priority", "unknown", and boolean values `true` and `false`.
     * When `true`, all special token categories from the special vocabulary are used.
     *
     * Returns a list of tokens, or an error if no token for a part exists in the encoder and no unknown token id is set in the configuration.
     */
    encode(text: string, encode_specials: any): Uint32Array;
    /**
     * Encodes the given texts into sequences of tokens.
     *
     * `encode_specials` specifies which special tokens are tokenized with the special vocabulary instead of the regular vocabulary.
     * Accepted are arrays of strings "control", "priority", "unknown", and boolean values `true` and `false`.
     * When `true`, all special token categories from the special vocabulary are used.
     *
     * Returns a list of lists of tokens, or an error if no token for a part exists in the encoder and no unknown token id is set in the configuration.
     */
    encode_all(text: string[], encode_specials: any): any[];
    /**
     * Initializes the tokenizer from a serialized `sentencepiece` model.
     */
    static from_sentencepiece(data: Uint8Array): Kitoken;
    /**
     * Initializes the tokenizer from a serialized `tokenizers` model.
     */
    static from_tekken(data: Uint8Array): Kitoken;
    /**
     * Initializes the tokenizer from a serialized `tiktoken` model.
     */
    static from_tiktoken(data: Uint8Array): Kitoken;
    /**
     * Initializes the tokenizer from a serialized `tokenizers` model.
     */
    static from_tokenizers(data: Uint8Array): Kitoken;
    /**
     * Returns the metadata of the tokenizer.
     */
    meta(): any;
    /**
     * Initializes the tokenizer from a serialized `kitoken` definition.
     */
    constructor(data: Uint8Array);
    /**
     * Sets the configuration of the tokenizer.
     *
     * Returns an error if the configuration is invalid.
     */
    set_config(config: any): void;
    /**
     * Sets the definition of the tokenizer.
     *
     * Returns an error if the definition is invalid.
     */
    set_definition(definition: any): void;
    /**
     * Creates a definition from this tokenizer and serializes it to bytes.
     */
    to_bytes(): Uint8Array;
}

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly __wbg_kitoken_free: (a: number, b: number) => void;
    readonly kitoken_config: (a: number) => number;
    readonly kitoken_decode: (a: number, b: number, c: number, d: number, e: number) => void;
    readonly kitoken_decode_all: (a: number, b: number, c: number, d: number, e: number) => void;
    readonly kitoken_definition: (a: number) => number;
    readonly kitoken_encode: (a: number, b: number, c: number, d: number, e: number) => void;
    readonly kitoken_encode_all: (a: number, b: number, c: number, d: number, e: number) => void;
    readonly kitoken_from_sentencepiece: (a: number, b: number, c: number) => void;
    readonly kitoken_from_tekken: (a: number, b: number, c: number) => void;
    readonly kitoken_from_tiktoken: (a: number, b: number, c: number) => void;
    readonly kitoken_from_tokenizers: (a: number, b: number, c: number) => void;
    readonly kitoken_meta: (a: number) => number;
    readonly kitoken_new: (a: number, b: number, c: number) => void;
    readonly kitoken_set_config: (a: number, b: number, c: number) => void;
    readonly kitoken_set_definition: (a: number, b: number, c: number) => void;
    readonly kitoken_to_bytes: (a: number, b: number) => void;
    readonly __wbindgen_export: (a: number, b: number) => number;
    readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
    readonly __wbindgen_export3: (a: number) => void;
    readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
    readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;

/**
 * Instantiates the given `module`, which can either be bytes or
 * a precompiled `WebAssembly.Module`.
 *
 * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
 *
 * @returns {InitOutput}
 */
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;

/**
 * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
 * for everything else, calls `WebAssembly.instantiate` directly.
 *
 * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
 *
 * @returns {Promise<InitOutput>}
 */
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
