Files
DefinitelyTyped/types/lua-json/lua-json-tests.ts
2022-06-24 14:05:01 -07:00

10 lines
318 B
TypeScript

interface Example {
a: number;
b: number;
}
luajson.format({ a: 1, b: 2 }); // $ExpectType string
luajson.parse('return { a = 1, b = 2 }'); // $ExpectType object
luajson.parse('return { a = 1, b = 2 }') as Example; // $ExpectType Example
// @ts-expect-error
luajson.parse('return { a = 1, b = 2 }') as number;