Skip to content

Commit 5322117

Browse files
committed
Auto-generated commit
1 parent b311738 commit 5322117

File tree

2 files changed

+4
-374
lines changed

2 files changed

+4
-374
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,7 @@ A total of 44 issues were closed in this release:
807807

808808
<details>
809809

810+
- [`f759b2b`](https://github.com/stdlib-js/stdlib/commit/f759b2b5ed4db16f35f0544fb65ed38a957f9f7b) - **refactor:** remove overloads and use generic _(by Athan Reines)_
810811
- [`e00d73a`](https://github.com/stdlib-js/stdlib/commit/e00d73a3cb8c5355a46771ed5630d178e25ec0f4) - **feat:** add `onesLike` to namespace _(by Athan Reines)_
811812
- [`d200536`](https://github.com/stdlib-js/stdlib/commit/d200536a79672d3a31022f894a63acdf08b79159) - **feat:** add `ndarray/base/ones-like` _(by Athan Reines)_
812813
- [`60e78d4`](https://github.com/stdlib-js/stdlib/commit/60e78d484b31ca96b47f36c260db2620bd40f555) - **docs:** update `ndarray` TypeScript declarations [(#11132)](https://github.com/stdlib-js/stdlib/pull/11132) _(by stdlib-bot)_

base/zeros-like/docs/types/index.d.ts

Lines changed: 3 additions & 374 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

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

23-
import { typedndarray, float64ndarray, float32ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, genericndarray, complex128ndarray, complex64ndarray } from '@stdlib/types/ndarray';
23+
import { ComplexLike } from '@stdlib/types/complex';
24+
import { typedndarray } from '@stdlib/types/ndarray';
2425

2526
/**
2627
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
@@ -51,379 +52,7 @@ import { typedndarray, float64ndarray, float32ndarray, int32ndarray, int16ndarra
5152
* dt = String( getDType( y ) );
5253
* // returns 'float64'
5354
*/
54-
declare function zerosLike( x: float64ndarray ): float64ndarray;
55-
56-
/**
57-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
58-
*
59-
* @param x - input array
60-
* @returns zero-filled array
61-
*
62-
* @example
63-
* var getShape = require( '@stdlib/ndarray/shape' );
64-
* var getDType = require( '@stdlib/ndarray/dtype' );
65-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
66-
*
67-
* var x = zeros( 'float32', [ 2, 2 ], 'row-major' );
68-
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
69-
*
70-
* var sh = getShape( x );
71-
* // returns [ 2, 2 ]
72-
*
73-
* var dt = String( getDType( x ) );
74-
* // returns 'float32'
75-
*
76-
* var y = zerosLike( x );
77-
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
78-
*
79-
* sh = getShape( y );
80-
* // returns [ 2, 2 ]
81-
*
82-
* dt = String( getDType( y ) );
83-
* // returns 'float32'
84-
*/
85-
declare function zerosLike( x: float32ndarray ): float32ndarray;
86-
87-
/**
88-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
89-
*
90-
* @param x - input array
91-
* @returns zero-filled array
92-
*
93-
* @example
94-
* var getShape = require( '@stdlib/ndarray/shape' );
95-
* var getDType = require( '@stdlib/ndarray/dtype' );
96-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
97-
*
98-
* var x = zeros( 'complex128', [ 2, 2 ], 'row-major' );
99-
* // returns <ndarray>
100-
*
101-
* var sh = getShape( x );
102-
* // returns [ 2, 2 ]
103-
*
104-
* var dt = String( getDType( x ) );
105-
* // returns 'complex128'
106-
*
107-
* var y = zerosLike( x );
108-
* // returns <ndarray>
109-
*
110-
* sh = getShape( y );
111-
* // returns [ 2, 2 ]
112-
*
113-
* dt = String( getDType( y ) );
114-
* // returns 'complex128'
115-
*/
116-
declare function zerosLike( x: complex128ndarray ): complex128ndarray;
117-
118-
/**
119-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
120-
*
121-
* @param x - input array
122-
* @returns zero-filled array
123-
*
124-
* @example
125-
* var getShape = require( '@stdlib/ndarray/shape' );
126-
* var getDType = require( '@stdlib/ndarray/dtype' );
127-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
128-
*
129-
* var x = zeros( 'complex64', [ 2, 2 ], 'row-major' );
130-
* // returns <ndarray>
131-
*
132-
* var sh = getShape( x );
133-
* // returns [ 2, 2 ]
134-
*
135-
* var dt = String( getDType( x ) );
136-
* // returns 'complex64'
137-
*
138-
* var y = zerosLike( x );
139-
* // returns <ndarray>
140-
*
141-
* sh = getShape( y );
142-
* // returns [ 2, 2 ]
143-
*
144-
* dt = String( getDType( y ) );
145-
* // returns 'complex64'
146-
*/
147-
declare function zerosLike( x: complex64ndarray ): complex64ndarray;
148-
149-
/**
150-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
151-
*
152-
* @param x - input array
153-
* @returns zero-filled array
154-
*
155-
* @example
156-
* var getShape = require( '@stdlib/ndarray/shape' );
157-
* var getDType = require( '@stdlib/ndarray/dtype' );
158-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
159-
*
160-
* var x = zeros( 'int32', [ 2, 2 ], 'row-major' );
161-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
162-
*
163-
* var sh = getShape( x );
164-
* // returns [ 2, 2 ]
165-
*
166-
* var dt = String( getDType( x ) );
167-
* // returns 'int32'
168-
*
169-
* var y = zerosLike( x );
170-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
171-
*
172-
* sh = getShape( y );
173-
* // returns [ 2, 2 ]
174-
*
175-
* dt = String( getDType( y ) );
176-
* // returns 'int32'
177-
*/
178-
declare function zerosLike( x: int32ndarray ): int32ndarray;
179-
180-
/**
181-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
182-
*
183-
* @param x - input array
184-
* @returns zero-filled array
185-
*
186-
* @example
187-
* var getShape = require( '@stdlib/ndarray/shape' );
188-
* var getDType = require( '@stdlib/ndarray/dtype' );
189-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
190-
*
191-
* var x = zeros( 'int16', [ 2, 2 ], 'row-major' );
192-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
193-
*
194-
* var sh = getShape( x );
195-
* // returns [ 2, 2 ]
196-
*
197-
* var dt = String( getDType( x ) );
198-
* // returns 'int16'
199-
*
200-
* var y = zerosLike( x );
201-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
202-
*
203-
* sh = getShape( y );
204-
* // returns [ 2, 2 ]
205-
*
206-
* dt = String( getDType( y ) );
207-
* // returns 'int16'
208-
*/
209-
declare function zerosLike( x: int16ndarray ): int16ndarray;
210-
211-
/**
212-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
213-
*
214-
* @param x - input array
215-
* @returns zero-filled array
216-
*
217-
* @example
218-
* var getShape = require( '@stdlib/ndarray/shape' );
219-
* var getDType = require( '@stdlib/ndarray/dtype' );
220-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
221-
*
222-
* var x = zeros( 'int8', [ 2, 2 ], 'row-major' );
223-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
224-
*
225-
* var sh = getShape( x );
226-
* // returns [ 2, 2 ]
227-
*
228-
* var dt = String( getDType( x ) );
229-
* // returns 'int8'
230-
*
231-
* var y = zerosLike( x );
232-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
233-
*
234-
* sh = getShape( y );
235-
* // returns [ 2, 2 ]
236-
*
237-
* dt = String( getDType( y ) );
238-
* // returns 'int8'
239-
*/
240-
declare function zerosLike( x: int8ndarray ): int8ndarray;
241-
242-
/**
243-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
244-
*
245-
* @param x - input array
246-
* @returns zero-filled array
247-
*
248-
* @example
249-
* var getShape = require( '@stdlib/ndarray/shape' );
250-
* var getDType = require( '@stdlib/ndarray/dtype' );
251-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
252-
*
253-
* var x = zeros( 'uint32', [ 2, 2 ], 'row-major' );
254-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
255-
*
256-
* var sh = getShape( x );
257-
* // returns [ 2, 2 ]
258-
*
259-
* var dt = String( getDType( x ) );
260-
* // returns 'uint32'
261-
*
262-
* var y = zerosLike( x );
263-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
264-
*
265-
* sh = getShape( y );
266-
* // returns [ 2, 2 ]
267-
*
268-
* dt = String( getDType( y ) );
269-
* // returns 'uint32'
270-
*/
271-
declare function zerosLike( x: uint32ndarray ): uint32ndarray;
272-
273-
/**
274-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
275-
*
276-
* @param x - input array
277-
* @returns zero-filled array
278-
*
279-
* @example
280-
* var getShape = require( '@stdlib/ndarray/shape' );
281-
* var getDType = require( '@stdlib/ndarray/dtype' );
282-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
283-
*
284-
* var x = zeros( 'uint16', [ 2, 2 ], 'row-major' );
285-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
286-
*
287-
* var sh = getShape( x );
288-
* // returns [ 2, 2 ]
289-
*
290-
* var dt = String( getDType( x ) );
291-
* // returns 'uint16'
292-
*
293-
* var y = zerosLike( x );
294-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
295-
*
296-
* sh = getShape( y );
297-
* // returns [ 2, 2 ]
298-
*
299-
* dt = String( getDType( y ) );
300-
* // returns 'uint16'
301-
*/
302-
declare function zerosLike( x: uint16ndarray ): uint16ndarray;
303-
304-
/**
305-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
306-
*
307-
* @param x - input array
308-
* @returns zero-filled array
309-
*
310-
* @example
311-
* var getShape = require( '@stdlib/ndarray/shape' );
312-
* var getDType = require( '@stdlib/ndarray/dtype' );
313-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
314-
*
315-
* var x = zeros( 'uint8', [ 2, 2 ], 'row-major' );
316-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
317-
*
318-
* var sh = getShape( x );
319-
* // returns [ 2, 2 ]
320-
*
321-
* var dt = String( getDType( x ) );
322-
* // returns 'uint8'
323-
*
324-
* var y = zerosLike( x );
325-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
326-
*
327-
* sh = getShape( y );
328-
* // returns [ 2, 2 ]
329-
*
330-
* dt = String( getDType( y ) );
331-
* // returns 'uint8'
332-
*/
333-
declare function zerosLike( x: uint8ndarray ): uint8ndarray;
334-
335-
/**
336-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
337-
*
338-
* @param x - input array
339-
* @returns zero-filled array
340-
*
341-
* @example
342-
* var getShape = require( '@stdlib/ndarray/shape' );
343-
* var getDType = require( '@stdlib/ndarray/dtype' );
344-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
345-
*
346-
* var x = zeros( 'uint8c', [ 2, 2 ], 'row-major' );
347-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
348-
*
349-
* var sh = getShape( x );
350-
* // returns [ 2, 2 ]
351-
*
352-
* var dt = String( getDType( x ) );
353-
* // returns 'uint8c'
354-
*
355-
* var y = zerosLike( x );
356-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
357-
*
358-
* sh = getShape( y );
359-
* // returns [ 2, 2 ]
360-
*
361-
* dt = String( getDType( y ) );
362-
* // returns 'uint8c'
363-
*/
364-
declare function zerosLike( x: uint8cndarray ): uint8cndarray;
365-
366-
/**
367-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
368-
*
369-
* @param x - input array
370-
* @returns zero-filled array
371-
*
372-
* @example
373-
* var getShape = require( '@stdlib/ndarray/shape' );
374-
* var getDType = require( '@stdlib/ndarray/dtype' );
375-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
376-
*
377-
* var x = zeros( 'generic', [ 2, 2 ], 'row-major' );
378-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
379-
*
380-
* var sh = getShape( x );
381-
* // returns [ 2, 2 ]
382-
*
383-
* var dt = String( getDType( x ) );
384-
* // returns 'generic'
385-
*
386-
* var y = zerosLike( x );
387-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
388-
*
389-
* sh = getShape( y );
390-
* // returns [ 2, 2 ]
391-
*
392-
* dt = String( getDType( y ) );
393-
* // returns 'generic'
394-
*/
395-
declare function zerosLike( x: genericndarray<any> ): genericndarray<number>;
396-
397-
/**
398-
* Creates a zero-filled array having the same shape and data type as a provided input ndarray.
399-
*
400-
* @param x - input array
401-
* @returns zero-filled array
402-
*
403-
* @example
404-
* var getShape = require( '@stdlib/ndarray/shape' );
405-
* var getDType = require( '@stdlib/ndarray/dtype' );
406-
* var zeros = require( '@stdlib/ndarray/base/zeros' );
407-
*
408-
* var x = zeros( 'generic', [ 2, 2 ], 'row-major' );
409-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
410-
*
411-
* var sh = getShape( x );
412-
* // returns [ 2, 2 ]
413-
*
414-
* var dt = String( getDType( x ) );
415-
* // returns 'generic'
416-
*
417-
* var y = zerosLike( x );
418-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
419-
*
420-
* sh = getShape( y );
421-
* // returns [ 2, 2 ]
422-
*
423-
* dt = String( getDType( y ) );
424-
* // returns 'generic'
425-
*/
426-
declare function zerosLike( x: typedndarray<number> ): typedndarray<number>;
55+
declare function zerosLike<T extends typedndarray<number | ComplexLike>>( x: T ): T;
42756

42857

42958
// EXPORTS //

0 commit comments

Comments
 (0)