1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | declare namespace fill {
|
7 | interface Options<ValueType, TransformValueType> {
|
8 | step?: number;
|
9 | strictRanges?: boolean;
|
10 | stringify?: boolean;
|
11 | toRegex?: boolean;
|
12 | transform?: (value: ValueType) => TransformValueType;
|
13 | }
|
14 | }
|
15 |
|
16 | type FilledArray<ValueType, TransformValueType> = ValueType extends TransformValueType ? ValueType[] : TransformValueType[];
|
17 |
|
18 | declare function fill<
|
19 | ValueType = string | number,
|
20 | TransformValueType = unknown
|
21 | >(
|
22 | start: ValueType,
|
23 | end?: ValueType | null,
|
24 | step?: number,
|
25 | options?: fill.Options<ValueType, TransformValueType>
|
26 | ): FilledArray<ValueType, TransformValueType>;
|
27 |
|
28 | declare function fill<
|
29 | ValueType = string | number,
|
30 | TransformValueType = unknown
|
31 | >(
|
32 | start: ValueType,
|
33 | end?: ValueType | null,
|
34 | transformOrOptions?: fill.Options<ValueType, TransformValueType>['transform'] | fill.Options<ValueType, TransformValueType>
|
35 | ): FilledArray<ValueType, TransformValueType>;
|
36 |
|
37 | export = fill;
|