import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri'; import { IFileStatWithMetadata } from './generated-models'; export interface IUntitledEditorService { /** * Returns if an untitled resource with the given URI exists. */ exists(resource: URI): boolean; /** * Returns dirty untitled editors as resource URIs. */ getDirty(resources?: URI[]): URI[]; /** * Returns true if the provided resource is dirty. */ isDirty(resource: URI): boolean; /** * Reverts the untitled resources if found. */ revertAll(resources?: URI[]): URI[]; /** * Creates a new untitled input with the optional resource URI or returns an existing one * if the provided resource exists already as untitled input. * * It is valid to pass in a file resource. In that case the path will be used as identifier. * The use case is to be able to create a new file with a specific path with VSCode. */ createOrGet(resource?: URI, mode?: string, initialValue?: string, encoding?: string): IFileStatWithMetadata; /** * Creates a new untitled model with the optional resource URI or returns an existing one * if the provided resource exists already as untitled model. * * It is valid to pass in a file resource. In that case the path will be used as identifier. * The use case is to be able to create a new file with a specific path with VSCode. */ /** * A check to find out if a untitled resource has a file path associated or not. */ hasAssociatedFilePath(resource: URI): boolean; /** * Suggests a filename for the given untitled resource if it is known. */ suggestFileName(resource: URI): string; /** * Get the configured encoding for the given untitled resource if any. */ getEncoding(resource: URI): string | undefined; }