Installation
npm install --save @types/knuth-shuffle-seeded
Summary
This package contains type definitions for knuth-shuffle-seeded (https://github.com/TimothyGu/knuth-shuffle-seeded).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/knuth-shuffle-seeded.
index.d.ts
export = shuffle;
/**
* Shuffle an array using the Fisher-Yates shuffle algorithm, aka Knuth
* shuffle.
*
* Note that this function overwrites the initial array. As a result if you
* would like to keep the original array intact, you have to copy the initial
* array to a new array.
*
* Implementation derived from http://stackoverflow.com/questions/2450954/.
*
* @param inputArray - An array that is to be shuffled.
* @param [seed=Math.random()] - Seed for the shuffling operation. If
* unspecified then a random value is used.
* @return The resulting array.
*/
declare function shuffle<T = unknown>(inputArray: T[], seed?: number): T[];
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:38 GMT
- Dependencies: none
Credits
These definitions were written by Ethan Brown.