Skip to content

Commit

Permalink
starting to remove types imported from aws-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeseda committed Feb 1, 2024
1 parent 653db73 commit 004179d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ coverage/
dist.js
scratch/
src/http/get-index
types/
22 changes: 18 additions & 4 deletions types/events.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { SNS, SQS } from "aws-sdk";
import { Callback } from "./util";

// Turn off automatic exporting
export { };
export {};

// import { PublishResponse } from "@aws-sdk/client-sns"; // @3.503.1
interface PublishResponse {
MessageId?: string;
SequenceNumber?: string;
}

// import { SendMessageResult } from "@aws-sdk/client-sqs"; // @3.503.1
interface SendMessageResult {
MD5OfMessageBody?: string;
MD5OfMessageAttributes?: string;
MD5OfMessageSystemAttributes?: string;
MessageId?: string;
SequenceNumber?: string;
}

interface Params<Payload> {
name: string;
Expand All @@ -26,5 +40,5 @@ interface EventsOrQueues<PublishResult> {
): LambdaFunction;
}

export type ArcEvents = EventsOrQueues<SNS.Types.PublishResponse>;
export type ArcQueues = EventsOrQueues<SQS.Types.SendMessageResult>;
export type ArcEvents = EventsOrQueues<PublishResponse>;
export type ArcQueues = EventsOrQueues<SendMessageResult>;
2 changes: 1 addition & 1 deletion types/http.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
APIGatewayProxyEvent,
Context,
APIGatewayProxyResult,
} from "aws-lambda";
} from "aws-lambda"; // from @types/aws-lambda
import { Callback } from "./util";

// Turn off automatic exporting
Expand Down
12 changes: 6 additions & 6 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/// <reference types="node" />

import { ArcEvents, ArcQueues } from "./events";
import { ArcHTTP, HttpHandler, HttpAsyncHandler } from "./http";
import { ArcStatic } from "./static";
import { ArcWebSocket } from "./ws";
import { ArcEvents, ArcQueues } from "./events";
import { ArcTables } from "./tables";
import { ArcWebSocket } from "./ws";

export type { HttpHandler, HttpAsyncHandler };
export type ArcServices = () => Promise<Record<string, any>>;

export const http: ArcHTTP;
export const static: ArcStatic;
export const ws: ArcWebSocket;
export const services: ArcServices;
export const events: ArcEvents;
export const http: ArcHTTP;
export const queues: ArcQueues;
export const services: ArcServices;
export const static: ArcStatic;
export const tables: ArcTables;
export const ws: ArcWebSocket;

0 comments on commit 004179d

Please sign in to comment.