interface INumeralImplements { clone?: () => any; format?: (inputString: string, roundingFunction: (x: number) => number) => any; value?: () => any; input?: () => any; set?: (value: any) => any; add?: (value: any) => any; subtract?: (value: any) => any; multiply?: (value: any) => any; divide?: (value: any) => any; difference?: (value: any) => any; } interface NumeralLocales { [id: string]: NumeralLocale; } interface NumeralLocale { currency: { symbol: string; }; delimiters: { thousands: string; decimal: string; }; abbreviations: NumeralAbbreviations; ordinal(num: number): string; } interface NumeralAbbreviations { thousand: string; million: string; billion: string; trillion: string; } declare const numeral: { (input?: any): Numeral; options: Record; formats: Record; locales: NumeralLocales; isNumeral(obj: any): boolean; locale(key?: string): any; localeData(key?: string): NumeralLocale; reset(): void; zeroFormat(format: any): void; nullFormat(format: any): void; defaultFormat(format: any): void; register(type: 'locale' | 'format', name: string, format: any): any; validate(val: any, culture: any): boolean; numberToFormat(value: any, format: any, roundingFunction: () => void): string; stringToNumber(string: string): number | null; }; declare class Numeral implements INumeralImplements { private _input; private _value; constructor(input: any, number: number); clone(): Numeral; format(inputString?: any, roundingFunction?: (x: number) => number): any; value(): number; input(): any; set(value: number | string): this; add(value: number | string): this; subtract(value: number | string): this; multiply(value: number | string): this; divide(value: number | string): this; difference(value: number | string): number; } /** * Checks if `value` is likely an `arguments` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`. * @example * * isArguments(function() { return arguments }()) * // => true * * isArguments([1, 2, 3]) * // => false */ declare function isArguments(value: any): boolean; /** * Checks if `value` is classified as an `Array` object. * * @static * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * isArray([1, 2, 3]); * // => true * * isArray(document.body.children); * // => false * * isArray('abc'); * // => false * * isArray(noop); * // => false */ declare const isArray: (arg: any) => arg is any[]; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * isArrayLike([1, 2, 3]) * // => true * * isArrayLike(document.body.children) * // => true * * isArrayLike('abc') * // => true * * isArrayLike(Function) * // => false */ declare function isArrayLike(value?: any): value is T[]; /** * This method is like `isArrayLike` except that it also checks if `value` * is an object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * isArrayLikeObject([1, 2, 3]) * // => true * * isArrayLikeObject(document.body.children) * // => true * * isArrayLikeObject('abc') * // => false * * isArrayLikeObject(Function) * // => false */ declare function isArrayLikeObject(value?: any): value is T[]; /** * Checks if `value` is classified as a typed array. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * isTypedArray(new Uint8Array) * // => true * * isTypedArray([]) * // => false */ declare function isTypedArray(value: any): boolean; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * isArrayBuffer(new ArrayBuffer(2)) * // => true * * isArrayBuffer(new Array(2)) * // => false */ declare const isArrayBuffer: (value: any) => any; /** * Checks if `value` is a buffer. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * isBuffer(Buffer.alloc(2)) * // => true * * isBuffer(new Uint8Array(2)) * // => false */ declare function isBuffer(value?: any): boolean; /** * Checks if `value` is classified as a boolean primitive or object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * isBoolean(false) * // => true * * isBoolean(null) * // => false */ declare function isBoolean(value: any): value is boolean; /** * Checks if `value` is classified as a `Date` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * isDate(new Date) * // => true * * isDate('Mon April 23 2012') * // => false */ declare function isDate(value?: any): value is Date; /** * Checks if `value` is likely a DOM element. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * isElement(document.body) * // => true * * isElement('') * // => false */ declare function isElement(value?: any): boolean; type EmptyObject = { [K in keyof T]?: never; }; type EmptyObjectOf = EmptyObject extends T ? EmptyObject : never; /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * isEmpty(null) * // => true * * isEmpty(true) * // => true * * isEmpty(1) * // => true * * isEmpty([1, 2, 3]) * // => false * * isEmpty('abc') * // => false * * isEmpty({ 'a': 1 }) * // => false */ declare function isEmpty(value?: T): boolean; declare function isEmpty(value: string): value is ''; declare function isEmpty(value: Map | Set | ArrayLike | null | undefined): boolean; declare function isEmpty(value: object): boolean; declare function isEmpty(value: T | null | undefined): value is EmptyObjectOf | null | undefined; /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * isError(new Error) * // => true * * isError(Error) * // => false */ declare function isError(value: any): value is Error; /** * Checks if `value` is classified as a `Function` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * isFunction(class Any{}) * // => true * * isFunction(() => {}) * // => true * * isFunction(async () => {}) * // => true * * isFunction(function * Any() {}) * // => true * * isFunction(Math.round) * // => true * * isFunction(/abc/) * // => false */ declare function isFunction(value: any): value is (...args: any[]) => any; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ declare function isIndex(value: any, length: number): boolean; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * isLength(3) * // => true * * isLength(Number.MIN_VALUE) * // => false * * isLength(Infinity) * // => false * * isLength('3') * // => false */ declare function isLength(value?: any): boolean; /** * Checks if `value` is classified as a `Map` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * isMap(new Map) * // => true * * isMap(new WeakMap) * // => false */ declare function isMap(value?: any): value is Map; /** * Checks if `value` is a pristine native function. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * isNative(Array.prototype.push) * // => true * * isNative(isDate) * // => false */ declare function isNative(value: any): value is (...args: any[]) => any; /** * Checks if `value` is `null`. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * isNull(null) * // => true * * isNull(void 0) * // => false */ declare function isNull(value?: any): value is null; /** * Checks if `value` is `null` or `undefined`. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * isNil(null) * // => true * * isNil(void 0) * // => true * * isNil(NaN) * // => false */ declare function isNil(value?: any): value is null | undefined; /** * Checks if `value` is `undefined`. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * isUndefined(void 0) * // => true * * isUndefined(null) * // => false */ declare function isUndefined(value?: any): value is undefined; /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `Number.isFinite` method. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @see isInteger, toInteger, toNumber * @example * * isNumber(3) * // => true * * isNumber(Number.MIN_VALUE) * // => true * * isNumber(Infinity) * // => true * * isNumber('3') * // => false */ declare function isNumber(value?: any): value is number; /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * isObject({}) * // => true * * isObject([1, 2, 3]) * // => true * * isObject(Function) * // => true * * isObject(null) * // => false */ declare function isObject(value?: any): value is object; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * isObjectLike({}) * // => true * * isObjectLike([1, 2, 3]) * // => true * * isObjectLike(Function) * // => false * * isObjectLike(null) * // => false */ declare function isObjectLike(value?: any): boolean; /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1 * } * * isPlainObject(new Foo) * // => false * * isPlainObject([1, 2, 3]) * // => false * * isPlainObject({ 'x': 0, 'y': 0 }) * // => true * * isPlainObject(Object.create(null)) * // => true */ declare function isPlainObject(value?: any): boolean; /** * Checks if `value` is likely a prototype object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ declare function isPrototype(value: any): boolean; /** * Checks if `value` is classified as a `RegExp` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * isRegExp(/abc/) * // => true * * isRegExp('/abc/') * // => false */ declare function isRegExp(value?: any): value is RegExp; /** * Checks if `value` is classified as a `Set` object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * isSet(new Set) * // => true * * isSet(new WeakSet) * // => false */ declare function isSet(value?: any): value is Set; /** * Checks if `value` is classified as a `String` primitive or object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * isString('abc') * // => true * * isString(1) * // => false */ declare function isString(value?: any): value is string; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @category Is * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * isSymbol(Symbol.iterator) * // => true * * isSymbol('abc') * // => false */ declare function isSymbol(value: any): value is symbol; /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @category Object * @param {object} object The object to query. * @returns {Array} Returns the array of property names. * @see values, valuesIn * @example * * function Foo() { * this.a = 1 * this.b = 2 * } * * Foo.prototype.c = 3 * * keys(new Foo) * // => ['a', 'b'] (iteration order is not guaranteed) * * keys('hi') * // => ['0', '1'] */ declare function keys(object: object): any[]; /** * Creates an array of the own and inherited enumerable property names of `object`. * * * @static * @category Object * @param {object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ declare function keysIn(object: any): any[]; /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. Object inheritance is preserved. An empty object is * returned for uncloneable values such as error objects, functions, DOM nodes, * and WeakMaps. * * @category Object * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see cloneDeep * @example * * const objects = [{ 'a': 1 }, { 'b': 2 }] * * const shallow = clone(objects) * console.log(shallow[0] === objects[0]) * // => true */ declare function clone(value: T): T; /** * This method is like `clone` except that it recursively clones `value`. * Object inheritance is preserved. * * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see clone * @example * * const objects = [{ 'a': 1 }, { 'b': 2 }] * * const deep = cloneDeep(objects) * console.log(deep[0] === objects[0]) * // => false */ declare function cloneDeep(value: T): T; /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @category Object * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * const object = { 'a': 1 } * const other = { 'a': 1 } * * eq(object, object) * // => true * * eq(object, other) * // => false * * eq('a', 'a') * // => true * * eq('a', Object('a')) * // => false * * eq(NaN, NaN) * // => true */ declare function eq(value: any, other: any): boolean; /** * Falsy * @desc Type representing falsy values in TypeScript: `false | "" | 0 | null | undefined` * @example * type Various = 'a' | 'b' | undefined | false; * * // Expect: "a" | "b" * Exclude; */ type Falsy = false | '' | 0 | null | undefined; /** * Nullish * @desc Type representing [nullish values][https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing] in TypeScript: `null | undefined` * @example * type Various = 'a' | 'b' | undefined; * * // Expect: "a" | "b" * Exclude; */ type Nullish = T | null | undefined; export { type Falsy, type Nullish, clone, cloneDeep, eq, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isError, isFunction, isIndex, isLength, isMap, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrototype, isRegExp, isSet, isString, isSymbol, isTypedArray, isUndefined, keys, keysIn, numeral };