Skip to content

InternalPlugin

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:17

Extends

Extended by

Type Parameters

InternalPluginInstance

Properties

_children

_children: Component[]

Defined in: src/obsidian/augmentations/Components/Component.d.ts:9

Child Components attached to current component, will be unloaded on unloading parent component

Inherited from

Component._children


_events

_events: EventRef[]

Defined in: src/obsidian/augmentations/Components/Component.d.ts:13

Events that are attached to the current component, will be detached on unloading parent component

Inherited from

Component._events


_loaded

_loaded: boolean

Defined in: src/obsidian/augmentations/Components/Component.d.ts:17

Whether the component and its children are loaded

Inherited from

Component._loaded


addedButtonEls

addedButtonEls: HTMLDivElement[]

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:18


app

app: App

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:19


commands

commands: Command[]

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:20


enabled

enabled: boolean

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:21


hasStatusBarItem

hasStatusBarItem: boolean

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:22


instance

instance: InternalPluginInstance

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:23


lastSave

lastSave: number

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:24


manager

manager: InternalPlugins

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:25


mobileFileInfo

mobileFileInfo: MobileFileInfo[]

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:26


onConfigFileChange

onConfigFileChange: Debouncer<[], Promise<void>>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:27


ribbonItems

ribbonItems: RibbonItem[]

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:28


statusBarEl

statusBarEl: null | HTMLDivElement

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:29


views

views: Record<string, ViewCreator>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:30

Methods

addChild()

addChild<T>(component): T

Defined in: obsidian.d.ts:887

Adds a child component, loading it if this component is loaded

Type Parameters

T extends Component

Parameters

component

T

Returns

T

Inherited from

Component.addChild


addSettingTab()

addSettingTab(settingTab): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:32

Parameters

settingTab

PluginSettingTab

Returns

void


deleteData()

deleteData(): Promise<void>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:33

Returns

Promise<void>


disable()

disable(isDisabledByUser?): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:34

Parameters

isDisabledByUser?

boolean

Returns

void


enable()

enable(isEnabledByUser?): Promise<void>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:35

Parameters

isEnabledByUser?

boolean

Returns

Promise<void>


getModifiedTime()

getModifiedTime(): Promise<undefined | number>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:36

Returns

Promise<undefined | number>


handleConfigFileChange()

handleConfigFileChange(): Promise<void>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:37

Returns

Promise<void>


init()

init(): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:38

Returns

void


load()

load(): void

Defined in: obsidian.d.ts:865

Load this component and its children

Returns

void

Inherited from

Component.load


loadData()

loadData(): Promise<null | object>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:39

Returns

Promise<null | object>


onload()

onload(): void

Defined in: obsidian.d.ts:871

Override this to load your component

Returns

void

Inherited from

Component.onload


onunload()

onunload(): void

Defined in: obsidian.d.ts:882

Override this to unload your component

Returns

void

Inherited from

Component.onunload


register()

register(cb): void

Defined in: obsidian.d.ts:897

Registers a callback to be called when unloading

Parameters

cb

() => any

Returns

void

Inherited from

Component.register


registerDomEvent()

Call Signature

registerDomEvent<K>(el, type, callback, options?): void

Defined in: obsidian.d.ts:907

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof WindowEventMap

Parameters
el

Window

type

K

callback

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

Component.registerDomEvent

Call Signature

registerDomEvent<K>(el, type, callback, options?): void

Defined in: obsidian.d.ts:912

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof DocumentEventMap

Parameters
el

Document

type

K

callback

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

Component.registerDomEvent

Call Signature

registerDomEvent<K>(el, type, callback, options?): void

Defined in: obsidian.d.ts:917

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof HTMLElementEventMap

Parameters
el

HTMLElement

type

K

callback

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

Component.registerDomEvent


registerEvent()

registerEvent(eventRef): void

Defined in: obsidian.d.ts:902

Registers an event to be detached when unloading

Parameters

eventRef

EventRef

Returns

void

Inherited from

Component.registerEvent


registerGlobalCommand()

registerGlobalCommand(command): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:40

Parameters

command

Command

Returns

void


registerInterval()

registerInterval(id): number

Defined in: obsidian.d.ts:924

Registers an interval (from setInterval) to be cancelled when unloading Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API

Parameters

id

number

Returns

number

Inherited from

Component.registerInterval


registerMobileFileInfo()

registerMobileFileInfo(renderCallback): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:41

Parameters

renderCallback

(el) => void

Returns

void


registerRibbonItem()

registerRibbonItem(title, icon, callback): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:42

Parameters

title

string

icon

string

callback

() => Promise<void>

Returns

void


registerScopeEvent()

registerScopeEvent(keymapEventHandler): void

Defined in: src/obsidian/augmentations/Components/Component.d.ts:19

Parameters

keymapEventHandler

KeymapEventHandler

Returns

void

Inherited from

Component.registerScopeEvent


registerStatusBarItem()

registerStatusBarItem(): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:43

Returns

void


registerViewType()

registerViewType(type, creator): void

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:44

Parameters

type

string

creator

ViewCreator

Returns

void


removeChild()

removeChild<T>(component): T

Defined in: obsidian.d.ts:892

Removes a child component, unloading it

Type Parameters

T extends Component

Parameters

component

T

Returns

T

Inherited from

Component.removeChild


saveData()

saveData(data): Promise<void>

Defined in: src/obsidian/internals/InternalPlugins/InternalPlugin.d.ts:45

Parameters

data

object

Returns

Promise<void>


unload()

unload(): void

Defined in: obsidian.d.ts:876

Unload this component and its children

Returns

void

Inherited from

Component.unload