Skip to content

Commit f223373

Browse files
committed
chore: simplify declarations
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent d22a58e commit f223373

File tree

1 file changed

+7
-276
lines changed
  • lib/node_modules/@stdlib/array/base/zero-to/docs/types

1 file changed

+7
-276
lines changed

lib/node_modules/@stdlib/array/base/zero-to/docs/types/index.d.ts

Lines changed: 7 additions & 276 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Collection, AccessorArrayLike, Complex128Array, Complex64Array } from '@stdlib/types/array';
23+
import { Collection, AccessorArrayLike } from '@stdlib/types/array';
24+
25+
/**
26+
* Input array.
27+
*/
28+
type InputArray<T> = Collection<T> | AccessorArrayLike<T>;
2429

2530
/**
2631
* Interface describing `zeroTo`.
@@ -54,281 +59,7 @@ interface ZeroTo {
5459
* var arr = zeroTo.assign( out, 1, 0 );
5560
* // returns <Float64Array>[ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
5661
*/
57-
assign( out: Float64Array, stride: number, offset: number ): Float64Array;
58-
59-
/**
60-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
61-
*
62-
* @param out - output array
63-
* @param stride - output array stride
64-
* @param offset - output array index offset
65-
* @returns output array
66-
*
67-
* @example
68-
* var Float32Array = require( '@stdlib/array/float32' );
69-
*
70-
* var out = new Float32Array( 6 );
71-
*
72-
* var arr = zeroTo.assign( out, 1, 0 );
73-
* // returns <Float32Array>[ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
74-
*/
75-
assign( out: Float32Array, stride: number, offset: number ): Float32Array;
76-
77-
/**
78-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
79-
*
80-
* @param out - output array
81-
* @param stride - output array stride
82-
* @param offset - output array index offset
83-
* @returns output array
84-
*
85-
* @example
86-
* var Int32Array = require( '@stdlib/array/int32' );
87-
*
88-
* var out = new Int32Array( 6 );
89-
*
90-
* var arr = zeroTo.assign( out, 1, 0 );
91-
* // returns <Int32Array>[ 0, 1, 2, 3, 4, 5 ]
92-
*/
93-
assign( out: Int32Array, stride: number, offset: number ): Int32Array;
94-
95-
/**
96-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
97-
*
98-
* @param out - output array
99-
* @param stride - output array stride
100-
* @param offset - output array index offset
101-
* @returns output array
102-
*
103-
* @example
104-
* var Int16Array = require( '@stdlib/array/int16' );
105-
*
106-
* var out = new Int16Array( 6 );
107-
*
108-
* var arr = zeroTo.assign( out, 1, 0 );
109-
* // returns <Int16Array>[ 0, 1, 2, 3, 4, 5 ]
110-
*/
111-
assign( out: Int16Array, stride: number, offset: number ): Int16Array;
112-
113-
/**
114-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
115-
*
116-
* @param out - output array
117-
* @param stride - output array stride
118-
* @param offset - output array index offset
119-
* @returns output array
120-
*
121-
* @example
122-
* var Int8Array = require( '@stdlib/array/int8' );
123-
*
124-
* var out = new Int8Array( 6 );
125-
*
126-
* var arr = zeroTo.assign( out, 1, 0 );
127-
* // returns <Int8Array>[ 0, 1, 2, 3, 4, 5 ]
128-
*/
129-
assign( out: Int8Array, stride: number, offset: number ): Int8Array;
130-
131-
/**
132-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
133-
*
134-
* @param out - output array
135-
* @param stride - output array stride
136-
* @param offset - output array index offset
137-
* @returns output array
138-
*
139-
* @example
140-
* var Uint32Array = require( '@stdlib/array/uint32' );
141-
*
142-
* var out = new Uint32Array( 6 );
143-
*
144-
* var arr = zeroTo.assign( out, 1, 0 );
145-
* // returns <Uint32Array>[ 0, 1, 2, 3, 4, 5 ]
146-
*/
147-
assign( out: Uint32Array, stride: number, offset: number ): Uint32Array;
148-
149-
/**
150-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
151-
*
152-
* @param out - output array
153-
* @param stride - output array stride
154-
* @param offset - output array index offset
155-
* @returns output array
156-
*
157-
* @example
158-
* var Uint16Array = require( '@stdlib/array/uint16' );
159-
*
160-
* var out = new Uint16Array( 6 );
161-
*
162-
* var arr = zeroTo.assign( out, 1, 0 );
163-
* // returns <Uint16Array>[ 0, 1, 2, 3, 4, 5 ]
164-
*/
165-
assign( out: Uint16Array, stride: number, offset: number ): Uint16Array;
166-
167-
/**
168-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
169-
*
170-
* @param out - output array
171-
* @param stride - output array stride
172-
* @param offset - output array index offset
173-
* @returns output array
174-
*
175-
* @example
176-
* var Uint8Array = require( '@stdlib/array/uint8' );
177-
*
178-
* var out = new Uint8Array( 6 );
179-
*
180-
* var arr = zeroTo.assign( out, 1, 0 );
181-
* // returns <Uint8Array>[ 0, 1, 2, 3, 4, 5 ]
182-
*/
183-
assign( out: Uint8Array, stride: number, offset: number ): Uint8Array;
184-
185-
/**
186-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
187-
*
188-
* @param out - output array
189-
* @param stride - output array stride
190-
* @param offset - output array index offset
191-
* @returns output array
192-
*
193-
* @example
194-
* var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
195-
*
196-
* var out = new Uint8ClampedArray( 6 );
197-
*
198-
* var arr = zeroTo.assign( out, 1, 0 );
199-
* // returns <Uint8ClampedArray>[ 0, 1, 2, 3, 4, 5 ]
200-
*/
201-
assign( out: Uint8ClampedArray, stride: number, offset: number ): Uint8ClampedArray;
202-
203-
/**
204-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
205-
*
206-
* @param out - output array
207-
* @param stride - output array stride
208-
* @param offset - output array index offset
209-
* @returns output array
210-
*
211-
* @example
212-
* var Complex128Array = require( '@stdlib/array/complex128' );
213-
* var real = require( '@stdlib/complex/float64/real' );
214-
* var imag = require( '@stdlib/complex/float64/imag' );
215-
*
216-
* var out = new Complex128Array( 6 );
217-
*
218-
* var arr = zeroTo.assign( out, 1, 0 );
219-
* // returns <Complex128Array>
220-
*
221-
* var bool = ( arr === out );
222-
* // returns true
223-
*
224-
* var v = out.get( out.length-1 );
225-
* // returns <Complex128>
226-
*
227-
* var re = real( v );
228-
* // returns 5.0
229-
*
230-
* var im = imag( v );
231-
* // returns 0.0
232-
*/
233-
assign( out: Complex128Array, stride: number, offset: number ): Complex128Array;
234-
235-
/**
236-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
237-
*
238-
* @param out - output array
239-
* @param stride - output array stride
240-
* @param offset - output array index offset
241-
* @returns output array
242-
*
243-
* @example
244-
* var Complex64Array = require( '@stdlib/array/complex64' );
245-
* var realf = require( '@stdlib/complex/float32/real' );
246-
* var imagf = require( '@stdlib/complex/float32/imag' );
247-
*
248-
* var out = new Complex64Array( 6 );
249-
*
250-
* var arr = zeroTo.assign( out, 1, 0 );
251-
* // returns <Complex64Array>
252-
*
253-
* var bool = ( arr === out );
254-
* // returns true
255-
*
256-
* var v = out.get( out.length-1 );
257-
* // returns <Complex64>
258-
*
259-
* var re = realf( v );
260-
* // returns 5.0
261-
*
262-
* var im = imagf( v );
263-
* // returns 0.0
264-
*/
265-
assign( out: Complex64Array, stride: number, offset: number ): Complex64Array;
266-
267-
/**
268-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
269-
*
270-
* @param out - output array
271-
* @param stride - output array stride
272-
* @param offset - output array index offset
273-
* @returns output array
274-
*
275-
* @example
276-
* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
277-
*
278-
* var out = toAccessorArray( [ 0, 0, 0, 0, 0, 0 ] );
279-
* var arr = zeroTo.assign( out, 1, 0 );
280-
*
281-
* var bool = ( arr === out );
282-
* // returns true
283-
*
284-
* var v = out.get( out.length-1 );
285-
* // returns 5
286-
*/
287-
assign<T = unknown>( out: AccessorArrayLike<T>, stride: number, offset: number ): AccessorArrayLike<T>;
288-
289-
/**
290-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
291-
*
292-
* @param out - output array
293-
* @param stride - output array stride
294-
* @param offset - output array index offset
295-
* @returns output array
296-
*
297-
* @example
298-
* var out = [ 0, 0, 0, 0, 0, 0 ];
299-
*
300-
* var arr = zeroTo.assign( out, 1, 0 );
301-
* // returns [ 0, 1, 2, 3, 4, 5 ]
302-
*
303-
* @example
304-
* var out = [ 0, 0, 0, 0, 0, 0 ];
305-
*
306-
* var arr = zeroTo.assign( out, -1, out.length-1 );
307-
* // returns [ 5, 4, 3, 2, 1, 0 ]
308-
*/
309-
assign<T = unknown>( out: Array<T>, stride: number, offset: number ): Array<T | number>;
310-
311-
/**
312-
* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.
313-
*
314-
* @param out - output array
315-
* @param stride - output array stride
316-
* @param offset - output array index offset
317-
* @returns output array
318-
*
319-
* @example
320-
* var out = [ 0, 0, 0, 0, 0, 0 ];
321-
*
322-
* var arr = zeroTo.assign( out, 1, 0 );
323-
* // returns [ 0, 1, 2, 3, 4, 5 ]
324-
*
325-
* @example
326-
* var out = [ 0, 0, 0, 0, 0, 0 ];
327-
*
328-
* var arr = zeroTo.assign( out, -1, out.length-1 );
329-
* // returns [ 5, 4, 3, 2, 1, 0 ]
330-
*/
331-
assign<T = unknown>( out: Collection<T>, stride: number, offset: number ): Collection<T | number>;
62+
assign<T = unknown, U extends InputArray<T> = InputArray<T>>( out: U, stride: number, offset: number ): U;
33263
}
33364

33465
/**

0 commit comments

Comments
 (0)