Skip to content

Fix strict-mode errors in @transifex/api typings - #250

Open
pablotransifex wants to merge 1 commit into
masterfrom
fix/api-type-declarations
Open

pablotransifex wants to merge 1 commit into
masterfrom
fix/api-type-declarations

Conversation

@pablotransifex

@pablotransifex pablotransifex commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #249, fixes #232.

Two mistakes in packages/api/src/transifexApi.d.ts broke TypeScript projects that use strict without skipLibCheck:

  • extra(AnyDict) (static and on Collection) declared a parameter named AnyDict with no type, which raises TS7006 under noImplicitAny. It is now extra(params: AnyDict).
  • fetch(relationshipName, force) required force, so organization.fetch('projects'), as written in the README, raised TS2554. force is now optional, matching the runtime default.

Only the type declarations change; there is no runtime change.

Verification: I ran tsc --strict (TypeScript 5.6) on a sample that calls org.fetch('projects') and chains .extra(). On master it reports TS2554 and two TS7006 errors; with this change it passes.

extra() declared a parameter named AnyDict with no type, and fetch()
required its optional force argument.

Fixes #249, fixes #232
@pablotransifex
pablotransifex force-pushed the fix/api-type-declarations branch from ce9ecdf to 741b2b7 Compare November 11, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant