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 18, 2023
1 parent 5b60a40 commit ceabc3b
Showing 1 changed file with 6 additions and 6 deletions.
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';

/**
* Checks whether an element in a collection passes a test.
Expand All @@ -35,7 +35,7 @@ type Nullary = () => boolean;
* @param value - collection value
* @returns boolean indicating whether an element in a collection passes a test
*/
type Unary = ( value: any ) => boolean;
type Unary<T> = ( value: T ) => boolean;

/**
* Checks whether an element in a collection passes a test.
Expand All @@ -44,7 +44,7 @@ type Unary = ( value: any ) => boolean;
* @param index - collection index
* @returns boolean indicating whether an element in a collection passes a test
*/
type Binary = ( value: any, index: number ) => boolean;
type Binary<T> = ( value: T, index: number ) => boolean;

/**
* Checks whether an element in a collection passes a test.
Expand All @@ -54,7 +54,7 @@ type Binary = ( value: any, index: number ) => boolean;
* @param collection - input collection
* @returns boolean indicating whether an element in a collection passes a test
*/
type Ternary = ( value: any, index: number, collection: Collection ) => boolean;
type Ternary<T> = ( value: T, index: number, collection: Collection<T> ) => boolean;

/**
* Checks whether an element in a collection passes a test.
Expand All @@ -64,7 +64,7 @@ type Ternary = ( value: any, index: number, collection: Collection ) => boolean;
* @param collection - input collection
* @returns boolean indicating whether an element in a collection passes a test
*/
type Predicate = Nullary | Unary | Binary | Ternary;
type Predicate<T> = Nullary | Unary<T> | Binary<T> | Ternary<T>;

/**
* Tests whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.
Expand Down Expand Up @@ -96,7 +96,7 @@ type Predicate = Nullary | Unary | Binary | Ternary;
* var bool = noneByRight( arr, isPositive );
* // returns true
*/
declare function noneByRight( collection: Collection, predicate: Predicate, thisArg?: any ): boolean; // tslint-disable-line max-line-length
declare function noneByRight<T = unknown>( collection: Collection<T>, predicate: Predicate<T>, thisArg?: ThisParameterType<Predicate<T>> ): boolean;


// EXPORTS //
Expand Down

0 comments on commit ceabc3b

Please sign in to comment.