Options
All
  • Public
  • Public/Protected
  • All
Menu

The document registry. The namespace for the DocumentRegistry class statics.

Hierarchy

  • DocumentRegistry

Implements

  • IDisposable

Index

Type aliases

Static CodeContext

CodeContext: IContext<ICodeModel>

A type alias for a code context.

Static CodeModelFactory

CodeModelFactory: IModelFactory<ICodeModel>

A type alias for a code model factory.

Static Context

Context: IContext<IModel>

A type alias for a context.

Static ModelFactory

ModelFactory: IModelFactory<IModel>

A type alias for a standard model factory.

Static WidgetExtension

WidgetExtension: IWidgetExtension<Widget, IModel>

A type alias for a standard widget extension.

Static WidgetFactory

A type alias for a standard widget factory.

Constructors

constructor

Properties

Private _changed

_changed: Signal<this, IChangedArgs> = new Signal<this, DocumentRegistry.IChangedArgs>(this)

Private _creators

_creators: IFileCreator[] = []

Private _defaultWidgetFactories

_defaultWidgetFactories: object = Object.create(null)

Type declaration

  • [key: string]: string

Private _defaultWidgetFactory

_defaultWidgetFactory: string = ""

Private _extenders

_extenders: object = Object.create(null)

Type declaration

Private _fileTypes

_fileTypes: IFileType[] = []

Private _isDisposed

_isDisposed: boolean = false

Private _modelFactories

_modelFactories: object = Object.create(null)

Type declaration

Private _widgetFactories

_widgetFactories: object = Object.create(null)

Type declaration

Private _widgetFactoryExtensions

_widgetFactoryExtensions: object = Object.create(null)

Type declaration

  • [key: string]: string[]

Static defaultFileTypes

defaultFileTypes: ReadonlyArray<Partial<IFileType>> = [defaultTextFileType,defaultNotebookFileType,defaultDirectoryFileType,{name: 'markdown',extensions: ['.md'],mimeTypes: ['text/markdown'],iconClass: 'jp-MaterialIcon jp-MarkdownIcon',},{name: 'python',extensions: ['.py'],mimeTypes: ['text/x-python'],iconClass: 'jp-MaterialIcon jp-PythonIcon'},{name: 'json',extensions: ['.json'],mimeTypes: ['application/json', 'application/x-json'],iconClass: 'jp-MaterialIcon jp-JSONIcon'},{name: 'csv',extensions: ['.csv'],mimeTypes: ['text/csv'],iconClass: 'jp-MaterialIcon jp-SpreadsheetIcon'},{name: 'xls',extensions: ['.xls'],iconClass: 'jp-MaterialIcon jp-SpreadsheetIcon'},{name: 'r',mimeTypes: ['text/x-rsrc'],extensions: ['.r'],iconClass: 'jp-MaterialIcon jp-RKernelIcon'},{name: 'yaml',mimeTypes: ['text/x-yaml', 'text/yaml'],extensions: ['.yaml', '.yml'],iconClass: 'jp-MaterialIcon jp-YamlIcon'},{name: 'svg',mimeTypes: ['image/svg+xml'],extensions: ['.svg'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'},{name: 'tiff',mimeTypes: ['image/tiff'],extensions: ['.tif', '.tiff'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'},{name: 'jpeg',mimeTypes: ['image/jpeg'],extensions: ['.jpg', '.jpeg'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'},{name: 'gif',mimeTypes: ['image/gif'],extensions: ['.gif'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'},{name: 'png',mimeTypes: ['image/png'],extensions: ['.png'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'},{name: 'bmp',mimeTypes: ['image/bmp'],extensions: ['.bmp'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'},{name: 'xbm',mimeTypes: ['image/xbm'],extensions: ['.xbm'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'},{name: 'raw',extensions: ['.raw'],iconClass: 'jp-MaterialIcon jp-ImageIcon',fileFormat: 'base64'}]

The default file types used by the document registry.

Accessors

changed

isDisposed

  • get isDisposed(): boolean

Methods

addCreator

  • Add a creator to the registry.

    params

    creator - The file creator object to register.

    Parameters

    Returns IDisposable

    A disposable which will unregister the creator.

addFileType

  • addFileType(fileType: Partial<IFileType>): IDisposable
  • Add a file type to the document registry.

    params

    fileType - The file type object to register.

    Parameters

    Returns IDisposable

    A disposable which will unregister the command.

    Notes

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

addModelFactory

  • Add a model 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, or the given factory is already registered, a warning will be logged and this will be a no-op.

addWidgetExtension

  • addWidgetExtension(widgetName: string, extension: WidgetExtension): IDisposable
  • 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.

addWidgetFactory

  • Add a widget factory to the registry.

    Parameters

    Returns IDisposable

    A disposable which will unregister the factory.

    Notes

    If a factory with the given 'displayName' 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.

creators

defaultWidgetFactory

dispose

  • dispose(): void

fileTypes

getCreator

getFileType

  • getFileType(name: string): IFileType | undefined

getFileTypeForModel

getFileTypesForPath

  • getFileTypesForPath(path: string): IFileType[]

getKernelPreference

  • Get a kernel preference.

    Parameters

    • path: string

      The file path.

    • widgetName: string

      The name of the widget factory.

    • Optional kernel: Partial<IModel>

      An optional existing kernel model.

    Returns IKernelPreference | undefined

    A kernel preference.

getModelFactory

getWidgetFactory

  • getWidgetFactory(widgetName: string): WidgetFactory | undefined

modelFactories

preferredWidgetFactories

  • 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 iterator has widget factories in the following order:

    • path-specific default factory
    • global default factory
    • all other path-specific factories
    • all other global factories

widgetExtensions

  • Create an iterator over the registered extensions for a given widget.

    Parameters

    • widgetName: string

      The name of the widget factory.

    Returns IIterator<WidgetExtension>

    A new iterator over the widget extensions.

widgetFactories

Object literals

Static defaultDirectoryFileType

defaultDirectoryFileType: object

The default directory file type used by the document registry.

contentType

contentType: string = "directory"

extensions

extensions: undefined[] = []

iconClass

iconClass: string = "jp-MaterialIcon jp-OpenFolderIcon"

mimeTypes

mimeTypes: string[] = ['text/directory']

name

name: string = "directory"

Static defaultNotebookFileType

defaultNotebookFileType: object

The default notebook file type used by the document registry.

contentType

contentType: string = "notebook"

extensions

extensions: string[] = ['.ipynb']

fileFormat

fileFormat: string = "json"

iconClass

iconClass: string = "jp-MaterialIcon jp-NotebookIcon"

mimeTypes

mimeTypes: string[] = ['application/x-ipynb+json']

name

name: string = "notebook"

Static defaultTextFileType

defaultTextFileType: object

The default text file type used by the document registry.

extensions

extensions: string[] = ['.txt']

mimeTypes

mimeTypes: string[] = ['text/plain']

name

name: string = "text"

Static fileTypeDefaults

fileTypeDefaults: object

The defaults used for a file type.

contentType

contentType: string = "file"

extensions

extensions: undefined[] = []

fileFormat

fileFormat: string = "text"

iconClass

iconClass: string = "jp-MaterialIcon jp-FileIcon"

iconLabel

iconLabel: string = ""

mimeTypes

mimeTypes: undefined[] = []

name

name: string = "default"

Generated using TypeDoc