cs2-inspect-lib
Version:
Enhanced CS2 Inspect URL library with full protobuf support, validation, and error handling
67 lines • 1.68 kB
TypeScript
/**
* Enhanced protobuf reader with error handling and validation
*/
import { EconItem, Sticker, CS2InspectConfig } from './types';
/**
* Enhanced protobuf reader with comprehensive error handling
*/
export declare class ProtobufReader {
private buffer;
private pos;
private view;
private config;
constructor(buffer: Uint8Array, config?: CS2InspectConfig);
/**
* Safely reads a varint with bounds checking
*/
readVarint(): number;
/**
* Safely reads a 64-bit varint
*/
readVarint64(): bigint;
/**
* Safely reads a signed 32-bit integer (ZigZag decoded)
*/
readSInt32(): number;
/**
* Safely reads a float value
*/
readFloat(): number;
/**
* Safely reads a string with length validation
*/
readString(): string;
/**
* Safely reads length-delimited bytes
*/
readBytes(): Uint8Array;
/**
* Safely reads and parses a protobuf tag
*/
readTag(): [number, number];
/**
* Safely skips a field based on wire type
*/
skipField(wireType: number): void;
/**
* Checks if there's more data to read
*/
hasMore(): boolean;
/**
* Gets current position for debugging
*/
getPosition(): number;
/**
* Gets remaining bytes count
*/
getRemainingBytes(): number;
/**
* Decodes a sticker from protobuf data
*/
static decodeSticker(reader: ProtobufReader): Sticker;
/**
* Decodes masked protobuf data into an EconItem
*/
static decodeMaskedData(hexData: string, config?: CS2InspectConfig): EconItem;
}
//# sourceMappingURL=protobuf-reader.d.ts.map