/// import { IFileInfo, IReadChunkOptions, ITokenizer } from './types'; import { IGetToken, IToken } from '@tokenizer/token'; export declare class BufferTokenizer implements ITokenizer { private buffer; fileInfo: IFileInfo; position: number; /** * Construct BufferTokenizer * @param buffer - Buffer to tokenize * @param fileInfo - Pass additional file information to the tokenizer */ constructor(buffer: Buffer, fileInfo?: IFileInfo); /** * Read buffer from tokenizer * @param buffer * @param options - Read behaviour options * @returns {Promise} */ readBuffer(buffer: Buffer | Uint8Array, options?: IReadChunkOptions): Promise; /** * Peek (read ahead) buffer from tokenizer * @param buffer * @param options - Read behaviour options * @returns {Promise} */ peekBuffer(buffer: Buffer | Uint8Array, options?: IReadChunkOptions): Promise; readToken(token: IGetToken, position?: number): Promise; peekToken(token: IGetToken, position?: number): Promise; readNumber(token: IToken): Promise; peekNumber(token: IToken): Promise; /** * @return actual number of bytes ignored */ ignore(length: number): Promise; close(): Promise; }