import { Constructable } from '.'; import { TemplateParameters } from './description-template.factory'; /** * Make a string optional, which means it'll be empty when the * condition didin't evaluate to true * @param str String to optionalize * @param state Condition * @returns Original string or empty string */ export declare const strOpt: (str: string, state: boolean) => string; /** * Pluralize a word, based on the corresponding count. Also * gets rid of all spaces on the right to properly append * @param word Word in singular form * @param num Count of type the word describes * @param suf Suffix for plural, defaults to s * @returns Pluralized word */ export declare const pluralize: (word: string, num: number, suf?: string) => string; /** * Shorthand to use a ternary operator on two string parameters * @param state Boolean representing state * @param ifTrue String for true state * @param ifFalse String for false state * @returns Either one of the strings */ export declare const ternaryString: (state: boolean, ifTrue: string, ifFalse: string) => string; /** * Evaluates an ensure's description to a string value * Input can be either a string thunk, an immediate string or a template * @param desc Input to evaluate * @param templateLang Language to evaluate the template in * @returns Evaluated string value */ export declare const evalDesc: (input: (() => string) | string | TemplateParameters, templateLang?: string) => string; /** * Escape a string to be used within a regular expression safely * @param val String to escape * @returns Regex-safe string */ export declare const escapeRegExp: (val: string) => string; /** * Find the last (highest) super-class prototype, starting from a * derived class constructor function * @param clazz Derived class to start from * @returns Prototype of superclass or undefined when there's no inheritance */ export declare const getLastSuperclassProto: (clazz: Constructable) => Constructable; /** * Create a validated class instance from a plain object's keys * @param Clazz Clazz to create * @param obj Object to extract from */ export declare const fromObj: (Clazz: Constructable, obj: any) => any; /** * Check whether or not a given class is marked by @CtorEnsure * @param Clazz Class to test */ export declare const isCtorEnsured: (Clazz: Constructable) => boolean; //# sourceMappingURL=util.d.ts.map