Fix LightningFS Uint8Array types

This commit is contained in:
Alex Gleason committed 2025-10-25 10:49:54 -05:00
1 parent cfa8f69ad5
commit e85e429ba1
1 file changed
+2 -2
+2 -2
View File
@@ -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);