Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DocumentModel

The default implementation of a document model.

Hierarchy

Implements

Index

Constructors

constructor

  • Construct a new document model.

    Parameters

    • Optional languagePreference: string
    • Optional modelDB: IModelDB

    Returns DocumentModel

Properties

Private _contentChanged

_contentChanged: any

Private _defaultLang

_defaultLang: any

Private _dirty

_dirty: any

Private _readOnly

_readOnly: any

Private _stateChanged

_stateChanged: any

Readonly modelDB

modelDB: IModelDB

The underlying IModelDB instance in which model data is stored.

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): any
  • The dirty state of the document.

    Returns boolean

  • The dirty state of the document.

    Parameters

    • newValue: boolean

    Returns any

isDisposed

  • get isDisposed(): boolean
  • Whether the model is disposed.

    Returns boolean

mimeType

  • get mimeType(): string
  • set mimeType(newValue: string): any
  • A mime type of the model.

    Returns string

  • A mime type of the model.

    Parameters

    • newValue: string

    Returns any

mimeTypeChanged

  • get mimeTypeChanged(): ISignal<this, IChangedArgs<string>>
  • A signal emitted when a mimetype changes.

    Returns ISignal<this, IChangedArgs<string>>

readOnly

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

    Returns boolean

  • The read only state of the document.

    Parameters

    • newValue: boolean

    Returns any

selections

  • Get the selections for the model.

    Returns IObservableMap<ITextSelection[]>

stateChanged

  • A signal emitted when the document state changes.

    Returns ISignal<this, IChangedArgs<any>>

value

  • Get the value of the model.

    Returns IObservableString

Methods

dispose

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

    Returns void

fromJSON

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

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: PartialJSONValue

    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
  • Initialize the model with its current state.

    Returns void

toJSON

  • toJSON(): PartialJSONValue
  • Serialize the model to JSON.

    Returns PartialJSONValue

toString

  • toString(): string
  • Serialize the model to a string.

    Returns string

Protected triggerContentChange

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

    Returns void

Protected triggerStateChange

  • Trigger a state change signal.

    Parameters

    Returns void

Generated using TypeDoc