DefinitelyTyped/types/weighted-random-object/index.d.ts
2019-07-15 14:32:03 -07:00

15 lines
432 B
TypeScript

// Type definitions for weighted-random-object 1.0
// Project: https://github.com/misund/weighted-random-object
// Definitions by: mike castleman <https://github.com/mlc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
interface Weighted {
weight: number;
}
declare function weightedRandomObject<T extends Weighted>(objects: ReadonlyArray<T>): T;
export = weightedRandomObject;