We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b436c06 commit ab87dbbCopy full SHA for ab87dbb
docs/types/index-signatures.md
@@ -176,9 +176,10 @@ type FromIndex = { [k in Index]?: number }
176
177
const good: FromIndex = {b:1, c:2}
178
179
+// Error:
180
// Type '{ b: number; c: number; d: number; }' is not assignable to type 'FromIndex'.
181
// Object literal may only specify known properties, and 'd' does not exist in type 'FromIndex'.
-const bad: FromIndex = {b:1, c:2, d:3} //
182
+const bad: FromIndex = {b:1, c:2, d:3};
183
```
184
This is often used together with `keyof typeof` to capture vocabulary types, described on the next page.
185
0 commit comments