IToolbar.Interface.IToolbar.md - chrisgurney/obsidian-note-toolbar GitHub Wiki
The IToolbar
interface provides basic API access to toolbars, with more functions to be added.
Properties
id?
optional
id:string
Unique identifier for the toolbar.
Methods
export()
export():
Promise
<null
|string
>
Exports this toolbar to a Note Toolbar callout.
Returns
Promise
<null
| string
>
Toolbar as a callout or null
if the toolbar is undefined.
Example
const toolbars = ntb.getToolbars();
for (let toolbar of toolbars) {
console.log(`\n## ${toolbar.getName()}\n\n`);
console.log(await toolbar.export());
}
See
NtbExport.js
in the examples/Scripts folder.
getName()
getName():
undefined
|string
Gets the name of this toolbar.
Returns
undefined
| string
Name of the toolbar or undefined
if the toolbar is invalid.