lib/storage: drop read() method, widen res() to Blob

we don't use it anywhere, we only use res()
This commit is contained in:
jj 2025-04-30 17:36:23 +00:00
parent dd507e1dcd
commit be4e7e2d7d
No known key found for this signature in database
2 changed files with 1 additions and 9 deletions

View File

@ -30,13 +30,6 @@ export class OPFSStorage extends AbstractStorage {
return await this.#handle.getFile();
}
read(size: number, offset: number) {
const out = new Uint8Array(size);
const bytesRead = this.#io.read(out, { at: offset });
return out.subarray(0, bytesRead);
}
async write(data: Uint8Array | Int8Array, offset: number) {
return this.#io.write(data, { at: offset })
}

View File

@ -7,8 +7,7 @@ export abstract class AbstractStorage {
return false;
}
abstract res(): Promise<File>;
abstract read(size: number, offset: number): Uint8Array;
abstract res(): Promise<Blob>;
abstract write(data: Uint8Array | Int8Array, offset: number): Promise<number>;
abstract destroy(): Promise<void>;
};