Skip to content

Commit

Permalink
feat(types): add function alias support (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
naorpeled authored Oct 12, 2024
1 parent 46fc4f0 commit 469b381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ interface Warmer {
* @param event the event passed to the lambda
* @param [config] the config options to change lambda warmer's default behavior. All of
* the settings are optional
* @param [context] the context passed to the lambda
*
* @returns a Promise that resolves to true if this is a warming invocation
*/
(event: any, config?: WarmerConfig): Promise<boolean>;
(event: any, config?: WarmerConfig, context?: any): Promise<boolean>;
WarmerConfig: WarmerConfig;
}

Expand Down
3 changes: 3 additions & 0 deletions types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import warmer from 'lambda-warmer';

warmer({});
warmer({}, {});
warmer({}, {}, {});
warmer({}, {
flag: 'some-flag',
concurrency: 10,
Expand All @@ -10,6 +11,8 @@ warmer({}, {
correlationId: 'some-id',
delay: 1000,
target: 'some-target',
}, {
invokedFunctionArn: 'some-arn'
});

// @ts-expect-error - params should be required
Expand Down

0 comments on commit 469b381

Please sign in to comment.