Skip to content

Commit

Permalink
Optional 2nd and 3rd params on CallBackFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
David Mesquita-Morris committed Apr 8, 2022
1 parent f473498 commit f8d52f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/node/functions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export declare type Constructor<TResult> = new (...args: Array<any>) => TResult;
/** A function that takes a variable number of arguments and returns a result. */
export declare type Function<TArgs, TResult> = (arg: TArgs) => TResult;
/** A function used in an array-oriented callback. */
export declare type CallbackFunction<TValue, TResult> = (value: TValue, index: number, source: Array<TValue>) => TResult;
export declare type CallbackFunction<TValue, TResult> = (value: TValue, index?: number, source?: Array<TValue>) => TResult;
/** A function that takes a variable number of arguments and returns a result. */
export declare type FunctionVA<TArgs, TResult> = (...args: Array<TArgs>) => TResult;
/** A function taking one argument and returning a boolean result. */
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steelbreeze/types",
"version": "1.0.0",
"version": "1.0.1",
"description": "Common TypeScript types used in development of other projects.",
"main": "./lib/node/index.js",
"types": "./lib/node/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type Constructor<TResult> = new (...args: Array<any>) => TResult;
export type Function<TArgs, TResult> = (arg: TArgs) => TResult;

/** A function used in an array-oriented callback. */
export type CallbackFunction<TValue, TResult> = (value: TValue, index: number, source: Array<TValue>) => TResult;
export type CallbackFunction<TValue, TResult> = (value: TValue, index?: number, source?: Array<TValue>) => TResult;

/** A function that takes a variable number of arguments and returns a result. */
export type FunctionVA<TArgs, TResult> = (...args: Array<TArgs>) => TResult;
Expand Down

0 comments on commit f8d52f0

Please sign in to comment.