js-dos 8.4.0 → 8.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
1
  import { WasmModule } from "../../../impl/modules";
2
2
  import { TransportLayer, Net } from "../../../protocol/protocol";
3
+ import "../../../sockdrive/sockdrive";
3
4
  export declare function dosDirect(wasmModule: WasmModule, sessionId: string, canvas?: OffscreenCanvas, audioWorklet?: boolean, net?: Net): Promise<TransportLayer>;
@@ -37,6 +37,7 @@ export interface Emulators {
37
37
  dosboxWorker: (init: InitFs, options?: BackendOptions) => Promise<CommandInterface>;
38
38
  dosboxXNode: (init: InitFs, options?: BackendOptions) => Promise<CommandInterface>;
39
39
  dosboxXDirect: (init: InitFs, options?: BackendOptions) => Promise<CommandInterface>;
40
+ dosboxXJspiDirect: (init: InitFs, options?: BackendOptions) => Promise<CommandInterface>;
40
41
  dosboxXWorker: (init: InitFs, options?: BackendOptions) => Promise<CommandInterface>;
41
42
  dosboxXJspiWorker: (init: InitFs, options?: BackendOptions) => Promise<CommandInterface>;
42
43
  backend: (init: InitFs, transportLayer: TransportLayer, options?: BackendOptions) => Promise<CommandInterface>;
@@ -18,6 +18,7 @@ declare class EmulatorsImpl implements Emulators {
18
18
  dosboxWorker(init: InitFs, options?: BackendOptions): Promise<CommandInterface>;
19
19
  dosboxXNode(init: InitFs, options?: BackendOptions): Promise<CommandInterface>;
20
20
  dosboxXDirect(init: InitFs, options?: BackendOptions): Promise<CommandInterface>;
21
+ dosboxXJspiDirect(init: InitFs, options?: BackendOptions): Promise<CommandInterface>;
21
22
  dosboxXWorker(init: InitFs, options?: BackendOptions): Promise<CommandInterface>;
22
23
  dosboxXJspiWorker(init: InitFs, options?: BackendOptions): Promise<CommandInterface>;
23
24
  backend(init: InitFs, transportLayer: TransportLayer, options?: BackendOptions): Promise<CommandInterface>;
@@ -0,0 +1,3 @@
1
+ export declare const compressBound: any;
2
+ export declare const compress: any;
3
+ export declare const uncompress: any;
@@ -0,0 +1,36 @@
1
+ export interface Store {
2
+ keys: () => Promise<number[]>;
3
+ put: (key: number, data: Uint8Array) => Promise<void>;
4
+ getSync: (key: number) => Uint8Array | null;
5
+ getAsync: (key: number) => Promise<Uint8Array | null>;
6
+ }
7
+ export declare class NoStore implements Store {
8
+ store: Map<number, Uint8Array>;
9
+ put(key: number, data: Uint8Array): Promise<void>;
10
+ getSync(key: number): Uint8Array | null;
11
+ getAsync(_: number): Promise<Uint8Array | null>;
12
+ keys(): Promise<number[]>;
13
+ }
14
+ export declare class OpfsStore implements Store {
15
+ private dir;
16
+ private index;
17
+ private syncMode;
18
+ private blockHandle;
19
+ private metaHandle;
20
+ private blockSize;
21
+ private metaSize;
22
+ private blockLength;
23
+ private metaEntry;
24
+ private asyncOpPromise;
25
+ private constructor();
26
+ static create(url: string, blockLength: number): Promise<OpfsStore>;
27
+ private init;
28
+ private loadIndex;
29
+ keys(): Promise<number[]>;
30
+ put(key: number, data: Uint8Array): Promise<void>;
31
+ getSync(key: number): Uint8Array | null;
32
+ getAsync(key: number): Promise<Uint8Array | null>;
33
+ }
34
+ export declare function getStore(url: string, blockLength: number): Promise<Store>;
35
+ export declare function readUint32(container: Uint8Array, offset: number): number;
36
+ export declare function writeUint32(container: Uint8Array, value: number, offset: number): number;
@@ -0,0 +1,29 @@
1
+ interface DriveInfo {
2
+ ahead_read: number;
3
+ range_count: number;
4
+ dropped_ranges: number[];
5
+ preload_ranges: number[] | "_";
6
+ small_ranges: number[];
7
+ cylinders: number;
8
+ heads: number;
9
+ sectors: number;
10
+ sector_size: number;
11
+ size: number;
12
+ name: string;
13
+ url: string;
14
+ preloadSizeInBytes: number;
15
+ sizeInBytes: number;
16
+ readInBytes: number;
17
+ writeInBytes: number;
18
+ }
19
+ export interface Drive {
20
+ info: DriveInfo;
21
+ range(sector: number): number;
22
+ readRangeAsync(range: number): void;
23
+ ready(): void;
24
+ write(sector: number, buffer: Uint8Array): void;
25
+ persist(): Promise<Uint8Array | null>;
26
+ }
27
+ export declare function sockdrive(url: string, persistedSectors: Uint8Array | null, preloadMode: "all" | "default" | "none", _onNewRange: (range: number, buffer: Uint8Array) => void): Promise<Drive>;
28
+ export declare function traverseSockdriveChanges(encoded: Uint8Array, callback: (url: string, changes: Uint8Array) => void): boolean;
29
+ export {};