From 7cf52b947470b6057016fb3a00338e2e261f8397 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 | 22 +++++++++++++--- 2 files changed, 43 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 c10cfa560e2f..cf5720342aaf 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, 4, 5, 6 ]; +* +* 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 // 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 e7506a653627..5b0c38123844 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,23 @@ 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, 4, 5, 6 ]; +* +* var out = slice( x, 0, 3 ); +* // returns [ 1, 2, 3 ] +*/ +declare function slice( x: Collection, start: number, end: number ): Array; // EXPORTS //