Skip to content

Commit

Permalink
chore: exported public type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaba1 committed Jan 6, 2024
1 parent b9a10aa commit 4de135b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-sheep-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@jumba/lambda-utils": patch
---

exposed library types
8 changes: 4 additions & 4 deletions packages/lambda-utils/src/events.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { unmarshall } from "@aws-sdk/util-dynamodb";
import { DynamoDBStreamEvent } from "aws-lambda";

type CallbackContext<T> = {
export type CallbackContext<T> = {
oldImage: T;
newImage: T;
eventName: "INSERT" | "MODIFY" | "REMOVE" | undefined;
modelName: string | undefined;
eventSourceARN: string | undefined;
};

type Callback<T extends Record<string, unknown>> = (
export type Callback<T extends Record<string, unknown>> = (
args: CallbackContext<T>
) => void | Promise<void>;

type ModelName<T> = T extends { __typename: string }
export type ModelName<T> = T extends { __typename: string }
? T["__typename"]
: "ALL_MODELS" | Omit<string, "ALL_MODELS">;

type CallbackOptions = {
export type CallbackOptions = {
enabled?: boolean;
};

Expand Down

0 comments on commit 4de135b

Please sign in to comment.