UNPKG

shevchenko

Version:

JavaScript library for declension of Ukrainian anthroponyms

127 lines (126 loc) 4.37 kB
import { DeclensionInput, DeclensionOutput, GenderDetectionInput, GenderDetectionOutput } from './contracts'; export { DeclensionInput, DeclensionOutput, GenderDetectionInput, GenderDetectionOutput, } from './contracts'; export { InputValidationError } from './input-validation'; export { GrammaticalCase, GrammaticalGender, WordClass } from './language'; export { WordInflector } from './word-declension'; export { registerExtension, ShevchenkoExtension, ExtensionFactory, AfterInflectHook, } from './extension'; /** * Inflects an anthroponym in nominative grammatical case. * * @example * ```ts * const anthroponym = await shevchenko.inNominative({ * gender: shevchenko.GrammaticalGender.MASCULINE, * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function inNominative<T extends DeclensionInput>(input: T): Promise<DeclensionOutput<T>>; /** * Inflects an anthroponym in genitive grammatical case. * * @example * ```ts * const anthroponym = await shevchenko.inGenitive({ * gender: shevchenko.GrammaticalGender.MASCULINE, * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function inGenitive<T extends DeclensionInput>(input: T): Promise<DeclensionOutput<T>>; /** * Inflects an anthroponym in dative grammatical case. * * @example * ```ts * const anthroponym = await shevchenko.inDative({ * gender: shevchenko.GrammaticalGender.MASCULINE, * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function inDative<T extends DeclensionInput>(input: T): Promise<DeclensionOutput<T>>; /** * Inflects an anthroponym in accusative grammatical case. * * @example * ```ts * const anthroponym = await shevchenko.inAccusative({ * gender: shevchenko.GrammaticalGender.MASCULINE, * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function inAccusative<T extends DeclensionInput>(input: T): Promise<DeclensionOutput<T>>; /** * Inflects an anthroponym in ablative grammatical case. * * @example * ```ts * const anthroponym = await shevchenko.inAblative({ * gender: shevchenko.GrammaticalGender.MASCULINE, * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function inAblative<T extends DeclensionInput>(input: T): Promise<DeclensionOutput<T>>; /** * Inflects an anthroponym in locative grammatical case. * * @example * ```ts * const anthroponym = await shevchenko.inLocative({ * gender: shevchenko.GrammaticalGender.MASCULINE, * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function inLocative<T extends DeclensionInput>(input: T): Promise<DeclensionOutput<T>>; /** * Inflects an anthroponym in vocative grammatical case. * * @example * ```ts * const anthroponym = await shevchenko.inVocative({ * gender: shevchenko.GrammaticalGender.MASCULINE, * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function inVocative<T extends DeclensionInput>(input: T): Promise<DeclensionOutput<T>>; /** * Returns the grammatical gender of an anthroponym. * Returns null if the grammatical gender cannot be detected. * * @example * ```ts * const gender = await shevchenko.detectGender({ * givenName: 'Тарас', * patronymicName: 'Григорович', * familyName: 'Шевченко', * }); * ``` * @throws {InputValidationError} Input validation error. */ export declare function detectGender(input: GenderDetectionInput): Promise<GenderDetectionOutput>;