The interface for a model factory.

interface IModelFactory<
    T extends DocumentRegistry.IModel,
    U extends ISharedDocument = ISharedDocument,
> {
    collaborative?: boolean;
    contentType: string;
    fileFormat: FileFormat;
    isDisposed: boolean;
    name: string;
    createNew(options?: DocumentRegistry.IModelOptions<U>): T;
    dispose(): void;
    preferredLanguage(path: string): string;
}

Type Parameters

Hierarchy

Implemented by

Properties

collaborative?: boolean

Whether the model is collaborative or not.

contentType: string

The content type of the file (defaults to "file").

fileFormat: FileFormat

The format of the file (defaults to "text").

isDisposed: boolean

Test whether the object has been disposed.

This property is always safe to access.

name: string

The name of the model.

Methods

  • Dispose of the resources held by the object.

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void