1.0.5 • Published 6 months ago

@types/shuffle-array v1.0.5

Weekly downloads
1,798
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/shuffle-array

Summary

This package contains type definitions for shuffle-array (https://github.com/pazguille/shuffle-array).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/shuffle-array.

index.d.ts

// Type definitions for shuffle-array 1.0
// Project: https://github.com/pazguille/shuffle-array
// Definitions by: rhysd <https://github.com/rhysd>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace shuffleArray {
    /**
     * copy - Sets if should return a shuffled copy of the given array. By default it's a falsy value.
     * rng - Specifies a custom random number generator.
     */
    interface ShuffleOptions {
        copy?: boolean;
        rng?: () => number;
    }
    /**
     * picks - Specifies how many random elements you want to pick. By default it picks 1.
     * rng - Specifies a custom random number generator.
     */
    interface PickOptions {
        picks?: number;
        rng?: () => number;
    }
    interface ShuffleArray {
        /**
         * Randomizes the order of the elements in a given array.
         *
         * arr - The given array.
         * options - Optional configuration options.
         */
        <T>(arr: T[], options?: ShuffleOptions): T[];
        /**
         * Pick one or more random elements from the given array. If options.picks is
         * omitted or === 1, a single element will be returned; otherwise an array.
         *
         * arr - The given array.
         * options - Optional configuration options.
         */
        pick<T>(arr: ReadonlyArray<T>, options?: PickOptions): T | T[];
    }
}
declare var shuffleArray: shuffleArray.ShuffleArray;
export = shuffleArray;

Additional Details

  • Last updated: Sun, 17 Oct 2021 17:31:19 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by rhysd.

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

7 months ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago

0.0.28

8 years ago

0.0.27

8 years ago

0.0.26-alpha

8 years ago

1.0.26-alpha

8 years ago

1.0.25-alpha

8 years ago

1.0.24-alpha

8 years ago

1.0.23-alpha

8 years ago

1.0.22-alpha

8 years ago

1.0.21-alpha

8 years ago

1.0.20-alpha

8 years ago

1.0.15-alpha

8 years ago

1.0.14-alpha

8 years ago