DefinitelyTyped/types/ref-struct/ref-struct-tests.ts
Li Yin 9dc3b08389 [ref-struct]: add opt parameter to allow create packed struct (#21932)
* [ref-struct]: add opt parameter to allow create packed struct

* Set TypeScript version to 2.2 for package depending on ref-struct
2018-01-02 13:08:44 -08:00

13 lines
252 B
TypeScript

import ref = require("ref");
import StructType = require("ref-struct");
const normalStruct = StructType({
t: ref.types.uint8,
v: ref.types.long,
});
const packedStruct = StructType({
t: ref.types.uint8,
v: ref.types.long,
}, {packed: true});