spiegel-keyman/developer/docs/api/etc/kmc-model.api.md
2024-03-04 18:40:01 +07:00

4.7 KiB

API Report File for "@keymanapp/kmc-model"

Do not edit this file. It is a report generated by API Extractor.


/// <reference types="@keymanapp/models-types" />

import { CompilerCallbacks } from '@keymanapp/common-types';
import { CompilerEvent } from '@keymanapp/common-types';
import { CompilerOptions } from '@keymanapp/common-types';
import { KeymanCompiler } from '@keymanapp/common-types';
import { KeymanCompilerArtifact } from '@keymanapp/common-types';
import { KeymanCompilerArtifacts } from '@keymanapp/common-types';
import { KeymanCompilerResult } from '@keymanapp/common-types';

// @public
export type CasedWordformToKeySpec = (term: string, applyCasing?: CasingFunction) => string;

// @public
export class LexicalModelCompiler implements KeymanCompiler {
    // @internal
    generateLexicalModelCode(model_id: string, modelSource: LexicalModelSource, sourcePath: string): string;
    init(callbacks: CompilerCallbacks, _options: CompilerOptions): Promise<boolean>;
    // @internal
    loadFromFilename(filename: string): LexicalModelSource;
    run(inputFilename: string, outputFilename?: string): Promise<LexicalModelCompilerResult>;
    // @internal (undocumented)
    transpileSources(sources: Array<string>): Array<string>;
    write(artifacts: LexicalModelCompilerArtifacts): Promise<boolean>;
}

// @public
export interface LexicalModelCompilerArtifacts extends KeymanCompilerArtifacts {
    js: KeymanCompilerArtifact;
}

// @public
export interface LexicalModelCompilerResult extends KeymanCompilerResult {
    artifacts: LexicalModelCompilerArtifacts;
}

// Warning: (ae-forgotten-export) The symbol "LexicalModelDeclaration" needs to be exported by the entry point main.d.ts
//
// @public
export interface LexicalModelSource extends LexicalModelDeclaration {
    readonly applyCasing?: CasingFunction;
    readonly languageUsesCasing?: boolean;
    readonly punctuation?: LexicalModelPunctuation;
    readonly rootClass?: string;
    readonly searchTermToKey?: WordformToKeySpec;
    // (undocumented)
    readonly sources: Array<string>;
    readonly wordBreaker?: WordBreakerSpec | SimpleWordBreakerSpec;
}

// Warning: (ae-internal-missing-underscore) The name "ModelCompilerMessages" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export class ModelCompilerMessages {
    // (undocumented)
    static ERROR_NoDefaultExport: number;
    // (undocumented)
    static Error_NoDefaultExport: () => CompilerEvent;
    // (undocumented)
    static ERROR_SearchTermToKeyMustBeExplicitlySpecified: number;
    // (undocumented)
    static Error_SearchTermToKeyMustBeExplicitlySpecified: () => CompilerEvent;
    // (undocumented)
    static ERROR_UnimplementedModelFormat: number;
    // (undocumented)
    static Error_UnimplementedModelFormat: (o: {
        format: string;
    }) => CompilerEvent;
    // (undocumented)
    static ERROR_UnknownModelFormat: number;
    // (undocumented)
    static Error_UnknownModelFormat: (o: {
        format: string;
    }) => CompilerEvent;
    // (undocumented)
    static ERROR_UnknownWordBreaker: number;
    // (undocumented)
    static Error_UnknownWordBreaker: (o: {
        spec: string;
    }) => CompilerEvent;
    // (undocumented)
    static ERROR_UnsupportedScriptOverride: number;
    // (undocumented)
    static Error_UnsupportedScriptOverride: (o: {
        option: string;
    }) => CompilerEvent;
    // (undocumented)
    static ERROR_UTF16BEUnsupported: number;
    // (undocumented)
    static Error_UTF16BEUnsupported: () => CompilerEvent;
    // (undocumented)
    static FATAL_UnexpectedException: number;
    // (undocumented)
    static Fatal_UnexpectedException: (o: {
        e: any;
    }) => CompilerEvent;
    // (undocumented)
    static HINT_DuplicateWordInSameFile: number;
    // (undocumented)
    static Hint_DuplicateWordInSameFile: (o: {
        wordform: string;
    }) => CompilerEvent;
    // (undocumented)
    static HINT_MixedNormalizationForms: number;
    // (undocumented)
    static Hint_MixedNormalizationForms: (o: {
        wordform: string;
    }) => CompilerEvent;
}

// @public
export type SimpleWordBreakerSpec = 'default' | 'ascii' | WordBreakingFunction;

// @public
export type SimpleWordformToKeySpec = (term: string) => string;

// @public
export interface WordBreakerSpec {
    readonly joinWordsAt?: string[];
    // Warning: (ae-forgotten-export) The symbol "OverrideScriptDefaults" needs to be exported by the entry point main.d.ts
    readonly overrideScriptDefaults?: OverrideScriptDefaults;
    // (undocumented)
    readonly use: SimpleWordBreakerSpec;
}

// @public
export type WordformToKeySpec = SimpleWordformToKeySpec | CasedWordformToKeySpec;

// (No @packageDocumentation comment for this package)