Skip to content

Commit

Permalink
Merge pull request #42 from iDarkSSJ/main
Browse files Browse the repository at this point in the history
fix: Added the "Blob" type to the "rom" argument of the "launch" meth…
  • Loading branch information
arianrhodsandlot authored Sep 12, 2024
2 parents 2653516 + 3d20902 commit d52b5a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/content/docs/apis/launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const nostalgist = await Nostalgist.launch({

+ #### `rom`

**type:** `string | File | { fileName: string; fileContent: Blob } | Array`
**type:** `string | Blob | { fileName: string; fileContent: Blob } | Array`

The game ROM file.

Expand Down
2 changes: 1 addition & 1 deletion src/nostalgist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class Nostalgist {

private static async launchSystem(system: string, options: NostalgistLaunchRomOptions | NostalgistOptionsFile) {
const launchOptions =
typeof options === 'string' || options instanceof File || ('fileName' in options && 'fileContent' in options)
typeof options === 'string' || options instanceof Blob || ('fileName' in options && 'fileContent' in options)
? { rom: options }
: options
const core = Nostalgist.getCoreForSystem(system)
Expand Down
2 changes: 1 addition & 1 deletion src/types/nostalgist-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { RetroArchEmscriptenModuleOptions } from './retroarch-emscripten'

type MaybePromise<T> = Promise<T> | T

export type NostalgistOptionsFile = { fileContent: Blob; fileName: string } | File | string
export type NostalgistOptionsFile = { fileContent: Blob; fileName: string } | Blob | string
type NostalgistOptionsFiles = NostalgistOptionsFile | NostalgistOptionsFile[]

export interface NostalgistCoreDict {
Expand Down

0 comments on commit d52b5a9

Please sign in to comment.