generated from garronej/ts-ci
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding deno distribution files and moving files from /dist to /
- Loading branch information
1 parent
733b496
commit 3352145
Showing
106 changed files
with
2,489 additions
and
201 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { AxiosInstance } from "axios"; | ||
import type { UnknownSharedRoute } from ".."; | ||
import { HandlerCreator } from ".."; | ||
import { ValidationOptions } from "../validations"; | ||
export declare const createAxiosHandlerCreator: <SharedRoutes extends Record<string, UnknownSharedRoute>>(axios: AxiosInstance, options?: ValidationOptions) => HandlerCreator<SharedRoutes>; | ||
export declare const createAxiosSharedClient: <SharedRoutes extends Record<string, UnknownSharedRoute>>(sharedRouters: SharedRoutes, axios: AxiosInstance, validationOptions?: ValidationOptions) => import("..").HttpClient<SharedRoutes>; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { createAxiosSharedClient } from "./createAxiosSharedClient"; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { z } from "zod"; | ||
import type { ResponsesToHttpResponse, SharedRoute, UnknownResponses, UnknownSharedRoute } from "./defineRoutes"; | ||
import { PathParameters, ReplaceParamsInUrl, Url } from "./pathParameters"; | ||
type EmptyObj = Record<string, never>; | ||
type AnyObj = Record<string, unknown>; | ||
export type HttpResponse<Status extends number | string | symbol, ResponseBody> = { | ||
status: Status; | ||
body: ResponseBody; | ||
headers: Record<string, unknown>; | ||
}; | ||
export type HandlerParams<SharedRoute extends UnknownSharedRoute> = (PathParameters<SharedRoute["url"]> extends EmptyObj ? AnyObj : { | ||
urlParams: PathParameters<SharedRoute["url"]>; | ||
}) & (z.infer<SharedRoute["requestBodySchema"]> extends void ? AnyObj : { | ||
body: z.infer<SharedRoute["requestBodySchema"]>; | ||
}) & (z.infer<SharedRoute["queryParamsSchema"]> extends void ? AnyObj : { | ||
queryParams: z.infer<SharedRoute["queryParamsSchema"]>; | ||
}) & (z.infer<SharedRoute["headersSchema"]> extends void ? AnyObj : { | ||
headers: z.infer<SharedRoute["headersSchema"]>; | ||
}); | ||
export type Handler<SharedRoute extends UnknownSharedRoute> = (params: HandlerParams<SharedRoute> | EmptyObj) => Promise<ResponsesToHttpResponse<SharedRoute["responses"]>>; | ||
export type HttpClient<SharedRoutes extends Record<string, UnknownSharedRoute>> = { | ||
[RouteName in keyof SharedRoutes]: (...params: [SharedRoutes[RouteName], PathParameters<SharedRoutes[RouteName]["url"]>] extends [SharedRoute<Url, void, void, UnknownResponses, void>, EmptyObj] ? [] : [HandlerParams<SharedRoutes[RouteName]>]) => Promise<ResponsesToHttpResponse<SharedRoutes[RouteName]["responses"]>>; | ||
}; | ||
export type HandlerCreator<SharedRoutes extends Record<string, UnknownSharedRoute>> = <R extends keyof SharedRoutes>(routeName: R, routes: SharedRoutes, replaceParamsInUrl: ReplaceParamsInUrl) => Handler<SharedRoutes[R]>; | ||
export declare const configureCreateHttpClient: <S extends Record<string, UnknownSharedRoute>>(handlerCreator: HandlerCreator<S>) => <SharedRoutes extends Record<string, UnknownSharedRoute>>(routes: SharedRoutes) => HttpClient<SharedRoutes>; | ||
export {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.