declare module 'structron' { type ReportOptions = { monitorUsage: boolean; }; class Report { constructor(buffer: BufferSource, options: ReportOptions); toString(): string; getUsage(): number; data: T; } interface ValueType { read(buffer: BufferSource, offset: number): T; SIZE: number; } type Rule = (...params: unknown[]) => (dataObj: unknown, buffer: BufferSource) => boolean; class Struct implements ValueType { constructor(name?: string); addMember(type: ValueType, name: string): this; addArray( type: ValueType, name: string, offsetMemberName: string, countMemberName: string, relative?: boolean ): this; addReference(type: ValueType, name: string, memberName: string, relative?: boolean): this; addRule(rule: Rule): this; read(buffer: BufferSource, offset: number, report?: Report): T; report(buffer: BufferSource, offset: number, options: Partial): Report; validate(buffer: BufferSource, offset?: number): boolean; getOffsetByName(name: string): number; get SIZE(): number; static RULES: { EQUAL: Rule; }; static TYPES: { INT: ValueType; INT_BE: ValueType; UINT: ValueType; UINT_BE: ValueType; SHORT: ValueType; SHORT_BE: ValueType; USHORT: ValueType; USHORT_BE: ValueType; FLOAT: ValueType; CHAR: ValueType; BYTE: ValueType; STRING(length: number, encoding: string | 'ascii'): ValueType; NULL_TERMINATED_STRING(encoding: string | 'ascii'): ValueType; SKIP(length: number): ValueType; }; } export = Struct; }