import { ISaveOptions } from "../../../common/editor.js"; import { BaseTextEditorModel } from "../../../common/editor/textEditorModel.js"; import { URI } from "../../../../base/common/uri.js"; import { ILanguageService } from "../../../../editor/common/languages/language.service.js"; import { IModelService } from "../../../../editor/common/services/model.service.js"; import { Event } from "../../../../base/common/event.js"; import { IWorkingCopyBackupService } from "../../workingCopy/common/workingCopyBackup.service.js"; import { ITextResourceConfigurationService } from "../../../../editor/common/services/textResourceConfiguration.service.js"; import { ITextModel } from "../../../../editor/common/model.js"; import { ITextEditorModel } from "@codingame/monaco-vscode-model-service-override/vscode/vs/editor/common/services/resolverService"; import { IWorkingCopyService } from "../../workingCopy/common/workingCopyService.service.js"; import { IWorkingCopy, WorkingCopyCapabilities, IWorkingCopyBackup, IWorkingCopySaveEvent } from "../../workingCopy/common/workingCopy.js"; import { IEncodingSupport, ILanguageSupport } from "../../textfile/common/textfiles.js"; import { ITextFileService } from "../../textfile/common/textfiles.service.js"; import { ILabelService } from "../../../../platform/label/common/label.service.js"; import { IEditorService } from "../../editor/common/editorService.service.js"; import { CancellationToken } from "../../../../base/common/cancellation.js"; import { ILanguageDetectionService } from "../../languageDetection/common/languageDetectionWorkerService.service.js"; import { IAccessibilityService } from "../../../../platform/accessibility/common/accessibility.service.js"; export interface IUntitledTextEditorModel extends ITextEditorModel, ILanguageSupport, IEncodingSupport, IWorkingCopy { /** * Emits an event when the encoding of this untitled model changes. */ readonly onDidChangeEncoding: Event; /** * Emits an event when the name of this untitled model changes. */ readonly onDidChangeName: Event; /** * Emits an event when this untitled model is reverted. */ readonly onDidRevert: Event; /** * Whether this untitled text model has an associated file path. */ readonly hasAssociatedFilePath: boolean; /** * Whether this model has an explicit language or not. */ readonly hasLanguageSetExplicitly: boolean; /** * Sets the encoding to use for this untitled model. */ setEncoding(encoding: string): Promise; /** * Resolves the untitled model. */ resolve(): Promise; /** * Whether this model is resolved or not. */ isResolved(): this is IResolvedUntitledTextEditorModel; } export interface IResolvedUntitledTextEditorModel extends IUntitledTextEditorModel { readonly textEditorModel: ITextModel; } export declare class UntitledTextEditorModel extends BaseTextEditorModel implements IUntitledTextEditorModel { readonly resource: URI; readonly hasAssociatedFilePath: boolean; private readonly initialValue; private preferredLanguageId; private preferredEncoding; private readonly workingCopyBackupService; private readonly textResourceConfigurationService; private readonly workingCopyService; private readonly textFileService; private readonly labelService; private readonly editorService; private static readonly FIRST_LINE_NAME_MAX_LENGTH; private static readonly FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH; private static readonly ACTIVE_EDITOR_LANGUAGE_ID; private readonly _onDidChangeContent; readonly onDidChangeContent: Event; private readonly _onDidChangeName; readonly onDidChangeName: Event; private readonly _onDidChangeDirty; readonly onDidChangeDirty: Event; private readonly _onDidChangeEncoding; readonly onDidChangeEncoding: Event; private readonly _onDidSave; readonly onDidSave: Event; private readonly _onDidRevert; readonly onDidRevert: Event; readonly typeId = ""; readonly capabilities = WorkingCopyCapabilities.Untitled; private configuredLabelFormat; private cachedModelFirstLineWords; get name(): string; constructor(resource: URI, hasAssociatedFilePath: boolean, initialValue: string | undefined, preferredLanguageId: string | undefined, preferredEncoding: string | undefined, languageService: ILanguageService, modelService: IModelService, workingCopyBackupService: IWorkingCopyBackupService, textResourceConfigurationService: ITextResourceConfigurationService, workingCopyService: IWorkingCopyService, textFileService: ITextFileService, labelService: ILabelService, editorService: IEditorService, languageDetectionService: ILanguageDetectionService, accessibilityService: IAccessibilityService); private registerListeners; private onConfigurationChange; setLanguageId(languageId: string, source?: string): void; getLanguageId(): string | undefined; private configuredEncoding; getEncoding(): string | undefined; setEncoding(encoding: string): Promise; private dirty; isDirty(): boolean; isModified(): boolean; private setDirty; save(options?: ISaveOptions): Promise; revert(): Promise; backup(token: CancellationToken): Promise; private ignoreDirtyOnModelContentChange; resolve(): Promise; isResolved(): this is IResolvedUntitledTextEditorModel; protected installModelListeners(model: ITextModel): void; private onModelContentChanged; private updateNameFromFirstLine; isReadonly(): boolean; }