Skip to content

Commit

Permalink
fix: update import path for Collection type definition
Browse files Browse the repository at this point in the history
Ref: bde4671
  • Loading branch information
kgryte committed Aug 17, 2023
1 parent b37aba2 commit 4230667
Show file tree
Hide file tree
Showing 31 changed files with 211 additions and 255 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type Senary<T, U> = ( value: T, idx: number, xi: number, yi: number, x: Collecti
* @returns accessed value
*/
type Callback<T, U> = Nullary | Unary<T> | Binary<T> | Ternary<T> | Quaternary<T> | Quinary<T> | Senary<T, U>;

/**
* Interface describing `absBy`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

import { Collection } from '@stdlib/types/object';
import { Collection } from '@stdlib/types/array';

/**
* Returns an accessed value.
Expand All @@ -35,7 +35,7 @@ type Nullary = () => number | void;
* @param value - array element
* @returns accessed value
*/
type Unary = ( value: any ) => number | void;
type Unary<T> = ( value: T ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -44,7 +44,7 @@ type Unary = ( value: any ) => number | void;
* @param idx - iteration index
* @returns accessed value
*/
type Binary = ( value: any, idx: number ) => number | void;
type Binary<T> = ( value: T, idx: number ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -54,7 +54,7 @@ type Binary = ( value: any, idx: number ) => number | void;
* @param xi - strided index (offsetX + idx*strideX)
* @returns accessed value
*/
type Ternary = ( value: any, idx: number, xi: number ) => number | void;
type Ternary<T> = ( value: T, idx: number, xi: number ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -65,8 +65,7 @@ type Ternary = ( value: any, idx: number, xi: number ) => number | void;
* @param yi - strided index (offsetY + idx*strideY)
* @returns accessed value
*/
type Quaternary = ( value: any, idx: number, xi: number, yi: number ) => number | void; // tslint-disable-line max-line-length

type Quaternary<T> = ( value: T, idx: number, xi: number, yi: number ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -77,8 +76,7 @@ type Quaternary = ( value: any, idx: number, xi: number, yi: number ) => number
* @param x - input array
* @returns accessed value
*/
type Quinary = ( value: any, idx: number, xi: number, yi: number, x: Collection ) => number | void; // tslint-disable-line max-line-length

type Quinary<T> = ( value: T, idx: number, xi: number, yi: number, x: Collection<T> ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -90,8 +88,7 @@ type Quinary = ( value: any, idx: number, xi: number, yi: number, x: Collection
* @param y - output array
* @returns accessed value
*/
type Senary = ( value: any, idx: number, xi: number, yi: number, x: Collection, y: Collection ) => number | void; // tslint-disable-line max-line-length

type Senary<T, U> = ( value: T, idx: number, xi: number, yi: number, x: Collection<T>, y: Collection<U> ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -103,7 +100,7 @@ type Senary = ( value: any, idx: number, xi: number, yi: number, x: Collection,
* @param y - output array
* @returns accessed value
*/
type Callback = Nullary | Unary | Binary | Ternary | Quaternary | Quinary | Senary; // tslint-disable-line max-line-length
type Callback<T, U> = Nullary | Unary<T> | Binary<T> | Ternary<T> | Quaternary<T> | Quinary<T> | Senary<T, U>;

/**
* Interface describing `abs2By`.
Expand Down Expand Up @@ -132,7 +129,7 @@ interface Routine {
* abs2By( x.length, x, 1, y, 1, accessor );
* // y => [ 1.0, 4.0, 9.0, 16.0, 25.0 ]
*/
( N: number, x: Collection, strideX: number, y: Collection, strideY: number, clbk: Callback, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
<T = unknown, U = unknown>( N: number, x: Collection<T>, strideX: number, y: Collection<U>, strideY: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<U | number>;

/**
* Computes the squared absolute value of each element retrieved from an input strided array `x` via a callback function and assigns each result to an element in an output strided array `y` using alternative indexing semantics.
Expand All @@ -159,7 +156,7 @@ interface Routine {
* abs2By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor );
* // y => [ 1.0, 4.0, 9.0, 16.0, 25.0 ]
*/
ndarray( N: number, x: Collection, strideX: number, offsetX: number, y: Collection, strideY: number, offsetY: number, clbk: Callback, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
ndarray<T = unknown, U = unknown>( N: number, x: Collection<T>, strideX: number, offsetX: number, y: Collection<U>, strideY: number, offsetY: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<U | number>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function accessor(): number {
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

abs2By( x.length, x, 1, y, 1, accessor ); // $ExpectType Collection
abs2By( x.length, x, 1, y, 1, accessor, {} ); // $ExpectType Collection
abs2By( x.length, x, 1, y, 1, accessor ); // $ExpectType Collection<number>
abs2By( x.length, x, 1, y, 1, accessor, {} ); // $ExpectType Collection<number>
}

// The compiler throws an error if the function is provided a first argument which is not a number...
Expand Down Expand Up @@ -143,8 +143,8 @@ function accessor(): number {
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

abs2By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // $ExpectType Collection
abs2By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor, {} ); // $ExpectType Collection
abs2By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // $ExpectType Collection<number>
abs2By.ndarray( x.length, x, 1, 0, y, 1, 0, accessor, {} ); // $ExpectType Collection<number>
}

// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

import { Collection } from '@stdlib/types/object';
import { Collection } from '@stdlib/types/array';

/**
* Returns an accessed value.
Expand All @@ -35,7 +35,7 @@ type Nullary = () => number | void;
* @param value - array element
* @returns accessed value
*/
type Unary = ( value: any ) => number | void;
type Unary<T> = ( value: T ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -44,7 +44,7 @@ type Unary = ( value: any ) => number | void;
* @param idx - iteration index
* @returns accessed value
*/
type Binary = ( value: any, idx: number ) => number | void;
type Binary<T> = ( value: T, idx: number ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -54,7 +54,7 @@ type Binary = ( value: any, idx: number ) => number | void;
* @param xi - strided index (offsetX + idx*strideX)
* @returns accessed value
*/
type Ternary = ( value: any, idx: number, xi: number ) => number | void;
type Ternary<T> = ( value: T, idx: number, xi: number ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -65,8 +65,7 @@ type Ternary = ( value: any, idx: number, xi: number ) => number | void;
* @param yi - strided index (offsetY + idx*strideY)
* @returns accessed value
*/
type Quaternary = ( value: any, idx: number, xi: number, yi: number ) => number | void; // tslint-disable-line max-line-length

type Quaternary<T> = ( value: T, idx: number, xi: number, yi: number ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -77,8 +76,7 @@ type Quaternary = ( value: any, idx: number, xi: number, yi: number ) => number
* @param x - input array
* @returns accessed value
*/
type Quinary = ( value: any, idx: number, xi: number, yi: number, x: Collection ) => number | void; // tslint-disable-line max-line-length

type Quinary<T> = ( value: T, idx: number, xi: number, yi: number, x: Collection<T> ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -90,8 +88,7 @@ type Quinary = ( value: any, idx: number, xi: number, yi: number, x: Collection
* @param y - output array
* @returns accessed value
*/
type Senary = ( value: any, idx: number, xi: number, yi: number, x: Collection, y: Collection ) => number | void; // tslint-disable-line max-line-length

type Senary<T, U> = ( value: T, idx: number, xi: number, yi: number, x: Collection<T>, y: Collection<U> ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -103,7 +100,7 @@ type Senary = ( value: any, idx: number, xi: number, yi: number, x: Collection,
* @param y - output array
* @returns accessed value
*/
type Callback = Nullary | Unary | Binary | Ternary | Quaternary | Quinary | Senary; // tslint-disable-line max-line-length
type Callback<T, U> = Nullary | Unary<T> | Binary<T> | Ternary<T> | Quaternary<T> | Quinary<T> | Senary<T, U>;

/**
* Interface describing `acosBy`.
Expand Down Expand Up @@ -132,7 +129,7 @@ interface Routine {
* acosBy( x.length, x, 1, y, 1, accessor );
* // y => [ 0.0, ~0.786, ~0.524, ~2.356, ~2.618 ]
*/
( N: number, x: Collection, strideX: number, y: Collection, strideY: number, clbk: Callback, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
<T = unknown, U = unknown>( N: number, x: Collection<T>, strideX: number, y: Collection<U>, strideY: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<U | number>;

/**
* Computes the arccosine of each element retrieved from an input strided array `x` via a callback function and assigns each result to an element in an output strided array `y` using alternative indexing semantics.
Expand All @@ -159,7 +156,7 @@ interface Routine {
* acosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor );
* // y => [ 0.0, ~0.786, ~0.524, ~2.356, ~2.618 ]
*/
ndarray( N: number, x: Collection, strideX: number, offsetX: number, y: Collection, strideY: number, offsetY: number, clbk: Callback, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
ndarray<T = unknown, U = unknown>( N: number, x: Collection<T>, strideX: number, offsetX: number, y: Collection<U>, strideY: number, offsetY: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<U | number>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function accessor(): number {
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

acosBy( x.length, x, 1, y, 1, accessor ); // $ExpectType Collection
acosBy( x.length, x, 1, y, 1, accessor, {} ); // $ExpectType Collection
acosBy( x.length, x, 1, y, 1, accessor ); // $ExpectType Collection<number>
acosBy( x.length, x, 1, y, 1, accessor, {} ); // $ExpectType Collection<number>
}

// The compiler throws an error if the function is provided a first argument which is not a number...
Expand Down Expand Up @@ -143,8 +143,8 @@ function accessor(): number {
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

acosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // $ExpectType Collection
acosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor, {} ); // $ExpectType Collection
acosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // $ExpectType Collection<number>
acosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor, {} ); // $ExpectType Collection<number>
}

// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

import { Collection } from '@stdlib/types/object';
import { Collection } from '@stdlib/types/array';

/**
* Returns an accessed value.
Expand All @@ -35,7 +35,7 @@ type Nullary = () => number | void;
* @param value - array element
* @returns accessed value
*/
type Unary = ( value: any ) => number | void;
type Unary<T> = ( value: T ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -44,7 +44,7 @@ type Unary = ( value: any ) => number | void;
* @param idx - iteration index
* @returns accessed value
*/
type Binary = ( value: any, idx: number ) => number | void;
type Binary<T> = ( value: T, idx: number ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -54,7 +54,7 @@ type Binary = ( value: any, idx: number ) => number | void;
* @param xi - strided index (offsetX + idx*strideX)
* @returns accessed value
*/
type Ternary = ( value: any, idx: number, xi: number ) => number | void;
type Ternary<T> = ( value: T, idx: number, xi: number ) => number | void;

/**
* Returns an accessed value.
Expand All @@ -65,8 +65,7 @@ type Ternary = ( value: any, idx: number, xi: number ) => number | void;
* @param yi - strided index (offsetY + idx*strideY)
* @returns accessed value
*/
type Quaternary = ( value: any, idx: number, xi: number, yi: number ) => number | void; // tslint-disable-line max-line-length

type Quaternary<T> = ( value: T, idx: number, xi: number, yi: number ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -77,8 +76,7 @@ type Quaternary = ( value: any, idx: number, xi: number, yi: number ) => number
* @param x - input array
* @returns accessed value
*/
type Quinary = ( value: any, idx: number, xi: number, yi: number, x: Collection ) => number | void; // tslint-disable-line max-line-length

type Quinary<T> = ( value: T, idx: number, xi: number, yi: number, x: Collection<T> ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -90,8 +88,7 @@ type Quinary = ( value: any, idx: number, xi: number, yi: number, x: Collection
* @param y - output array
* @returns accessed value
*/
type Senary = ( value: any, idx: number, xi: number, yi: number, x: Collection, y: Collection ) => number | void; // tslint-disable-line max-line-length

type Senary<T, U> = ( value: T, idx: number, xi: number, yi: number, x: Collection<T>, y: Collection<U> ) => number | void;
/**
* Returns an accessed value.
*
Expand All @@ -103,7 +100,7 @@ type Senary = ( value: any, idx: number, xi: number, yi: number, x: Collection,
* @param y - output array
* @returns accessed value
*/
type Callback = Nullary | Unary | Binary | Ternary | Quaternary | Quinary | Senary; // tslint-disable-line max-line-length
type Callback<T, U> = Nullary | Unary<T> | Binary<T> | Ternary<T> | Quaternary<T> | Quinary<T> | Senary<T, U>;

/**
* Interface describing `acoshBy`.
Expand Down Expand Up @@ -132,7 +129,7 @@ interface Routine {
* acoshBy( x.length, x, 1, y, 1, accessor );
* // y => [ 0.0, ~0.962, ~1.317, ~1.567, ~1.763 ]
*/
( N: number, x: Collection, strideX: number, y: Collection, strideY: number, clbk: Callback, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
<T = unknown, U = unknown>( N: number, x: Collection<T>, strideX: number, y: Collection<U>, strideY: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<U | number>;

/**
* Computes the hyperbolic arccosine of each element retrieved from an input strided array `x` via a callback function and assigns each result to an element in an output strided array `y` using alternative indexing semantics.
Expand All @@ -159,7 +156,7 @@ interface Routine {
* acoshBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor );
* // y => [ 0.0, ~0.962, ~1.317, ~1.567, ~1.763 ]
*/
ndarray( N: number, x: Collection, strideX: number, offsetX: number, y: Collection, strideY: number, offsetY: number, clbk: Callback, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
ndarray<T = unknown, U = unknown>( N: number, x: Collection<T>, strideX: number, offsetX: number, y: Collection<U>, strideY: number, offsetY: number, clbk: Callback<T, U>, thisArg?: ThisParameterType<Callback<T, U>> ): Collection<U | number>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function accessor(): number {
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

acoshBy( x.length, x, 1, y, 1, accessor ); // $ExpectType Collection
acoshBy( x.length, x, 1, y, 1, accessor, {} ); // $ExpectType Collection
acoshBy( x.length, x, 1, y, 1, accessor ); // $ExpectType Collection<number>
acoshBy( x.length, x, 1, y, 1, accessor, {} ); // $ExpectType Collection<number>
}

// The compiler throws an error if the function is provided a first argument which is not a number...
Expand Down Expand Up @@ -143,8 +143,8 @@ function accessor(): number {
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

acoshBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // $ExpectType Collection
acoshBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor, {} ); // $ExpectType Collection
acoshBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); // $ExpectType Collection<number>
acoshBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor, {} ); // $ExpectType Collection<number>
}

// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
Expand Down
Loading

1 comment on commit 4230667

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
math/strided/special/abs-by $\color{green}195/195$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}195/195$
$\color{green}+100.00\%$
math/strided/special/abs2-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/acos-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/acosh-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/acot-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/acoth-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/acovercos-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/acoversin-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/ahavercos-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/ahaversin-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/asin-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/asinh-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/atan-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/atanh-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/avercos-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$
math/strided/special/aversin-by $\color{green}197/197$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}197/197$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.