mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[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
This commit is contained in:
parent
18b8aa88d5
commit
9dc3b08389
1
types/ffi/index.d.ts
vendored
1
types/ffi/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/rbranson/node-ffi
|
||||
// Definitions by: Paul Loyd <https://github.com/loyd>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
5
types/ref-struct/index.d.ts
vendored
5
types/ref-struct/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/TooTallNate/ref-struct
|
||||
// Definitions by: Paul Loyd <https://github.com/loyd>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import ref = require('ref');
|
||||
|
||||
@ -50,9 +51,9 @@ interface StructType extends ref.Type {
|
||||
|
||||
/** The struct type meta-constructor. */
|
||||
declare var StructType: {
|
||||
new (fields?: {}): StructType;
|
||||
new (fields?: object, opt?: object): StructType;
|
||||
new (fields?: any[]): StructType;
|
||||
(fields?: {}): StructType;
|
||||
(fields?: object, opt?: object): StructType;
|
||||
(fields?: any[]): StructType;
|
||||
}
|
||||
|
||||
|
||||
12
types/ref-struct/ref-struct-tests.ts
Normal file
12
types/ref-struct/ref-struct-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
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});
|
||||
@ -17,6 +17,7 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
"index.d.ts",
|
||||
"ref-struct-tests.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user