You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Continue where #74 left off by adding parameter and return
types to the rest of (non-ecmascript.ts) Temporal source files.
Also, turn on `noImplicitAny`. Except for calendar.ts, this PR
removes `any` (implicit or otherwise) from the polyfill, with only
a few exceptions for truly generic code or testing propeties on
`globalThis`.
For calendar.ts, `any` is removed from the top level `Calendar`
implementation and some of the `impl[]` code, but fully
declaring all types in that file was more work than I wanted to
take on in this PR. So I did an initial pass on obvious types and
assigned a lot of `any` for the rest. Will definitely need a followup
PR to improve calendar.ts. @12wrigja has discussed the possibility
of replacing the old-school inheritance using Object.apply with a
modern `class`-based implementation. If we're going to do that,
then it may make sense to fix the types then instead of on top of
the current solution.
Aside from calendar.ts, there's still lots of TS work remaining
(e.g. `strictNullChecks`, `strictPropertyInitialization`), but at least
we'll now have valid types on all functions.
I didn't find any runtime errors as a result of this work (good!) but I
did find quite a few problems with the public types in index.d.ts, and
this PR fixes those too. Once the dust settles and the changes are
reviewed, I can port a change back to proposal-temporal to keep
all public types in sync.
0 commit comments