Theia API Documentation v1.65.0
    Preparing search index...
    interface CustomEditorModel {
        autosaveable?: boolean;
        dirty: boolean;
        onContentChanged: Event<void>;
        onDirtyChanged: Event<void>;
        readonly: boolean;
        resource: URI;
        viewType: string;
        applySnapshot?(snapshot: object): void;
        createSnapshot?(): Saveable.Snapshot;
        dispose(): void;
        filters?(): { [name: string]: string[] };
        redo(): void;
        revert(options?: RevertOptions): Promise<void>;
        save(options?: SaveOptions): MaybePromise<void>;
        saveAs?(options: SaveAsOptions): MaybePromise<void>;
        saveCustomEditor(options?: SaveOptions): Promise<void>;
        saveCustomEditorAs?(
            resource: URI,
            targetResource: URI,
            options?: SaveOptions,
        ): Promise<void>;
        serialize?(): Promise<BinaryBuffer>;
        undo(): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    autosaveable?: boolean

    If false, the saveable will not participate in autosaving.

    dirty: boolean
    onContentChanged: Event<void>

    This event is fired when the content of the saveable changes. While onDirtyChanged is fired to notify the UI that the widget is dirty, onContentChanged is used for the auto save throttling.

    onDirtyChanged: Event<void>

    This event is fired when the content of the dirty variable changes.

    readonly: boolean
    resource: URI
    viewType: string

    Methods

    • Applies the given snapshot to the dirty state.

      Parameters

      • snapshot: object

      Returns void

    • Dispose this object.

      Returns void

    • Optionally return file filters for the "Save As" dialog. The keys of the returned object are the names of the filters and the values are arrays of file extensions. For example: { 'Text Files': ['txt', 'text'], 'All Files': ['*'] } If no filters are provided, a default filter of All Files (*.*) will be used.

      Returns { [name: string]: string[] }

    • Serializes the full state of the saveable item to a binary buffer.

      Returns Promise<BinaryBuffer>