Skip to content

Commit

Permalink
type: fix Azure Function v4 Adapter HttpRequest and InvocationContext…
Browse files Browse the repository at this point in the history
… Type (#742)

* type: fix Azure Function v4 Adapter HttpRequest and Context Type

* type: fix remove unnecessary export types
  • Loading branch information
mildronize authored Jan 16, 2025
1 parent f6009bd commit 2f6de5a
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/convenience/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,23 @@ export type AzureAdapter = (context: {
[key: string]: any;
};
}, request: { body?: unknown }) => ReqResHandler;
export type AzureAdapterV4 = (request: Request, context: {
res?: {
status: number;
body: string;
headers?: Record<string, string>;
};
}) => ReqResHandler<{ status: number; body?: string } | { jsonBody: string }>;
type AzureV4HttpRequest = {
method: string;
url: string;
headers: any;
query: URLSearchParams;
body: any;
}
type AzureV4InvocationContext = {
invocationId: string;
functionName: string;
}
export type AzureAdapterV4 = (request: AzureV4HttpRequest, context: AzureV4InvocationContext) => ReqResHandler<{
status: number;
body?: string;
} | {
jsonBody: string;
}>;

export type BunAdapter = (request: {
headers: Headers;
Expand Down

0 comments on commit 2f6de5a

Please sign in to comment.