mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-10 18:54:26 +02:00
lib/storage: drop read() method, widen res() to Blob
we don't use it anywhere, we only use res()
This commit is contained in:
parent
dd507e1dcd
commit
be4e7e2d7d
@ -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 })
|
||||
}
|
||||
|
@ -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>;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user