Skip to content
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

ship typings with npm package #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Jun 29, 2023

Fixes #435

@voxpelli
Copy link

Shouldn't the wreck options be imported from that module rather than duplicated here?

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 26, 2023

@hapi/wreck ships with its typings.

Comment on lines +147 to +172
export interface WreckHttpOptions {
baseUrl?: string | undefined;
socketPath?: string | undefined;
payload?: unknown;
headers?: { [key: string]: unknown } | undefined;
redirects?: false | number | undefined;
redirect303?: boolean | undefined;
beforeRedirect?: ((
redirectMethod: string,
statusCode: number,
location: string,
resHeaders: { [key: string]: unknown },
redirectOptions: unknown,
next: () => {},
) => void) | undefined;
redirected?: ((statusCode: number, location: string, req: unknown) => void) | undefined;
timeout?: number | undefined;
maxBytes?: number | undefined;
rejectUnauthorized?: boolean | undefined;
agent?: unknown;
secureProtocol?: string | undefined;
ciphers?: string | undefined;
events?: boolean | undefined;
json?: boolean | "strict" | "force" | undefined;
gunzip?: boolean | "force" | undefined;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@voxpelli
Copy link

@hapi/wreck ships with its typings.

My bad, I remembered it as if @types/simple-oauth2 were referencing @hapi/wreck's types, but I see not that they didn't.

Still – since this module has @hapi/wreck as a dependency, a distinct advantage over @types/simple-oauth2 would be to make use of those types then :)

@jonathansamines
Copy link
Collaborator

Hey @Uzlopak thanks for these changes. I am not well versed in typescript typings, so I am inclined to merge your changes and publish a new major, and then refine if necessary. Any chance you could target these changes against develop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ship types with the npm package
3 participants