Skip to content

MetadataEditorProperty

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:11

Extends

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


app

app: App

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:15

Reference to the app


containerEl

containerEl: HTMLElement

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:19

Container element for the metadata editor property


entry

entry: PropertyEntryData<unknown>

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:23

Entry information for the property


iconEl

iconEl: HTMLSpanElement

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:27

Icon element of the property


keyEl

keyEl: HTMLElement

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:31

Key value of the property


keyInputEl

keyInputEl: HTMLInputElement

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:35

Input field for key value of the property


metadataEditor

metadataEditor: MetadataEditor

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

Metadata editor the property is attached to


rendered

rendered: null | MetadataWidget

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

Widget that handles user input for this property widget type


typeInfo

typeInfo: object

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

Info about the inferred and expected property widget given key-value pair

expected

expected: PropertyWidget<unknown>

inferred

inferred: PropertyWidget<unknown>


valueEl

valueEl: HTMLElement

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

Element that contains the value input or widget


warningEl

warningEl: HTMLElement

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:55

Element containing the displayed warning on malformed property field

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


focusKey()

focusKey(): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:60

Focus on the key input element

Returns

void


focusProperty()

focusProperty(): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:64

Focus on the property (container element)

Returns

void


focusValue()

focusValue(which?): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:68

Focus on the value input element

Parameters

which?

"both" | "end" | "start"

Returns

void


handleItemClick()

handleItemClick(event): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:72

Reveal the property menu on click event

Parameters

event

MouseEvent

Returns

void


handlePropertyBlur()

handlePropertyBlur(): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:76

Focus on property on blur event

Returns

void


handleUpdateKey()

handleUpdateKey(key): boolean

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:80

Update key of property and saves, returns false if error

Parameters

key

string

Returns

boolean


handleUpdateValue()

handleUpdateValue(value): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:84

Update value of property and saves

Parameters

value

unknown

Returns

void


load()

load(): void

Defined in: obsidian.d.ts:865

Load this component and its children

Returns

void

Inherited from

Component.load


onload()

onload(): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:88

Loads as draggable property element

Returns

void

Overrides

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


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


registerScopeEvent()

registerScopeEvent(keymapEventHandler): void

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

Parameters

keymapEventHandler

KeymapEventHandler

Returns

void

Inherited from

Component.registerScopeEvent


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


renderProperty()

renderProperty(entry, check_errors?, use_expected_type?): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:92

Render property widget based on type

Parameters

entry

PropertyEntryData<unknown>

check_errors?

boolean

use_expected_type?

boolean

Returns

void


setSelected()

setSelected(selected): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:96

Set the selected class of property

Parameters

selected

boolean

Returns

void


showPropertyMenu()

showPropertyMenu(event): void

Defined in: src/obsidian/internals/MetadataEditorProperty.d.ts:100

Reveal property selection menu at mouse event

Parameters

event

MouseEvent

Returns

void


unload()

unload(): void

Defined in: obsidian.d.ts:876

Unload this component and its children

Returns

void

Inherited from

Component.unload