Skip to content

Embed TypeScript type definitions into the package (#843)#847

Merged
cressie176 merged 7 commits into
mainfrom
feat/bundled-types
May 9, 2026
Merged

Embed TypeScript type definitions into the package (#843)#847
cressie176 merged 7 commits into
mainfrom
feat/bundled-types

Conversation

@cressie176

Copy link
Copy Markdown
Collaborator

Summary

  • Adds bundled .d.ts files (index.d.ts, callback_api.d.ts, lib/properties.d.ts) so TypeScript users get types automatically on install without needing @types/amqplib
  • Adds "types" and "exports" fields to package.json for correct type resolution
  • Fixes several bugs present in the DefinitelyTyped types: assertQueue queue name is now optional, Connection no longer exposes internal fields, Options.Connect gains channelMax and credentials, Options.AssertQueue gains overflow and queueMode, createChannel/createConfirmChannel accept optional ChannelOptions, and IllegalOperationError is now exported
  • Type-level tests in types/ verified by tsc --noEmit
  • typecheck script wired into CI and pre-commit hook

Closes #843

🤖 Generated with Claude Code

Adds bundled .d.ts files so TypeScript users get types automatically on
install without needing @types/amqplib. Includes type-level tests and
typecheck step in CI and pre-commit hook.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cressie176 cressie176 force-pushed the feat/bundled-types branch from 5ae6b55 to 0d3fe2c Compare May 6, 2026 10:57
cressie176 and others added 6 commits May 6, 2026 07:01
… types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…terfaces

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
More specific overloads must precede general ones in TypeScript — move the
recovery overload before the plain SocketOptions overload so it is correctly
selected when a user passes { recovery: ... } inline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cressie176 cressie176 merged commit e9aa30e into main May 9, 2026
4 checks passed
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.

Embed types into the package itself?

1 participant