The document registry.

Implements

Constructors

Properties

_defaultRenderedWidgetFactories: {
    [key: string]: string;
} = ...

Type declaration

  • [key: string]: string
_defaultWidgetFactories: {
    [key: string]: string;
} = ...

Type declaration

  • [key: string]: string
_defaultWidgetFactory: string = ''
_defaultWidgetFactoryOverrides: {
    [key: string]: string;
} = ...

Type declaration

  • [key: string]: string
_extenders: {
    [key: string]: WidgetExtension[];
} = ...

Type declaration

_fileTypes: DocumentRegistry.IFileType[] = []
_isDisposed: boolean = false
_modelFactories: {
    [key: string]: DocumentRegistry.ModelFactory;
} = ...

Type declaration

_widgetFactories: {
    [key: string]: WidgetFactory;
} = ...

Type declaration

_widgetFactoriesForFileType: {
    [key: string]: string[];
} = ...

Type declaration

  • [key: string]: string[]
translator: ITranslator

Accessors

Methods

  • Add a file type to the document registry.

    Parameters

    Returns IDisposable

    A disposable which will unregister the command.

    Notes

    These are used to populate the "Create New" dialog.

    If no default factory exists for the file type, the first factory will be defined as default factory.

  • Add a widget extension to the registry.

    Parameters

    • widgetName: string

      The name of the widget factory.

    • extension: WidgetExtension

      A widget extension.

    Returns IDisposable

    A disposable which will unregister the extension.

    Notes

    If the extension is already registered for the given widget name, a warning will be logged and this will be a no-op.

  • Add a widget factory to the registry.

    Parameters

    Returns IDisposable

    A disposable which will unregister the factory.

    Notes

    If a factory with the given 'name' is already registered, a warning will be logged, and this will be a no-op. If '*' is given as a default extension, the factory will be registered as the global default. If an extension or global default is already registered, this factory will override the existing default. The factory cannot be named an empty string or the string 'default'.

  • Get the default rendered widget factory for a path.

    Parameters

    • path: string

      The path to for which to find a widget factory.

    Returns WidgetFactory

    The default rendered widget factory for the path.

    Notes

    If the widget factory has registered a separate set of defaultRendered file types and there is a match in that set, this returns that. Otherwise, this returns the same widget factory as [[defaultWidgetFactory]].

    The user setting defaultViewers took precedence on this one too.

  • Get a list of the preferred widget factories.

    Parameters

    • path: string

      The file path to filter the results.

    Returns WidgetFactory[]

    A new array of widget factories.

    Notes

    Only the widget factories whose associated model factory have been registered will be returned. The first item is considered the default. The returned array has widget factories in the following order:

    • path-specific default factory
    • path-specific default rendered factory
    • global default factory
    • all other path-specific factories
    • all other global factories
  • Set overrides for the default widget factory for a file type.

    Normally, a widget factory informs the document registry which file types it should be the default for using the defaultFor option in the IWidgetFactoryOptions. This function can be used to override that after the fact.

    Parameters

    • fileType: string

      The name of the file type.

    • factory: undefined | string

      The name of the factory.

      Notes

      If factory is undefined, then any override will be unset, and the default factory will revert to the original value.

      If factory or fileType are not known to the docregistry, or if factory cannot open files of type fileType, this will throw an error.

    Returns void