Duplex message caller
Connection status with the main app
Optional settingsThe plugin user settings
Rest ...args: any[]Optional context: anyCalls each of the listeners registered for a given event.
Rest ...args: any[]Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Optional fn: ((...args: any[]) => void)Rest ...args: any[]Optional context: anyOptional once: booleanAdd a listener for a given event.
Rest ...args: any[]Optional context: anyAdd a one-time listener for a given event.
Rest ...args: any[]Optional context: anyCreate a object to hold the methods referenced in provideUI
logseq.provideModel({
openCalendar () {
console.log('Open the calendar!')
}
})
Inject custom css for the main Logseq app
https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-awesome-fonts
logseq.provideStyle(`
@import url("https://at.alicdn.com/t/font_2409735_r7em724douf.css");
)
Set the theme for the main Logseq app
Inject custom UI at specific DOM node.
Event handlers can not be passed by string, so you need to create them in provideModel
https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-a-translator
logseq.provideUI({
key: 'open-calendar',
path: '#search',
template: `
<a data-on-click="openCalendar" onclick="alert('abc')' style="opacity: .6; display: inline-flex; padding-left: 3px;'>
<i class="iconfont icon-Calendaralt2"></i>
</a>
`
})
The main Logseq app is ready to run the plugin
Optional model: Record<string, any>same as the model in provideModel
Optional callback: ((e: any) => void | {})a function to run when the main Logseq app is ready
Optional model: Record<string, any>Optional callback: ((e: any) => void | {})Remove all listeners, or those of the specified event.
Optional event: LSPluginUserEventsRemove the listeners of a given event.
Optional fn: ((...args: any[]) => void)Rest ...args: any[]Optional context: anyOptional once: booleanSet the style for the plugin's UI
https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-awesome-fonts
logseq.setMainUIInlineStyle({
position: 'fixed',
zIndex: 11,
})
https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-awesome-fonts
Generated using TypeDoc
The plugin configurations from package.json