Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MonacoExtenderFramed

Extender for the framed editor that must communicate via postMessage with the editor.

Hierarchy

Index

Methods

afterCreate

  • This method is called after the editor was created.

    Parameters

    • context: MonacoIframeContext

      The current context object.

    • wasLibLoaded: boolean

      true if the monaco editor library was reloaded, false otherwise. In case it was reloaded, you may want to setup some language defaults again.

    Returns void

afterDestroy

  • Called after the editor was destroyed; and also when updating a component via AJAX.

    Parameters

    • context: MonacoIframeContext

      The current context object. Note that you should not use it to retrieve the monaco editor instance, as the editor has already been destroyed.

    Returns void

beforeCreate

  • Called before monaco editor is created. This method is passed the current options object that would be used to initialize the monaco editor.

    If this callback does not return a value, the options that were passed are used. You may modify the options in-place.

    If it returns a new options object, that options object is used.

    If it returns a Thenable or Promise, the monaco editor is created only once the Promise resolves (successfully). If the Promise returns a new options object, these options are used to create the editor.

    See IStandaloneEditorConstructionOptions for all editor options.

    Parameters

    • context: MonacoIframeContext

      The current context object. Note that you should not use it to retrieve the monaco editor instance, as the editor was not created yet.

    • options: IStandaloneEditorConstructionOptions

      The current options that would be used to create the editor.

    • wasLibLoaded: boolean

      true if the monaco editor library was reloaded, false otherwise. In case it was reloaded, you may want to setup some language defaults again.

    Returns ProviderResult<IStandaloneEditorConstructionOptions>

    Either undefined to use the options as passed; a new options object to be used for creating the editor; or a Promise that may return the new options.

beforeDestroy

createEditorOverrideServices

  • Called when monaco editor is created. May return an object with services that should be overriden. See here on github for details on the available services.

    Parameters

    • context: MonacoIframeContext

      The current context object. Note that you should not use it to retrieve the monaco editor instance, as the editor was not created yet.

    • options: Readonly<IStandaloneEditorConstructionOptions>

      The options that will be used to create the editor. Readonly and must not be changed.

    Returns IEditorOverrideServices | undefined

    The override options to be used. If undefined is returned, no editor override services are used.

createModel

  • Called when the model needs to be fetched. The default implementation attempts to find an existing model for the given URI in the monaco store (monaco.editor.getModel). If it cannot be found, it creates a new model (monaco.editor.createModel). Finally it sets the default value on the model. This method can be used to create a custom when neccessary, with possibly a different URI.

    If you implement this callback, you SHOULD set the initial value (data.value) on the model, it will NOT be set automatically.

    Parameters

    • context: MonacoIframeContext

      The current context object. Note that you should not use it to retrieve the monaco editor instance, as the editor was not created yet.

    • options: ExtenderCreateModelOptions

      Options with the default URI, the current value, and the editor configuration.

    Returns ITextModel | undefined

    The retrieved or created model. When undefined, the default mechanism to create the model ist used.

createWorker

  • Called when a worker for additional language support needs to be created. By default, monaco editor ships with the workers for JSON, CSS, HTML, and TYPESCRIPT. The label is the name of the language, eg. css or javascript. This method must return the worker to be used for the given language.

    Parameters

    • context: MonacoIframeContext

      The current context object. Note that you should not use it to retrieve the monaco editor instance, as the editor was not created yet.

    • moduleId: string

      Module ID for the worker. Useful only with the AMD version, can be ignored.

    • label: string

      Label of the language for which to create the worker.

    Returns Worker

    The worker to be used for the given code language.

Generated using TypeDoc