Commit edcd742
committed
feat!: convert
This commit converts `Collection` to a generic in order to better
preserve type information. One example is when returning an element
from a collection and wanting to preserve the returned element's
type information. This change depends on default types, support
for which was added in TypeScript version 2.3, which is beyond the
current project support version of 2.0. Accordingly, this commit
increases the minimum TypeScript version and sets that version to
4.1, which should include most new TypeScript features that we
want to use in TypeScript declarations moving forward.
BREAKING CHANGE: `Collection` is now a generic
To migrate, users should upgrade their TypeScript version and
provide element type information when using the `Collection` type
(e.g., `Collection<number>`). By default, the element type is `any`
which is equivalent to previous behavior.Collection to generic1 parent 3628a1f commit edcd742
2 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
2399 | 2399 | | |
2400 | 2400 | | |
2401 | 2401 | | |
2402 | | - | |
| 2402 | + | |
2403 | 2403 | | |
2404 | | - | |
| 2404 | + | |
2405 | 2405 | | |
2406 | 2406 | | |
2407 | 2407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | | - | |
| 487 | + | |
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| |||
0 commit comments