You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument of type '{ body: string; }' is not assignable to parameter of type 'APIGatewayProxyEvent'.
Type '{ body: string; }' is missing the following properties from type 'APIGatewayProxyEventBase<{ [name: string]: any; }>': headers, multiValueHeaders, httpMethod, isBase64Encoded, and 7 more.
The library merges the body with the template, so the user should be able to provide a deeply partial object.
The type definition should be:
// https://gist.github.com/navix/6c25c15e0a2d3cd0e5bce999e0086fc9
+ type DeepPartial<T> = T extends Function ? T : (T extends object ? { [P in keyof T]?: DeepPartial<T[P]>; } : T);
export default function createEvent<T extends keyof typeof dictionary, B>(
eventType: T,
- body: typeof dictionary[T],+ body: DeepPartial<typeof dictionary[T]>
): typeof dictionary[T];
The text was updated successfully, but these errors were encountered:
Current type definition for createEvent is this:
When accessing
Which gives the following error:
The library merges the body with the template, so the user should be able to provide a deeply partial object.
The type definition should be:
The text was updated successfully, but these errors were encountered: