Skip to content

Fix lots of minor type errors - #14

Merged
1egoman merged 6 commits into
mainfrom
fix-type-errors
Dec 1, 2025
Merged

Fix lots of minor type errors#14
1egoman merged 6 commits into
mainfrom
fix-type-errors

Conversation

@1egoman

@1egoman 1egoman commented Dec 1, 2025

Copy link
Copy Markdown
Collaborator

With these these minor type errors fixed, the initial LiveKit related bindgen output we're testing with no longer had any typescript build errors! 🎉

  • Fix type errors due to platform lookup not having all possible process.platform values
  • Fix number -> bigint incorrect types produced by ffi-rs (more info)
  • Address listError -> liftError typo
  • Work around a liftError logic oversight where liftError was returning a string, not an Error (more info)
  • Ignore FinalizationRegistry type errors since not all platforms implement this

The define(...) call types say a `number` is returned for u64s, when they
should actually be `bigint`. Since this obviously won't work (a u64 is
bigger than the largest `Number.MAX_SAFE_INTEGER`), I'm pretty sure this
has got to be an error in the typings.

I think this is probably worth digging more into at some point
(ie, is this actually a thing?), because if it isn't an error in
the typings, then it's possible there are cases where there would be data
loss sometimes due to truncation.
… be fed into UniffiError

I think I must be missing something from the react native bindgen, I
think it handles this in a much more elegant way where the error lift
step actually returns an Error subclass.

Anyway, this is also something else to look into longer term.
This isn't defined on all platforms and typescript complains, however
there's a guard for this in the code so the type error produced here
isn't all that actionable.
@1egoman
1egoman merged commit e23c552 into main Dec 1, 2025
2 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.

1 participant