Suggestion
The ability to support using explicit types for exact array lengths with JSON data.
🔍 Search Terms
json exact matching array types
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
The ability to treat JSON arrays as exact arrays.
📃 Motivating Example
{"example": [1, 2, "three", 4]}importthingfrom'test.json';interfaceTest{example: [number,number,string,number];}exportconstexample: Test=thing;💻 Use Cases
This allows making more-specific rather than less-specific types. In the above example, the compiler will flag the declaration because a (number|string)[] does not match the specific type I provided.
Suggestion
The ability to support using explicit types for exact array lengths with JSON data.
🔍 Search Terms
json exact matching array types
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
The ability to treat JSON arrays as exact arrays.
📃 Motivating Example
{"example": [1, 2, "three", 4]}💻 Use Cases
This allows making more-specific rather than less-specific types. In the above example, the compiler will flag the declaration because a
(number|string)[]does not match the specific type I provided.