Repository navigation
fix(types): export the helper types from the package root (#105) - #183
Merged
ccampbell-aai merged 1 commit intoSep 19, 2026
Merged
Conversation
A downstream TypeScript package that exports a value typed by
`Transcript.language_code`, `TranscriptParams.language_code` or
`SyncSpeechModel` fails its declaration emit with
TS2742: The inferred type of 'x' cannot be named without a reference
to 'assemblyai/dist/types/helpers'. This is likely not portable.
Those fields are declared with `LiteralUnion<...>` from `types/helpers`,
and the main entry did not re-export that module: only the `./streaming`
entry did. The `exports` map does not expose `dist/types/helpers`, so
TypeScript had no portable way to spell the type and gave up.
`src/types/index.ts` now re-exports `./helpers`, so the type is nameable
as `import("assemblyai").LiteralUnion<...>`. No runtime change. A unit
test names the affected types through the package root; if the re-export
goes, the test file stops compiling. Reproduced and re-checked with a
downstream `tsc --declaration` build against the published 4.41.1 and
against this tree: the error appears on 4.41.1 and is gone here.
Fixes AssemblyAI#105
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kosesena
force-pushed
the
fix/105-export-helper-types
branch
from
September 17, 2026 19:06
9e3d106 to
a3c17a9
Compare
ccampbell-aai
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #105.
The failure
A downstream TypeScript package that exports a value typed by
Transcript.language_code,TranscriptParams.language_codeorSyncSpeechModelfails its declaration emit:Those fields are declared with
LiteralUnion<...>fromsrc/types/helpers. The main entry never re-exported that module (only the./streamingentry does), anddist/types/helpersis not in theexportsmap, so TypeScript has no portable way to spell the type and gives up.The fix
src/types/index.tsre-exports./helpers, so the type is nameable asimport("assemblyai").LiteralUnion<...>. One line; no runtime change.Checked
tsc --declaration --emitDeclarationOnly,moduleResolution: NodeNext): TS2742 on two exports. Against this branch's build: clean, and the emitted.d.tsreadsimport("assemblyai").LiteralUnion<import("assemblyai").TranscriptLanguageCode, string>.tests/unit/exports.test.tsnames the affected types through the package root; if the re-export goes, the file stops compiling.pnpm format(no changes),pnpm lint(eslint, tsc, prettier, publint) andpnpm buildpass.pnpm test:unit: 337 pass; the threeutilsuser-agent tests fail identically onmainwithout this change.🤖 Generated with Claude Code