From 7ab004b424fc6d0865a172dba0be1c930d2d1d61 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Mon, 19 Feb 2024 17:22:22 -0500 Subject: [PATCH] refactor: revert back to original signature for generic collections --- .../array/base/slice/docs/types/index.d.ts | 26 +++++++++++++++-- .../@stdlib/array/slice/docs/types/index.d.ts | 28 +++++++++++++++++-- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/array/base/slice/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/slice/docs/types/index.d.ts index c10cfa560e2..9db26c14a8f 100644 --- a/lib/node_modules/@stdlib/array/base/slice/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/base/slice/docs/types/index.d.ts @@ -20,7 +20,7 @@ /// -import { Collection, ComplexTypedArray } from '@stdlib/types/array'; +import { Collection, TypedArray, ComplexTypedArray } from '@stdlib/types/array'; /** * Returns a shallow copy of a portion of an array. @@ -46,7 +46,29 @@ import { Collection, ComplexTypedArray } from '@stdlib/types/array'; * var out = slice( x, 0, 3 ); * // returns [ 1.0, 2.0, 3.0 ] */ -declare function slice( x: T, start: number, end: number ): T; +declare function slice( x: T, start: number, end: number ): T; + +/** +* Returns a shallow copy of a portion of an array. +* +* @param x - input array +* @param start - starting index (inclusive) +* @param end - ending index (exclusive) +* @returns output array +* +* @example +* var x = [ 1, 2, 3 ]; +* +* var out = slice( x, 0, 3 ); +* // returns [ 1, 2, 3 ] +* +* @example +* var x = [ 1, 2, 3, 4, 5, 6 ]; +* +* var out = slice( x, 0, 2 ); +* // returns [ 1, 2 ] +*/ +declare function slice( x: Collection, start: number, end: number ): Array; // EXPORTS // diff --git a/lib/node_modules/@stdlib/array/slice/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/slice/docs/types/index.d.ts index e7506a65362..b21660e174a 100644 --- a/lib/node_modules/@stdlib/array/slice/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/slice/docs/types/index.d.ts @@ -20,7 +20,7 @@ /// -import { Collection, ComplexTypedArray } from '@stdlib/types/array'; +import { Collection, TypedArray, ComplexTypedArray } from '@stdlib/types/array'; /** * Returns a shallow copy of a portion of an array. @@ -35,7 +35,7 @@ import { Collection, ComplexTypedArray } from '@stdlib/types/array'; * * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* var out = slice( x ) +* var out = slice( x ); * // returns [ 1.0, 2.0, 3.0 ] * * @example @@ -46,7 +46,29 @@ import { Collection, ComplexTypedArray } from '@stdlib/types/array'; * var out = slice( x ); * // returns [ 1.0, 2.0, 3.0 ] */ -declare function slice( x: T, start?: number, end?: number ): T; +declare function slice( x: T, start?: number, end?: number ): T; + +/** +* Returns a shallow copy of a portion of an array. +* +* @param x - input array +* @param start - starting index (inclusive) +* @param end - ending index (exclusive) +* @returns output array +* +* @example +* var x = [ 1, 2, 3 ]; +* +* var out = slice( x ); +* // returns [ 1, 2, 3 ] +* +* @example +* var x = [ 1, 2, 3, 4, 5, 6 ]; +* +* var out = slice( x, 0, 2 ); +* // returns [ 1, 2 ] +*/ +declare function slice( x: Collection, start?: number, end?: number ): Array; // EXPORTS //