Open this example in the interactive library
Source code
type Events = {
start: { id: number };
finish: { ms: number };
failure: { reason: string };
};
console.log(((ms: Events["finish"]["ms"]) => ms / 1000)(250));
Sample output
0.25

Open this example in the interactive library
type Events = {
start: { id: number };
finish: { ms: number };
failure: { reason: string };
};
console.log(((ms: Events["finish"]["ms"]) => ms / 1000)(250));
0.25