Files
NapCatQQ/.pnpm-store/v3/files/15/0e6650d1b86d143c6340302dd03aba429628d8c83070f3e62453b336e273fda19a83af11550b13bd39adbbbe12f630afe941910f3d0aa451e1738916ba89cb
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

38 lines
1.5 KiB
Plaintext

import { AbstractTokenizer } from './AbstractTokenizer.js';
import type { IRandomAccessTokenizer, IRandomAccessFileInfo, IReadChunkOptions, ITokenizerOptions } from './types.js';
import { type FileHandle } from 'node:fs/promises';
interface IFileTokenizerOptions extends ITokenizerOptions {
/**
* Pass additional file information to the tokenizer
*/
fileInfo: IRandomAccessFileInfo;
}
export declare class FileTokenizer extends AbstractTokenizer implements IRandomAccessTokenizer {
private fileHandle;
fileInfo: IRandomAccessFileInfo;
/**
* Create tokenizer from provided file path
* @param sourceFilePath File path
*/
static fromFile(sourceFilePath: string): Promise<FileTokenizer>;
protected constructor(fileHandle: FileHandle, options: IFileTokenizerOptions);
/**
* Read buffer from file
* @param uint8Array - Uint8Array to write result to
* @param options - Read behaviour options
* @returns Promise number of bytes read
*/
readBuffer(uint8Array: Uint8Array, options?: IReadChunkOptions): Promise<number>;
/**
* Peek buffer from file
* @param uint8Array - Uint8Array (or Buffer) to write data to
* @param options - Read behaviour options
* @returns Promise number of bytes read
*/
peekBuffer(uint8Array: Uint8Array, options?: IReadChunkOptions): Promise<number>;
close(): Promise<void>;
setPosition(position: number): void;
supportsRandomAccess(): boolean;
}
export {};