@bscotch/stitch-launcher
Version:
Manage GameMaker IDE and runtime installations for fast switching between versions.
89 lines • 3.88 kB
TypeScript
import { Pathy } from '@bscotch/pathy';
import { ChildProcess } from 'child_process';
import { GameMakerComponent } from './GameMakerComponent.js';
import type { GameMakerInstalledVersion } from './GameMakerLauncher.types.js';
import { TracedClass } from '@bscotch/utility/browser';
export interface GameMakerIde extends TracedClass {
}
export interface GameMakerIdeInstallOptions {
/**
* Specify a non-default program files directory
* if your IDE installs do not go to the default.
*
* This is required if you've ever manually installed
* GameMaker and chosen a non-default program files
* root directory.
*
* @default process.env.PROGRAMFILES
*/
programFiles?: string;
/**
* If true, the installer will be downloaded
* and run even if it is already evailable
*/
force?: boolean;
}
export declare class GameMakerRunningIde {
readonly exePath: string;
readonly projectYypPath: string;
readonly runtimeVersion: string;
protected process: ChildProcess;
constructor(exePath: string, projectYypPath: string, runtimeVersion: string);
waitForClose<T>(cb?: () => T): Promise<T>;
close(): void;
}
export type GameMakerIdeErrorCode = 'LOGIN_REQUIRED' | 'RUNTIME_NOT_FOUND' | 'IDE_NOT_FOUND' | 'UNKNOWN';
export declare class GameMakerIdeError extends Error {
readonly code: GameMakerIdeErrorCode;
constructor(message: string, code: GameMakerIdeErrorCode);
}
export declare function assert(claim: any, message?: string, code?: GameMakerIdeErrorCode): asserts claim;
export declare class GameMakerIde extends GameMakerComponent {
static readonly error: typeof GameMakerIdeError;
constructor(info: GameMakerInstalledVersion);
openProject(projectYypPath: string | Pathy, runtimeVersion?: string): Promise<GameMakerRunningIde>;
/**
* Each GameMaker IDE lists the runtime version
* that it is paired with. In theory this is the
* most-compatible runtime version.
*/
pairedRuntimeVersion(): Promise<string>;
/**
* Install the specified IDE version. Only
* one IDE version can be installed at a time
* (per stable and beta channels), so this
* may clobber the currently-installed IDE.
*
* If this version is already installed, no action
* is taken. If this version's installer is already
* downloaded, it will not be re-downloaded. If it
* is *not* downloaded, then it will be downloaded.
*/
static install(version: string, options?: GameMakerIdeInstallOptions): Promise<GameMakerIde>;
static findInstalled(version: string): Promise<GameMakerIde | undefined>;
static listInstalled(): Promise<GameMakerIde[]>;
/**
* Prevent the IDE from showing an update prompt on boot.
*/
protected static disableUpdatePrompt(): Promise<void>;
protected static findDirectlyInstalled(version: string, programFiles?: string): Promise<GameMakerIde | undefined>;
/**
* Check PROGRAMFILES for installed IDE versions. These are the result of running
* the GameMaker IDE installers. The installed
* content end up being separately cached by
* Stitch to allow parallel installs
* (see {@link listInstalled}).
*/
protected static listDirectlyInstalled(programFiles?: string): Promise<GameMakerIde[]>;
protected static listInstalledInDir(parentDir: string | Pathy): Promise<GameMakerIde[]>;
/**
* The parent folder inside of which all IDE
* installs are cached in their own separate
* folders. For the path to a specific IDE
* version, use {@link cachedIdeDirectory}.
*/
static get defaultCachedIdeParentDirectory(): Pathy<unknown>;
static cachedIdeInstallerPath(version: string): Pathy<unknown>;
static cachedIdeDirectory(version: string): Pathy<unknown>;
}
//# sourceMappingURL=GameMakerIde.d.ts.map