@bscotch/stitch-launcher
Version:
Manage GameMaker IDE and runtime installations for fast switching between versions.
75 lines • 3.58 kB
TypeScript
import { Pathy } from '@bscotch/pathy';
import { GameMakerDefaultMacros, GameMakerInstalledVersion, GameMakerLogOptions } from './GameMakerLauncher.types.js';
import { StitchSupportedBuilder } from './GameMakerRuntime.types.js';
import { Debugger } from '@bscotch/utility/browser';
import { z } from 'zod';
export declare const debug: Debugger;
export declare const trace: import("@bscotch/utility/browser").Decorator;
export type RuntimeFeedsFile = z.infer<typeof runtimeFeedsFileSchema>;
export declare const runtimeFeedsFileSchema: z.ZodArray<z.ZodObject<{
Key: z.ZodString;
Value: z.ZodString;
}, z.core.$strip>>;
export declare function createStaticTracer(className: string, methodName: string): Debugger;
export declare const bootstrapRuntimeVersion = "2022.300.0.476";
export declare const stitchConfigDir: Pathy<unknown>;
export declare const currentOs: string | undefined;
export declare const currentArchitecture: string;
export declare function artifactExtensionForPlatform(platform: StitchSupportedBuilder): string;
/**
* Given a .yyp filepath, or a directory that should
* contain one, return the containing directory only.
*/
export declare function projectFolder(projectPath: string | Pathy): Pathy;
export declare function projectLogDirectory(project?: string | Pathy, options?: GameMakerLogOptions): Promise<Pathy<unknown>>;
/**
* Sorts *in place*, descending (most recent date first).
*/
export declare function sortByDateField<F extends string, T extends Record<F, Date | undefined>>(entries: T[], dateField: F): T[];
export declare function downloadIfCacheExpired<T>(url: string, filePath: Pathy<T>, maxAgeInSeconds: number): Promise<void>;
export declare function cachedFileIsExpired(filePath: Pathy, maxAgeInSeconds: number): Promise<boolean>;
/**
* Given a version string, ensure it has the correct
* format for use by this package (4 dot-separated
* numbers, without a leading 'v').
*/
export declare function cleanVersionString(version: string): string;
export declare function download(url: string, to: Pathy, options?: {
force: boolean;
}): Promise<unknown>;
export declare function runIdeInstaller(idePath: Pathy): Promise<unknown>;
/**
* Find the paths to all installed runtime versions.
* Uses discovery plus some basic heuristics and smoke
* tests to return paths that are likely to correspond
* with valid runtime installations.
*
* These are stored in `$PROGRAMDATA/GameMakerStudio2(-(Beta|LTS))?/Cache/runtimes/*`
*/
export declare function listInstalledRuntimes(): Promise<Omit<GameMakerInstalledVersion, 'channel' | 'publishedAt' | 'feedUrl'>[]>;
/**
* Set the active runtime by updating GameMaker's
* program data files. This sets the active runtime
* for *all* installed IDEs!
*/
export declare function setActiveRuntime(runtime: {
version: string;
directory: Pathy;
}): Promise<void>;
/**
* Note that these paths are not populated by
* default, so they may point to non-existent files.
*/
export declare function listDefaultMacrosPaths(): Promise<Pathy<GameMakerDefaultMacros>[]>;
export declare function listRuntimeFeedsConfigPaths(): Promise<Pathy<RuntimeFeedsFile>[]>;
/**
* Find GameMaker's program data caches. These store
* installed Runtimes, current IDE configuration info,
* and other data.
*
* These currently correspond with
* `$PROGRAMDATA/GameMakerStudio2(-(Beta|LTS))?/`
*/
export declare function listGameMakerDataDirs(): Promise<Pathy[]>;
export declare function listInstalledIdes(parentDir?: string | Pathy): Promise<Pathy<unknown>[]>;
//# sourceMappingURL=utility.d.ts.map