Skip to content

ViewRegistry

Extends

Properties

_

_: Record<string, EventsEntry[]>

Inherited from

Events._


typeByExtension

typeByExtension: ViewRegistryTypeByExtensionRecord

Mapping of file extensions to view type


viewByType

viewByType: ViewRegistryViewByTypeRecord

Mapping of view type to view constructor

Methods

getTypeByExtension()

getTypeByExtension(extension): string

Get the view type associated with a file extension

Parameters

extension: string

File extension

Returns

string


getViewCreatorByType()

getViewCreatorByType(type): (leaf) => View

Get the view constructor associated with a view type

Parameters

type: string

Returns

Function

Parameters

leaf: WorkspaceLeaf

Returns

View


isExtensionRegistered()

isExtensionRegistered(extension): boolean

Check whether a view type is registered

Parameters

extension: string

Returns

boolean


off()

off(name, callback): void

Parameters

name: string

callback

Returns

void

Inherited from

Events.off


offref()

offref(ref): void

Parameters

ref: EventRef

Returns

void

Inherited from

Events.offref


on()

on(name, callback)

on(name, callback): EventRef

Called when the file extensions mapping has been updated

Parameters

name: "extensions-updated"

callback

Returns

EventRef

Overrides

Events.on

on(name, callback)

on(name, callback): EventRef

Called when a view of type has been registered into the registry

Parameters

name: "view-registered"

callback

Returns

EventRef

Overrides

Events.on

on(name, callback)

on(name, callback): EventRef

Called when a view of type has been unregistered from the registry

Parameters

name: "view-unregistered"

callback

Returns

EventRef

Overrides

Events.on


registerExtensions()

registerExtensions(extension, type): void

Register a view type for a file extension

Parameters

extension: string[]

File extension

type: string

View type

Returns

void


registerView()

registerView(type, viewCreator): void

Register a view constructor for a view type

Parameters

type: string

viewCreator

Returns

void


registerViewWithExtensions()

registerViewWithExtensions(extensions, type, viewCreator): void

Register a view and its associated file extensions

Parameters

extensions: string[]

type: string

viewCreator

Returns

void


trigger()

trigger(name, …data): void

Parameters

name: string

• …data: unknown[]

Returns

void

Inherited from

Events.trigger


tryTrigger()

tryTrigger(evt, args): void

Parameters

evt: EventRef

args: unknown[]

Returns

void

Inherited from

Events.tryTrigger


unregisterExtensions()

unregisterExtensions(extension): void

Unregister extensions for a view type

Parameters

extension: string[]

Returns

void


unregisterView()

unregisterView(type): void

Unregister a view type

Parameters

type: string

Returns

void