1 | import { IIterator } from './iter';
|
2 | /**
|
3 | * Create an iterator of evenly spaced values.
|
4 | *
|
5 | * @param start - The starting value for the range, inclusive.
|
6 | *
|
7 | * @param stop - The stopping value for the range, exclusive.
|
8 | *
|
9 | * @param step - The distance between each value.
|
10 | *
|
11 | * @returns An iterator which produces evenly spaced values.
|
12 | *
|
13 | * #### Notes
|
14 | * In the single argument form of `range(stop)`, `start` defaults to
|
15 | * `0` and `step` defaults to `1`.
|
16 | *
|
17 | * In the two argument form of `range(start, stop)`, `step` defaults
|
18 | * to `1`.
|
19 | */
|
20 | export declare function range(start: number, stop?: number, step?: number): IIterator<number>;
|
21 | /**
|
22 | * An iterator which produces a range of evenly spaced values.
|
23 | */
|
24 | export declare class RangeIterator implements IIterator<number> {
|
25 | /**
|
26 | * Construct a new range iterator.
|
27 | *
|
28 | * @param start - The starting value for the range, inclusive.
|
29 | *
|
30 | * @param stop - The stopping value for the range, exclusive.
|
31 | *
|
32 | * @param step - The distance between each value.
|
33 | */
|
34 | constructor(start: number, stop: number, step: number);
|
35 | /**
|
36 | * Get an iterator over the object's values.
|
37 | *
|
38 | * @returns An iterator which yields the object's values.
|
39 | */
|
40 | iter(): IIterator<number>;
|
41 | /**
|
42 | * Create an independent clone of the iterator.
|
43 | *
|
44 | * @returns A new independent clone of the iterator.
|
45 | */
|
46 | clone(): IIterator<number>;
|
47 | /**
|
48 | * Get the next value from the iterator.
|
49 | *
|
50 | * @returns The next value from the iterator, or `undefined`.
|
51 | */
|
52 | next(): number | undefined;
|
53 | private _index;
|
54 | private _length;
|
55 | private _start;
|
56 | private _stop;
|
57 | private _step;
|
58 | }
|
59 | //# sourceMappingURL=range.d.ts.map |
\ | No newline at end of file |