2022-03-14 06:51:33 +00:00
|
|
|
/// <reference path="../../types/index.d.ts"/>
|
|
|
|
|
2022-03-03 08:35:39 +00:00
|
|
|
declare type RawData = Uint8Array | number[];
|
2022-03-14 06:51:33 +00:00
|
|
|
interface BinaryRecord {
|
|
|
|
n?: string;
|
|
|
|
f: any;
|
|
|
|
T?: -1 | 1;
|
|
|
|
p?: number;
|
|
|
|
r?: number;
|
|
|
|
}
|
|
|
|
declare function recordhopper(data: RawData, cb:(val: any, R: BinaryRecord, RT: number)=>void): void;
|
2022-03-03 08:35:39 +00:00
|
|
|
declare interface ReadableData {
|
|
|
|
l: number;
|
|
|
|
read_shift(t: 4): number;
|
|
|
|
read_shift(t: any): any;
|
|
|
|
}
|
|
|
|
declare type ParseFunc<T> = (data: ReadableData, length: number) => T;
|
|
|
|
declare var parse_XLWideString: ParseFunc<string>;
|
|
|
|
|
|
|
|
declare interface WritableData {
|
|
|
|
l: number;
|
|
|
|
write_shift(t: 4, val: number): void;
|
|
|
|
write_shift(t: number, val: string|number, f?: string): any;
|
|
|
|
}
|
|
|
|
declare type WritableRawData = WritableData & RawData;
|
|
|
|
interface BufArray {
|
|
|
|
end(): RawData;
|
|
|
|
next(sz: number): WritableData;
|
|
|
|
push(buf: RawData): void;
|
|
|
|
}
|
|
|
|
declare function buf_array(): BufArray;
|
2022-03-12 14:05:57 +00:00
|
|
|
declare function write_record(ba: BufArray, type: number, payload?: RawData, length?: number): void;
|
2022-03-03 08:35:39 +00:00
|
|
|
declare function new_buf(sz: number): RawData & WritableData & ReadableData;
|
|
|
|
|
|
|
|
declare var tagregex: RegExp;
|
|
|
|
declare var XML_HEADER: string;
|
|
|
|
declare var RELS: any;
|
|
|
|
declare function parsexmltag(tag: string, skip_root?: boolean, skip_LC?: boolean): object;
|
|
|
|
declare function strip_ns(x: string): string;
|
|
|
|
declare function write_UInt32LE(x: number, o?: WritableData): RawData;
|
|
|
|
declare function write_XLWideString(data: string, o?: WritableData): RawData;
|
|
|
|
declare function writeuint16(x: number): RawData;
|
|
|
|
|
2022-03-14 06:51:33 +00:00
|
|
|
declare function utf8read(x: string): string;
|
|
|
|
declare function a2s(a: RawData): string;
|
2022-03-03 08:35:39 +00:00
|
|
|
|
|
|
|
interface ParseXLMetaOptions {
|
|
|
|
WTF?: number|boolean;
|
|
|
|
}
|
|
|
|
interface XLMDT {
|
|
|
|
name: string;
|
2022-03-21 01:39:16 +00:00
|
|
|
offsets?: number[];
|
2022-03-03 08:35:39 +00:00
|
|
|
}
|
2022-03-14 06:51:33 +00:00
|
|
|
interface XLMetaRef {
|
|
|
|
type: string;
|
|
|
|
index: number;
|
|
|
|
}
|
2022-03-03 08:35:39 +00:00
|
|
|
interface XLMeta {
|
|
|
|
Types: XLMDT[];
|
2022-03-14 06:51:33 +00:00
|
|
|
Cell: XLMetaRef[];
|
|
|
|
Value: XLMetaRef[];
|
2022-03-03 08:35:39 +00:00
|
|
|
}
|