mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
extends lambda callback signature to accept primitive types (boolean, number and string) as result
This commit is contained in:
@@ -294,6 +294,9 @@ function callback(cb: AWSLambda.Callback) {
|
||||
cb(null);
|
||||
cb(error);
|
||||
cb(null, anyObj);
|
||||
cb(null, b);
|
||||
cb(null, str);
|
||||
cb(null, num);
|
||||
}
|
||||
|
||||
/* Proxy Callback */
|
||||
|
||||
Vendored
+2
-1
@@ -9,6 +9,7 @@
|
||||
// wwwy3y3 <https://github.com/wwwy3y3>
|
||||
// Ishaan Malhi <https://github.com/OrthoDex>
|
||||
// Daniel Cottone <https://github.com/daniel-cottone>
|
||||
// Kostya Misura <https://github.com/kostya-misura>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -364,7 +365,7 @@ export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Co
|
||||
* @param error – an optional parameter that you can use to provide results of the failed Lambda function execution.
|
||||
* @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible.
|
||||
*/
|
||||
export type Callback = (error?: Error | null, result?: object) => void;
|
||||
export type Callback = (error?: Error | null, result?: object | boolean | number | string) => void;
|
||||
export type ProxyCallback = (error?: Error | null, result?: ProxyResult) => void;
|
||||
export type CustomAuthorizerCallback = (error?: Error | null, result?: AuthResponse) => void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user