/// export declare const encoding: string; export declare const success: number; export declare const failure: number; export declare const isDarwin: boolean; export declare const isLinux: boolean; export declare const isMac: boolean; export declare const isWin: boolean; /** * A function that does nothing. Use it as an empty callback initializer. */ export declare type NilCallback = (err?: Error, val?: any) => void; export declare let nil: NilCallback; /** * A function that can be used to initialize an event callback. This function * does nothing so a callback will do */ export declare type INilEventCallback = () => void; export declare let nilEvent: INilEventCallback; /** * Takes an array of numbers and finds the closest value to the given * input number. * * Inspired by https://github.com/andreruffert/closest-number * * @param arr {number[]} array of numbers to search * @param num {number} the number value used as a reference to find * @returns {number} the number from arr that is closest to num */ export declare function closestNumber(arr: number[], num: number): number; /** * Generates a random integer between the two specified values. The value is * no lower than min and not equal to max (not inclusive). Do not use this * for cryptography. * * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random * * @param min {number} the smallest integer to use, inclusive * @param max {number} the largest integer to use, non inclusive * @returns {number} a pseudo random number */ export declare function getRandomInt(min: number, max: number): number; /** * Generates a random integer between the two specified values. The value is * no lower than min and less than or equal to max (inclusive). Do not use this * for cryptography. * * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random * * @param min {number} the smallest integer to use, inclusive * @param max {number} the largest integer to use, inclusive * @returns {number} a pseudo random number */ export declare function getRandomIntInclusive(min: number, max: number): number; /** * Retrieves a version 4 uuid. It can be with or without the dash characters. * @param nodash {boolean} if true, the dashes are removed, otherwise just a * v4 uuid is created. * @returns {string} a v4 uuid */ export declare function getUUID(nodash?: boolean): string; /** * Checks the environment to see if it is running under nodejs. Note that * this can be unreliable if "process" is globally defined in the * environment by some other application (i.e. monkeypatching) * @return true if the environment is running under node, otherwise false */ export declare function isNodeJS(): boolean; /** * Takes a data buffer of output bytes, converts it to a string and then splits * it on newlines for output. By default it is just saved into a sanitized * array. If verbose is set to true, then the buffer it output to the console * line by line. * @param buffer {string} the output bytes to convert and print to log. * @param verbose {boolean} if true, then the sanitized output is sent to * the console. * @param log {console.log} the output logger to write the output when verbose. * @retuns {string[]} an array of string that represent the lines given with * the input buffer. */ export declare function sanitize(buffer: string | Buffer, verbose?: boolean, log?: { (message?: any, ...optionalParams: any[]): void; (message?: any, ...optionalParams: any[]): void; }): string[];