import { Pathy } from '@bscotch/pathy'; import { RequiredBy } from '@bscotch/utility'; import { Yyp } from '@bscotch/yy'; import { Gms2ProjectComponents } from '../types/Gms2ProjectComponents.js'; import { FileDifference } from '../utility/files.js'; import { AudioAsset, DeletedAsset } from './assetSource/assetSource.js'; import { Gms2AudioGroup } from './components/Gms2AudioGroup.js'; import { Gms2ComponentArray } from './components/Gms2ComponentArray.js'; import { Gms2Config } from './components/Gms2Config.js'; import { Gms2IncludedFile } from './components/Gms2IncludedFile.js'; import { Gms2IncludedFileArray } from './components/Gms2IncludedFileArray.js'; import { Gms2ResourceArray } from './components/Gms2ResourceArray.js'; import { Gms2RoomOrder } from './components/Gms2RoomOrder.js'; import { Gms2TextureGroup } from './components/Gms2TextureGroup.js'; import { GameMakerEngine } from './GameMakerEngine.js'; import { GameMakerBuildOptions, GameMakerRunOptions } from './GameMakerEngine.types.js'; import { GameMakerIssue } from './GameMakerIssue.js'; import { Gms2FolderArray } from './Gms2FolderArray.js'; import { Linter, LinterOptions, LinterReportFormat } from './Linter.js'; import { GmlTokenSummary } from './parser/GmlTokenSummary.js'; import { Gms2Platform, StitchProjectStatic } from './StitchProject.static.js'; import type { FindGlobalFunctionReferencesOptions, GameMakerProjectCloneOptions, SpriteImportOptions, StitchProjectComms, StitchProjectOptions, StitchProjectPlugin } from './StitchProject.types.js'; import { StitchProjectConfig } from './StitchProjectConfig.js'; import { Gms2MergerGitHubOptions, StitchMergerOptions } from './StitchProjectMerger.js'; import { StitchStorage } from './StitchStorage.js'; export * from './StitchProject.static.js'; export * from './StitchProject.types.js'; /** * Convert a GameMaker Studio 2.3+ project * into an internal representation that can * be manipulated programmatically. */ export declare class StitchProject extends StitchProjectStatic { /** * The content of the YYP file, mirroring the data structure * in the file but with components replaced by model instances. */ protected components: Gms2ProjectComponents; readonly config: StitchProjectConfig; protected plugins: StitchProjectPlugin[]; readonly storage: StitchStorage; yypRaw: Yyp; /** * A representation of an "Issue" for submission * to GameMaker. Its methods can be used to create * an issue form, fetch log info, and compile a * report. */ readonly issue: GameMakerIssue; static load(options?: StitchProjectOptions): Promise; static readonly from: typeof StitchProject.load; protected constructor(options: RequiredBy); /** * Compile the project using Igor. * @alpha */ build(options?: GameMakerBuildOptions): Promise; /** * Run the project using Igor. * @alpha */ run(options?: GameMakerRunOptions): Promise; /** * Change the name of the project stored in its * YYP file. * * (Not the name of the file itself.) */ get name(): string; set name(newProjectName: string); get resourceVersion(): unknown; get io(): StitchProjectComms; get yypPathAbsolute(): string; get yypDirAbsolute(): string; get folders(): Gms2FolderArray; get resources(): Gms2ResourceArray; get textureGroups(): Gms2ComponentArray>>; name: import("zod").ZodString; groupParent: import("zod").ZodDefault>>; isScaled: import("zod").ZodDefault; customOptions: import("zod").ZodOptional; compressFormat: import("zod").ZodOptional; autocrop: import("zod").ZodDefault; border: import("zod").ZodDefault; mipsToGenerate: import("zod").ZodDefault; targets: import("zod").ZodDefault, bigint, number | bigint>>; loadType: import("zod").ZodOptional>; directory: import("zod").ZodOptional; resourceType: import("zod").ZodDefault>; resourceVersion: import("zod").ZodDefault; }, import("zod").ZodTypeAny, "passthrough">, typeof Gms2TextureGroup>; get audioGroups(): Gms2ComponentArray<{ name: string; resourceType: "GMAudioGroup"; resourceVersion: string; targets: bigint; ConfigValues?: Record> | undefined; }, typeof Gms2AudioGroup>; get includedFiles(): Gms2IncludedFileArray; get rooms(): import("./components/resources/Gms2Room.js").Gms2Room[]; get roomOrder(): Gms2ComponentArray<{ roomId: { path: string; name: string; }; }, typeof Gms2RoomOrder>; get configs(): Gms2Config; get ideVersion(): string; /** * For GameMaker versions starting in 2022, * returns `true` if the version indicates * that the IDE in use is a beta IDE. * * For versions before that, always returns `undefined`. */ get ideVersionIsBeta(): boolean | undefined; /** * The local path where the GameMaker engine stores * runtimes, IDE configs, and other information. * * Uses the project's IDE Version and the current * OS to determine this directory. * * (Only works on Windows.) */ engine(): GameMakerEngine; listScriptGmlFiles(): string[]; listObjectGmlFiles(): string[]; getGlobalFunctions(): import("./parser/GmlToken.js").GmlToken[]; /** * Set the project version in all options files. * (Note that the Switch options files do not include the version * -- that must be set outside of GameMaker in the *.nmeta file). * Can use one of: * + "0.0.0.0" syntax (exactly as GameMaker stores versions) * + "0.0.0" syntax (semver without prereleases -- the 4th value will always be 0) * + "0.0.0-rc.0" syntax (the 4th number will be the RC number) * The four numbers will appear in all cases as the string "major.minor.patch.candidate" */ set version(versionString: string); versionOnPlatform(platform: Gms2Platform): string; /** * Bundle the project into a single zip file with the `.yyz` extension. */ exportYyz(options?: { outputDirectory?: string; }): Promise<{ filePath: string; }>; mergeFromUrl(url: string, options?: StitchMergerOptions, headers?: { [header: string]: any; }): Promise; mergeFromGithub(options: Gms2MergerGitHubOptions): Promise; /** * Import modules from one GMS2 project into this one. * @param fromProject A directory containing a single .yyp file somwhere, * or the path directly to a .yyp file. */ merge(fromProjectPath: string, options?: StitchMergerOptions): Promise; /** * Get all references to global functions. * * @alpha */ findGlobalFunctionReferences(options?: FindGlobalFunctionReferencesOptions): GmlTokenSummary[]; /** Lint this project, resulting in a report of potential issues. */ lint(options?: LinterOptions & { format?: LinterReportFormat; }): Linter; /** Ensure that a texture group exists in the project. */ addTextureGroup(textureGroupName: string): this; /** Add a texture group assignment if it doesn't already exist. */ addTextureGroupAssignment(folder: string, textureGroupName: string): Promise; /** Ensure an audio group exists in the project */ addAudioGroup(audioGroupName: string): this; /** Add a texture group assignment if it doesn't already exist. */ addAudioGroupAssignment(folder: string, audioGroupName: string): Promise; addRoom(name: string, options?: { first?: boolean; }): Promise; /** * Ensure that a folder path exists, so that assets can be assigned to it. */ addFolder(path: string, tags?: string[]): this; /** Does not save the project. */ private addSoundByFile; /** * Diff an audio source against the project's current audio resources. */ checkSoundSource(sourceConfigPath: string | Pathy, sourceId?: string): Promise<(FileDifference & { source: AudioAsset | DeletedAsset; })[]>; /** * Add or update audio files from a file or a directory. * The name is taken from * the source. If there already exists a sound asset * with this name, its file will be replaced. Otherwise * the asset will be created and placed into folder "/NEW". * Support the following extensions: * 1. mp3 * 2. ogg * 3. wav * 4. wma * * If the file is a `stitch.src.json` file, its importable audio source(s) * will be used. */ addSounds(source: string, options?: { /** * Optionally provide a target sourceId if using a Stitch Asset Source * (otherwise uses all audio sources) */ sourceId?: string; /** * Optionally limit allowed extensions when discovering sound files */ extensions?: string[]; }): Promise; /** * Add or update a script resource. Unless you're trying to make * global variables, your code should be wrapped in a function! */ addScript(name: string, code: string): Promise; /** * Given a source folder that is either a sprite or a * a folder containing sprites (where a 'sprite' is a folder * containing one or more immediate child PNGs that are * all the same size -- nesting is allowed), add or update * the game project sprites using those images. This completely * replaces the existing images for that sprite. The folder * name is used directly as the sprite name (parent folders * are ignored for this.) */ addSprites(sourceFolder: string, options?: SpriteImportOptions): Promise; addObject(name: string): Promise; deleteResourceByName(name: string): this; deleteIncludedFileByName(baseName: string): this; /** * Import a new IncludedFile based on an external file. * By default will appear in "datafiles/NEW" folder, but you can specificy * a subdirectory path. If an included file with this name already exists * in **ANY** subdirectory it will be overwritten. (Names must be unique due to * an iOS bug wherein all included files are effectively in a flat heirarchy. * {@see https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/sprites/sprite_add.html} * @param path Direct filepath or a directory from which all files (recursively) should be loaded * @param content If set, will create a new file instead of copying content from an existing one. * If the content is a string or buffer it will be written as-is. All other cases are * JSON stringified. Must not be null or undefined in order to take effect. * @param subdirectory Subdirectory inside the Datafiles folder in which to place this resource. */ addIncludedFiles(path: string, options?: { content?: any; subdirectory?: string; allowedExtensions?: string[]; }): Gms2IncludedFile[]; addConfig(name: string): this; /** Write *any* changes to disk. (Does nothing if readonly is true.) */ save(): this; ensureResourceGroupAssignments(): Promise; /** * Recreate in-memory representations of the GameMaker Project * using its files. */ protected reload(): Promise; /** * A deep copy of the project's YYP content with everything as plain primitives (no custom class instances). * Perfect for writing to JSON. */ toJSON(): Yyp; static cloneProject(options: GameMakerProjectCloneOptions): Promise; } //# sourceMappingURL=StitchProject.d.ts.map