@thenick775/mgba-wasm 2.5.0-beta.2 → 2.5.0-beta.3

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.
package/dist/mgba.d.ts CHANGED
@@ -16,7 +16,6 @@ declare namespace mGBA {
16
16
  screenshotsPath: string;
17
17
  patchPath: string;
18
18
  autosave: string;
19
- shaderPath: string;
20
19
  }
21
20
 
22
21
  export type coreCallbacks = {
@@ -61,6 +60,21 @@ declare namespace mGBA {
61
60
  autoSaveStateLoadedCallback?: (() => void) | null;
62
61
  };
63
62
 
63
+ export type LogLevel =
64
+ | 'FATAL'
65
+ | 'ERROR'
66
+ | 'WARN'
67
+ | 'INFO'
68
+ | 'DEBUG'
69
+ | 'STUB'
70
+ | 'GAME ERROR';
71
+
72
+ export type LogEntry = {
73
+ level: LogLevel;
74
+ category: string;
75
+ message: string;
76
+ };
77
+
64
78
  export type coreSettings = {
65
79
  /**
66
80
  * Number of frames to skip rendering between screen paints.
@@ -102,17 +116,6 @@ declare namespace mGBA {
102
116
  */
103
117
  rewindBufferInterval?: number;
104
118
 
105
- /**
106
- * Controls the pixel density of the screen allowing for sharper texture rendering.
107
- *
108
- * Note: this is _not_ true high resolution upscaling yet, but does facilitate proper pixel scaling.
109
- *
110
- * Typical values: `1..16`
111
- *
112
- * Default: 1
113
- */
114
- highResolutionScale?: number;
115
-
116
119
  /**
117
120
  * Requested audio sample rate in Hz for the audio output.
118
121
  * The core will attempt to use this rate, actual output depends on
@@ -493,6 +496,19 @@ declare namespace mGBA {
493
496
  */
494
497
  addCoreCallbacks(coreCallbacks: coreCallbacks): void;
495
498
 
499
+ /**
500
+ * Registers a callback for mGBA core log output.
501
+ *
502
+ * Use this to capture emulator logs in your application UI, such as a log
503
+ * panel, instead of relying on browser console output alone.
504
+ *
505
+ * Passing `null` removes the custom logger and restores default console
506
+ * logging.
507
+ *
508
+ * @param callback - Log handler, or `null` to clear it.
509
+ */
510
+ setLogger(callback: ((entry: LogEntry) => void) | null): void;
511
+
496
512
  /**
497
513
  * Enables/disables active rewinding while the core is running.
498
514
  *
@@ -507,23 +523,6 @@ declare namespace mGBA {
507
523
  */
508
524
  setCoreSettings(coreSettings: coreSettings): void;
509
525
 
510
- /**
511
- * Returns a list of available shader paths in the in-memory file system.
512
- */
513
- listShaders(): string[];
514
-
515
- /**
516
- * Loads the shader from the specified path.
517
- *
518
- * @param shaderPath - Path of shader to load from the in-memory file system.
519
- */
520
- loadShader(shaderPath: string): void;
521
-
522
- /**
523
- * Unloads the currently active shader.
524
- */
525
- unloadShader(): void;
526
-
527
526
  // custom variables
528
527
  version: {
529
528
  projectName: string;
@@ -580,16 +579,14 @@ declare namespace mGBA {
580
579
  * This core uses threads, your app must be served with cross-origin isolation enabled
581
580
  * (`COOP: same-origin` + `COEP: require-corp`), otherwise it will not run correctly.
582
581
  *
583
- * @param options - All default emscripten Module options. See https://emscripten.org/docs/api_reference/module.html
584
- * @param options.canvas - Extra type definition for the canvas used for video output.
585
- * @returns The initialized mGBA emulator `Module`.
582
+ * @param options - Module options.
583
+ * @param options.canvas - Canvas used for video output.
584
+ * @returns The initialized emulator `Module`.
586
585
  */
587
586
  // eslint-disable-next-line import/no-default-export
588
- export default function mGBA(
589
- options: Partial<EmscriptenModule> & {
590
- canvas: HTMLCanvasElement;
591
- },
592
- ): Promise<mGBAEmulator>;
587
+ export default function mGBA(options: {
588
+ canvas: HTMLCanvasElement;
589
+ }): Promise<mGBAEmulator>;
593
590
  }
594
591
 
595
592
  export = mGBA;