| 1 |
// Type definitions for compute-lcm 1.1 |
| 2 |
// Project: https://github.com/compute-io/lcm#readme |
| 3 |
// Definitions by: James Holman <https://github.com/jayy-lmao> |
| 4 |
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped |
| 5 |
|
| 6 |
type Accessor<T> = (item: T, idx: number) => number | null; |
| 7 |
|
| 8 |
declare function lcm(a: number, b: number): number | null; |
| 9 |
declare function lcm(a: ReadonlyArray<number>): number | null; |
| 10 |
// Function to extract number from an element from the data array |
| 11 |
declare function lcm<T>(dataArr: ReadonlyArray<T>, a: Accessor<T>): number | null; |
| 12 |
|
| 13 |
// Original package uses module.exports |
| 14 |
export = lcm; |