'Literal values in object type inference
This is quite verbose:
interface Point {
x: 1;
y: 2;
}
const point: Point = {
x: 1,
y: 2,
};
// The inferred type would have been
// { x: number; y: number; }
Is there any way to use type inference here but to force values to be literals?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
