@mikezimm/fps-core-v7
Version:
Library of reusable core interfaces, types and constants migrated from fps-library-v2
38 lines (36 loc) • 1.73 kB
TypeScript
/***
* d8888b. .d8b. d8b db d8888b. .d88b. .88b d88.
* 88 `8D d8' `8b 888o 88 88 `8D .8P Y8. 88'YbdP`88
* 88oobY' 88ooo88 88V8o 88 88 88 88 88 88 88 88
* 88`8b 88~~~88 88 V8o88 88 88 88 88 88 88 88
* 88 `88. 88 88 88 V888 88 .8D `8b d8' 88 88 88
* 88 YD YP YP VP V8P Y8888D' `Y88P' YP YP YP
*
*
import { getRandomInt, getRandomChance, getRandomFromArray, randomDate, generateVals, generateTitles }
from '@mikezimm/npmfunctions/dist/Services/randomServices';
*/
export type IAnyArray = any[];
/**
* https://stackoverflow.com/a/1527820
*
* Returns a random integer between min (inclusive) and max (inclusive).
* The value is no lower than min (or the next integer greater than min
* if min isn't an integer) and no greater than max (or the next integer
* lower than max if max isn't an integer).
* Using Math.round() will give you a non-uniform distribution!
*/
export declare function getRandomInt(min: number, max: number): number;
/**
* Gets a default number or a random chance to get number in range
* @param def
* @param chanceOther Enter whole number for %.... chanceOther = 49 for 49% Chance of getting number outside of default
* @param min
* @param max
*/
export declare function getRandomChance(def: number, chanceOther: number, min: number, max: number): number;
export declare function getRandomFromArray(arr: any[]): any;
export declare function randomDate(start: Date, end: Date): Date;
export declare function generateVals(qty: number, min: number, max: number): number[];
export declare function generateTitles(lbl: string, qty: number): string[];
//# sourceMappingURL=functions.d.ts.map