Skip to content

ViewRegistry

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:13

Extends

Properties

_

_: Record<string, EventsEntry[]>

Defined in: src/obsidian/augmentations/Events.d.ts:5

Inherited from

Events._


typeByExtension

typeByExtension: ViewRegistryTypeByExtensionRecord

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:17

Mapping of file extensions to view type


viewByType

viewByType: ViewRegistryViewByTypeRecord

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:21

Mapping of view type to view constructor

Methods

getTypeByExtension()

getTypeByExtension(extension): undefined | string

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:28

Get the view type associated with a file extension

Parameters

extension

string

File extension

Returns

undefined | string


getViewCreatorByType()

Call Signature

getViewCreatorByType(type): undefined | ViewCreator

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:29

Parameters
type

string

Returns

undefined | ViewCreator

Call Signature

getViewCreatorByType<TViewType>(type): undefined | TypedViewCreator<ViewTypeViewMapping[TViewType]>

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:33

Get the view constructor associated with a view type

Type Parameters

TViewType extends ViewTypeType

Parameters
type

TViewType

Returns

undefined | TypedViewCreator<ViewTypeViewMapping[TViewType]>


isExtensionRegistered()

isExtensionRegistered(extension): boolean

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:39

Check whether a view type is registered

Parameters

extension

string

Returns

boolean


off()

off(name, callback): void

Defined in: obsidian.d.ts:1441

Parameters

name

string

callback

(…data) => unknown

Returns

void

Inherited from

Events.off


offref()

offref(ref): void

Defined in: obsidian.d.ts:1445

Parameters

ref

EventRef

Returns

void

Inherited from

Events.offref


on()

Call Signature

on(name, callback): EventRef

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:43

Called when the file extensions mapping has been updated

Parameters
name

"extensions-updated"

callback

() => void

Returns

EventRef

Overrides

Events.on

Call Signature

on(name, callback): EventRef

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:47

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

Parameters
name

"view-registered"

callback

(type) => void

Returns

EventRef

Overrides

Events.on

Call Signature

on(name, callback): EventRef

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:51

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

Parameters
name

"view-unregistered"

callback

(type) => void

Returns

EventRef

Overrides

Events.on


registerExtensions()

registerExtensions(extension, type): void

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:59

Register a view type for a file extension

Parameters

extension

string[]

File extension

type

string

View type

Returns

void

registerView()

registerView(type, viewCreator): void

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:63

Register a view constructor for a view type

Parameters

type

string

viewCreator

ViewCreator

Returns

void


registerViewWithExtensions()

registerViewWithExtensions(extensions, type, viewCreator): void

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:67

Register a view and its associated file extensions

Parameters

extensions

string[]

type

string

viewCreator

ViewCreator

Returns

void


trigger()

trigger(name, …data): void

Defined in: obsidian.d.ts:1449

Parameters

name

string

data

unknown[]

Returns

void

Inherited from

Events.trigger


tryTrigger()

tryTrigger(evt, args): void

Defined in: obsidian.d.ts:1453

Parameters

evt

EventRef

args

unknown[]

Returns

void

Inherited from

Events.tryTrigger


unregisterExtensions()

unregisterExtensions(extension): void

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:71

Unregister extensions for a view type

Parameters

extension

string[]

Returns

void


unregisterView()

unregisterView(type): void

Defined in: src/obsidian/internals/ViewRegistry/ViewRegistry.d.ts:75

Unregister a view type

Parameters

type

string

Returns

void