/** * Adds a space character before non-consecutive capital letters */ declare function decamel(str: string): string; interface OptionProperties { style: string; currency: string; minimumFractionDigits: number; } interface Options { locales: "en-US"; options: OptionProperties; } interface formattedCurrency { currency: string; integer: string; separator: string; decimal: string; fraction: string; } declare function formatCurrency(amount: number, options?: Options): formattedCurrency; declare type ArgTypes = undefined | null | string | number | Array | Record; declare function isNil(arg: ArgTypes): boolean; declare function isObject(arg: any): boolean; /** * @param {any} * * @returns {Array[string, string]} [Typeof instance, if it has mutable methods] */ declare function instanceOfBuiltin(arg: any): [string, string]; declare type MapKey = string | number; /** * WARNING: TypeScript doesn't catch when a map key is a non-"MapKey" type */ declare function mapToObject(m: Map): Record; declare type NormalizeStringReturn = [string, Error | null]; /** * normalizeString trims surrounding white space and replaces duplicate white space with a single space */ declare function normalizeString(input: string): NormalizeStringReturn; declare function objectToString(arg: T, pad?: string, indention?: string): string; /** * Safe JSON parse * If the param string is valid JSON, safeJSONParse returns the parsed JSON and null for the error value * * If the param string is *not* valid JSON, safeJSONParse returns the original string and an error message to let the consumer know it is not valid JSON */ declare type SafeJSONParseReturn = [Record | any[] | string, Error | null]; declare function safeJSONParse(str: string): SafeJSONParseReturn; declare function slugify(str: string): [string, Error | null]; declare function splitRunes(string: string): string[]; declare type StripEmojiReturn = [string, Error | null]; declare function stripEmojis(str: string): StripEmojiReturn; declare function struct(obj: any): any; declare function set(props: any): void; declare type ToUpperCaseReturn = [string, Error | null]; /** * toUpperCase capitalizes the first letter of all the words in a string */ declare function toUpperCase(input: string): ToUpperCaseReturn; declare function unsafeStripHTML(markup: string): string; declare const wait: (ms?: number) => Promise; export { MapKey, decamel, formatCurrency, formattedCurrency, instanceOfBuiltin, isNil, isObject, mapToObject, normalizeString, objectToString, safeJSONParse, set, slugify, splitRunes, stripEmojis, struct, toUpperCase, unsafeStripHTML, wait };