mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix LightningFS Uint8Array types
This commit is contained in:
1 file changed
+2
-2
@@ -8,12 +8,12 @@ import type { JSRuntimeFS, DirectoryEntry } from './JSRuntime';
|
||||
export class LightningFSAdapter implements JSRuntimeFS {
|
||||
constructor(private lightningFS: LightningFS.PromisifiedFS) {}
|
||||
|
||||
async readFile(path: string): Promise<Uint8Array>;
|
||||
async readFile(path: string): Promise<Uint8Array<ArrayBuffer>>;
|
||||
async readFile(path: string, options: 'utf8'): Promise<string>;
|
||||
async readFile(path: string, options: string): Promise<string>;
|
||||
async readFile(path: string, options: { encoding: 'utf8' }): Promise<string>;
|
||||
async readFile(path: string, options: { encoding: string }): Promise<string>;
|
||||
async readFile(path: string, options?: string | { encoding?: string }): Promise<string | Uint8Array>;
|
||||
async readFile(path: string, options?: string | { encoding?: string }): Promise<string | Uint8Array<ArrayBuffer>>;
|
||||
async readFile(path: string, options?: string | { encoding?: string }): Promise<string | Uint8Array> {
|
||||
const encoding = typeof options === 'string' ? options : options?.encoding;
|
||||
return this.lightningFS.readFile(path, encoding);
|
||||
|
||||
Reference in new issue
Block a user