nufatfs
Version:
A new async-friendly library for accessing FAT16 and FAT32 filesystems
36 lines • 1.27 kB
TypeScript
export interface ChainLink {
length: number;
write?(data: Uint8Array): Promise<void>;
read(): Promise<Uint8Array>;
}
export declare class ChainError extends Error {
}
export type LinkAllocator<T> = (lastChainLink: T | null, bytes: number) => Promise<T[]>;
export declare class Chain<T extends ChainLink> {
protected _links: T[];
protected allocateLink?: LinkAllocator<T> | undefined;
protected readLimitSize?: number | undefined;
private currentLink?;
private linkSubCursor?;
private _cursor;
private linkIndex;
private writable;
private totalLength;
private set cursor(value);
private get cursor();
tell(): number;
getTotalLength(): number;
get links(): T[];
constructor(_links: T[], allocateLink?: LinkAllocator<T> | undefined, readLimitSize?: number | undefined);
length(): number;
seek(to: number, whence?: 'start' | 'cur' | 'end'): Promise<void>;
read(count: number): Promise<Uint8Array>;
readAll(): Promise<Uint8Array>;
flushChanges(): Promise<void>;
private writingBuffer;
private isNewByteArray;
private flushWritingBuffer;
write(data: Uint8Array): Promise<void>;
private cacheCurrentLinkForWriting;
}
//# sourceMappingURL=chained-structures.d.ts.map