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

Export useful types for end-users #889

Merged
merged 3 commits into from
Sep 23, 2019
Merged
Changes from 1 commit
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
40 changes: 40 additions & 0 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,43 @@ export default got;
// For CommonJS default export support
module.exports = got;
module.exports.default = got;

// Export types
export * from './utils/types';
export {
Got,
GotStream,
ReturnResponse,
ReturnStream,
GotReturn
} from './create';
export {
ProxyStream
sindresorhus marked this conversation as resolved.
Show resolved Hide resolved
sindresorhus marked this conversation as resolved.
Show resolved Hide resolved
} from './as-stream';
export {
GotError,
CacheError,
RequestError,
ParseError,
HTTPError,
MaxRedirectsError,
UnsupportedProtocolError,
TimeoutError,
CancelError
} from './errors';
export {
InitHook,
BeforeRequestHook,
BeforeRedirectHook,
BeforeRetryHook,
BeforeErrorHook,
AfterResponseHook,
HookType,
Hooks,
HookEvent
} from './known-hook-events';
export {
GetMethodRedirectCodes,
AllMethodRedirectCodes,
RequestAsEventEmitter
sindresorhus marked this conversation as resolved.
Show resolved Hide resolved
} from './request-as-event-emitter';