forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jbinary.d.ts
38 lines (28 loc) · 1.4 KB
/
jbinary.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Type definitions for jBinary
// Project: https://github.com/jDataView/jBinary
// Definitions by: Tim Bureck <https://github.com/tbureck>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Additional notes:
// Method stubs and types are taken from the official jBinary documentation, which can be found here:
// https://github.com/jDataView/jBinary/wiki/jBinary-Constructor
// https://github.com/jDataView/jBinary/wiki/jBinary-Methods
/// <reference path="../jdataview/jdataview.d.ts" />
declare class jBinary
{
static loadData(source:any, callback?: (error:string, data:any) => any):any;
static load(source:any, typeSet?:any, callback?: (error:string, data:any) => any):any;
static saveAs(destination:any, mimeType?:string, callback?: (error:string, data:any) => any):any;
static toURI(mimeType?:string):any;
constructor(data:Array<number>);
constructor(data:jDataView, typeSet:Object);
constructor(bufferSize:number, typeSet:Object);
read(type:string, offset?:number):any;
readAll():any;
write(type:string, data:any, offset?:number):number;
writeAll(data:any):number;
tell():number;
seek(position:number, callback?: (prop:jBinary, data:any) => any):number;
skip(count:number, callback?: (prop:jBinary, data:any) => any):number;
slice(start:number, end:number, forceCopy?:boolean):jBinary;
as(typeSet:Object, modifyOriginal?:boolean):jBinary;
}