UNPKG

@bscotch/stitch

Version:

Stitch: The GameMaker Studio 2 Asset Pipeline Development Kit.

53 lines 2.36 kB
/// <reference types="node" /> import { YypIncludedFile } from '@bscotch/yy'; import type { StitchProject } from '../StitchProject.js'; import { StitchStorage } from '../StitchStorage.js'; export declare class Gms2IncludedFile { private storage; private data; constructor(option: YypIncludedFile, storage: StitchStorage); get name(): string; /** The folder path name as seen in the IDE browser. */ get folder(): string; /** The directory containing this file, relative to project root */ get directoryRelative(): string; get directoryAbsolute(): string; get filePathRelative(): string; get filePathAbsolute(): string; /** Get the file content */ get contentAsBuffer(): Buffer; /** * Set the file content on disk. If string or Buffer, * just directly write. In all other cases, JSON stringify. */ setContent(data: any): void; /** If the content is JSON, get it as a parsed Javascript structure (else throw) */ get contentParsedAsJson(): any; /** Get the file content as a string */ get contentAsString(): string; /** The list of configurations that apply to this file in some way. */ get configNames(): string[]; /** The configuration overrides for this file */ get config(): { [configName: string]: { CopyToMask: string; }; } | undefined; set config(configuration: { [configName: string]: { CopyToMask: string; }; } | undefined); /** * Replace this Included File's content with the content * from another file (names don't need to match) */ replaceWithFileContent(sourceFile: string): void; toJSON(): YypIncludedFile; static get defaultDataValues(): Omit<YypIncludedFile, 'name' | 'filePath'>; static importFromDirectory(project: StitchProject, path: string, subdirectory?: string, allowedExtensions?: string[]): Gms2IncludedFile[]; static importFromFile(project: StitchProject, path: string, subdirectory?: string): Gms2IncludedFile; static importFromData(project: StitchProject, path: string, content: any, subdirectory?: string): Gms2IncludedFile; static import(project: StitchProject, path: string, content?: any, subdirectory?: string, allowedExtensions?: string[]): Gms2IncludedFile[]; } //# sourceMappingURL=Gms2IncludedFile.d.ts.map