@cowwoc/requirements
Version:
A fluent API for enforcing design contracts with automatic message generation.
25 lines (24 loc) • 853 B
text/typescript
/**
* Generates the singular or plural form of an element type.
*/
declare class Pluralizer {
private readonly singular;
private readonly plural;
static readonly CHARACTER: Pluralizer;
static readonly KEY: Pluralizer;
static readonly VALUE: Pluralizer;
static readonly ELEMENT: Pluralizer;
static readonly ENTRY: Pluralizer;
/**
* @param singular - the singular form of the element
* @param plural - the plural form of the element
*/
constructor(singular: string, plural: string);
/**
* @param count - a number of elements
* @param name - the name of the parameter containing the number of elements (`null` if absent)
* @returns the singular or plural form of the element type (in lowercase)
*/
nameOf(count: number, name: string | null): string;
}
export { Pluralizer };