mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Accept options object in JSRuntimeFS
This commit is contained in:
8 files changed
+62
-35
No files matched your search
@@ -5,11 +5,13 @@
|
||||
export interface JSRuntimeFS {
|
||||
// Core file operations with proper overloads for type safety
|
||||
readFile(path: string): Promise<Uint8Array>;
|
||||
readFile(path: string, encoding: 'utf8'): Promise<string>;
|
||||
readFile(path: string, encoding: string): Promise<string>;
|
||||
readFile(path: string, encoding?: string): Promise<string | Uint8Array>;
|
||||
readFile(path: string, options: 'utf8'): Promise<string>;
|
||||
readFile(path: string, options: string): Promise<string>;
|
||||
readFile(path: string, options: { encoding: 'utf8' }): Promise<string>;
|
||||
readFile(path: string, options: { encoding: string }): Promise<string>;
|
||||
readFile(path: string, options?: string | { encoding?: string }): Promise<string | Uint8Array>;
|
||||
|
||||
writeFile(path: string, data: string | Uint8Array, encoding?: string): Promise<void>;
|
||||
writeFile(path: string, data: string | Uint8Array, options?: string | { encoding?: string }): Promise<void>;
|
||||
|
||||
// readdir overloads for different return types
|
||||
readdir(path: string): Promise<string[]>;
|
||||
|
||||
Reference in new issue
Block a user