UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

59 lines (58 loc) 2.57 kB
import IFile, { FileUpdateType } from "./IFile"; import IFolder from "./IFolder"; import IStorage from "./IStorage"; import IVersionContent from "./IVersionContent"; export default abstract class FileBase implements IFile { #private; abstract get name(): string; abstract get parentFolder(): IFolder; abstract get isContentLoaded(): boolean; priorVersions: IVersionContent[]; isDisposed: boolean; isInErrorState?: boolean; errorStateMessage?: string; /** * Cache for comment-json parsed object. * When set, contains the parsed JSON with comment metadata preserved as Symbol properties. */ commentJsonCache?: unknown; protected _content: string | Uint8Array | null; get fileContainerStorage(): IStorage | null; get onFileContentUpdated(): import("ste-events").IEvent<IFile, IFile>; set fileContainerStorage(newStorage: IStorage | null); get isString(): boolean; get canIgnore(): boolean; get isBinary(): boolean; get content(): string | Uint8Array<ArrayBufferLike>; get latestModified(): Date; modified: Date | null; modifiedAtLoad: Date | null; lastLoadedOrSaved: Date | null; manager?: any; tag?: any; get type(): string; get needsSave(): boolean; get fullPath(): string; get extendedPath(): string; get storageRelativePath(): string; getRootRelativePath(): string; getFolderRelativePath(toFolder: IFolder): string; get coreContentLength(): number; constructor(); contentWasModified(oldContent: string | Uint8Array | null, updateType?: FileUpdateType, sourceId?: string): void; notifyFileContentUpdated(): void; getHash(): Promise<string | undefined>; unload(): void; dispose(): void; exists(): Promise<boolean>; getRelativePathFor(file: IFile): string | undefined; setObjectContentIfSemanticallyDifferent(value: object | null | undefined, updateType?: FileUpdateType, sourceId?: string): boolean; reloadAfterExternalUpdate(): Promise<void>; setContentIfSemanticallyDifferent(value: string | Uint8Array | null, updateType?: FileUpdateType, sourceId?: string): boolean; abstract scanForChanges(): Promise<void>; abstract deleteThisFile(skipRemoveFromParent?: boolean): Promise<boolean>; abstract moveTo(newStorageRelativePath: string): Promise<boolean>; abstract loadContent(force?: boolean): Promise<Date>; abstract setContent(value: string | Uint8Array | null, updateType?: FileUpdateType, sourceId?: string): boolean; abstract saveContent(): Promise<Date>; }