| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
TypeScript Bot (@typescript-bot) test this |
Sorry, something went wrong.
|
Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 2c47d31. You can monitor the build here. It should now contribute to this PR's status checks. |
Sorry, something went wrong.
(2) typescript 2.9 not allow symbol to be used as index. microsoft/TypeScript#1863. Current there is a PR open to address this issue microsoft/TypeScript#26797
|
Ryan Cavanaugh (@RyanCavanaugh) I see you marked this for TS 3.2. Is that still the plan? |
Sorry, something went wrong.
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
|
Heya Orta Therox (@orta), I've started to run the tarball bundle task on this PR at 05f63f6. You can monitor the build here. |
Sorry, something went wrong.
|
Hey Orta Therox (@orta), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so: {
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/98697/artifacts?artifactName=tgz&fileId=FCFFE06ACEDE5A9CF492C0B487ADB414731BE223F7CF66D693D5A513375E6B9102&fileName=/typescript-4.3.0-insiders.20210318.tgz"
}
}
and then running npm install. There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@4.3.0-pr-26797-61".; |
Sorry, something went wrong.
|
Hello, I found this PR and I am looking forward to its release. A question about this PR. type NumStr = `${number}`
type Obj = { [key: `${NumStr}`]: string }
const obj: Obj = {
"0xff": "", // OK
"100e10": "", // OK
"100": "", // NG, but why?
}
// Type '{ "0xff": string; "100e10": string; "100": string; }' is not assignable to type 'Obj'.
// Object literal may only specify known properties, and '"100"' does not exist in type 'Obj'. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Could this support optional indexers? This seems to work with the in operator but not the : operator. type OptionalKeyedType = {
[k in typeof ENUM[keyof typeof ENUM]]?: unknown;
};
interface DirectOptionalKeyed {
[k: typeof ENUM[keyof typeof ENUM]]?: unknown; // ';' expected.(1005)
}
|
Sorry, something went wrong.
|
Wesley Wigham (@weswigham) What's the status of this? The PR is still open and has the "Backlog" milestone, yet on the roadmap it's marked as done and already part of typescript@next. |
Sorry, something went wrong.
It's been superseded by #44512. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This allows, eg, symbol:
enums:
literal unions:
and generics:
as index signature parameter types.
Much of this functionality also exists in mapped types, except they had trouble shuffling around symbol information since there was no kind of index signature a symbol could map to. Unlike mapped types, however, since these are just index signatures, they can be added into any object type and in multiples.
Fixes #26470
Fixes #1863 (caveat: well-known symbols are not currently checked as part of a symbol index signature! Such checking should fall out from removing the concept of well-known symbols and using unique symbols instead)
Fixes #2491 in the original sense (rather than with mapped types).
Related: #28315