taraskevizer
Version:
Канвэртацыя акадэмічнага правапісу ў клясычны
104 lines (103 loc) • 3.51 kB
TypeScript
import type { DeepPartialReadonly } from './types';
import type { Alphabet } from './dict/alphabets';
import { type Wrappers } from './wrappers';
export type Variation = 'no' | 'first' | 'all';
export type OptionJ = 'never' | 'random' | 'always';
export declare class TaraskConfig {
constructor(options?: DeepPartialReadonly<TaraskConfig>);
/**
* Predefined alphabets are in {@link dicts.alphabets}.
*
* @default alphabets.cyrillic
*/
abc: Alphabet;
/**
* | When to replace `і`(`i`) by `й`(`j`) after vowels | Example |
* | ------------------------------------------------- | ------------------------ |
* | | `яна і ён` |
* | never | `яна і ён` |
* | random | `яна і ён` or `яна й ён` |
* | always | `яна й ён` |
*
* Has no effect with abc set to {@link dicts.alphabets.latinJi}.
*
* @default "never"
*/
j: OptionJ;
/**
* If set to false, may cause unwanted changes in acronyms.
*
* @default true
*/
doEscapeCapitalized: boolean;
/**
* Used for wrapping changed parts.
* Predefined dicts are in {@link wrappers}.
*
* If `null`, wrapping changes will be skipped.
*
* @default null
*/
wrappers: null | Partial<Wrappers>;
/**
* Do replace ґ(g) by г(h) in cyrillic alphabet?
*
* | Value | Example |
* | ----- | --------------------------------------- |
* | true | Ґвалт ґвалт |
* | false | Гвалт гвалт |
* | true | `<tarH>ґ</tarH>валт <tarH>Ґ</tarH>валт` |
* | false | `<tarH>г</tarH>валт <tarH>Г</tarH>валт` |
*
* @default false
*/
g: boolean;
/**
* | Which variation is used if a part of word is variable | Example |
* | ----------------------------------------------------- | ----------------- |
* | | Гродна |
* | no (main) | Гродна |
* | first | Горадня |
* | all | (Гродна\|Горадня) |
*
* @default "all"
*/
variations: Variation;
/**
* String to replace `"\n"` with.
*
* @default "\n"
* @example "<br>"
*/
newLine: string;
/**
* String to replace `"<"` with.
*
* @default "<"
* @example "<"
*/
leftAngleBracket: string;
/**
* Placeholder for parts that should not be fixed like those enclosed in `< >`.
*
* > Change only if the default value interferes with your text.
*
* @default " \ue0fe "
*/
noFixPlaceholder: string;
}
/**
* Predefined configuration for HTML.
*
* @example
* const htmlCfg = new TaraskConfig({
* ...myOptions,
* ...htmlConfigOptions
* });
*/
export declare const htmlConfigOptions: {
readonly wrappers: Wrappers;
readonly g: false;
readonly newLine: "<br>";
readonly leftAngleBracket: "<";
};