Skip to content

ship typings with npm package#436

Open
Uzlopak wants to merge 1 commit into
lelylan:masterfrom
Uzlopak:ship-types
Open

ship typings with npm package#436
Uzlopak wants to merge 1 commit into
lelylan:masterfrom
Uzlopak:ship-types

Conversation

@Uzlopak
Copy link
Copy Markdown
Contributor

@Uzlopak Uzlopak commented Jun 29, 2023

Fixes #435

@voxpelli
Copy link
Copy Markdown

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

@Uzlopak
Copy link
Copy Markdown
Contributor Author

Uzlopak commented Aug 26, 2023

@hapi/wreck ships with its typings.

Comment thread types/index.d.ts
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;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@voxpelli
Copy link
Copy Markdown

@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
Copy Markdown
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