Skip to content

fix #1638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

fix #1638

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/openapi-fetch/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
PathsWithMethod,
ResponseObjectMap,
SuccessResponse,
Unpacked,
} from "openapi-typescript-helpers";

/** Options for each client instance */
Expand Down Expand Up @@ -166,7 +167,7 @@ export type ClientMethod<Paths extends Record<string, PathMethods>, M extends Ht
I extends MaybeOptionalInit<Paths[P], M>,
>(
url: P,
...init: I
init: Unpacked<I>,
) => Promise<FetchResponse<Paths[P][M], I[0], Media>>;

export default function createClient<Paths extends {}, Media extends MediaType = MediaType>(
Expand Down
2 changes: 2 additions & 0 deletions packages/openapi-typescript-helpers/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ export type JSONLike<T> = FilterKeys<T, `${string}/json`>;
export type FindRequiredKeys<T, K extends keyof T> = K extends unknown ? (undefined extends T[K] ? never : K) : K;
/** Does this object contain required keys? */
export type HasRequiredKeys<T> = FindRequiredKeys<T, keyof T>;
/**Extract a type from an array */
export type Unpacked<T> = T extends (infer U)[] ? U : T;
Loading