Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DocumentModel

The default implementation of a document model.

Hierarchy

  • Model
    • DocumentModel

Implements

Index

Constructors

constructor

  • new DocumentModel(languagePreference?: string, modelDB?: IModelDB): DocumentModel
  • Construct a new document model.

    Parameters

    • Optional languagePreference: string
    • Optional modelDB: IModelDB

    Returns DocumentModel

Properties

Private _contentChanged

_contentChanged: Signal<this, void> = new Signal<this, void>(this)

Private _defaultLang

_defaultLang: string = ""

Private _dirty

_dirty: boolean = false

Private _readOnly

_readOnly: boolean = false

Private _stateChanged

_stateChanged: Signal<this, IChangedArgs<any>> = new Signal<this, IChangedArgs<any>>(this)

isDisposed

isDisposed: boolean

Whether the model is disposed.

mimeType

mimeType: string

A mime type of the model.

mimeTypeChanged

mimeTypeChanged: ISignal<this, IChangedArgs<string>>

A signal emitted when a mimetype changes.

modelDB

modelDB: IModelDB

The underlying IModelDB instance in which model data is stored.

selections

selections: IObservableMap<ITextSelection[]>

Get the selections for the model.

value

value: IObservableString

Get the value of the model.

Accessors

contentChanged

  • get contentChanged(): ISignal<this, void>
  • A signal emitted when the document content changes.

    Returns ISignal<this, void>

defaultKernelLanguage

  • get defaultKernelLanguage(): string
  • The default kernel language of the document.

    Notes

    This is a read-only property.

    Returns string

defaultKernelName

  • get defaultKernelName(): string
  • The default kernel name of the document.

    Notes

    This is a read-only property.

    Returns string

dirty

  • get dirty(): boolean
  • set dirty(newValue: boolean): void
  • The dirty state of the document.

    Returns boolean

  • The dirty state of the document.

    Parameters

    • newValue: boolean

    Returns void

readOnly

  • get readOnly(): boolean
  • set readOnly(newValue: boolean): void
  • The read only state of the document.

    Returns boolean

  • The read only state of the document.

    Parameters

    • newValue: boolean

    Returns void

stateChanged

  • get stateChanged(): ISignal<this, IChangedArgs<any>>
  • A signal emitted when the document state changes.

    Returns ISignal<this, IChangedArgs<any>>

Methods

dispose

  • dispose(): void
  • Dispose of the resources used by the model.

    Returns void

fromJSON

  • fromJSON(value: JSONValue): void
  • Deserialize the model from JSON.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: JSONValue

    Returns void

fromString

  • fromString(value: string): void
  • Deserialize the model from a string.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: string

    Returns void

initialize

  • initialize(): void

toJSON

  • toJSON(): JSONValue

toString

  • toString(): string

Protected triggerContentChange

  • triggerContentChange(): void
  • Trigger a content changed signal.

    Returns void

Protected triggerStateChange

  • triggerStateChange(args: IChangedArgs<any>): void
  • Trigger a state change signal.

    Parameters

    • args: IChangedArgs<any>

    Returns void

Generated using TypeDoc