Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IAppProxy

App level APIs

Hierarchy

  • IAppProxy

Index

Properties

onBlockRendererSlotted: IUserSlotHook<{ uuid: string }>
onCurrentGraphChanged: IUserHook<any, IUserOffHook>
onMacroRendererSlotted: IUserSlotHook<{ payload: { arguments: string[]; uuid: string } }>

provide ui slot to block renderer macro for {{renderer arg1, arg2}}

example

https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-pomodoro-timer

example
// e.g. {{renderer :h1, hello world, green}}

logseq.App.onMacroRendererSlotted(({ slot, payload: { arguments } }) => {
let [type, text, color] = arguments
if (type !== ':h1') return
logseq.provideUI({
key: 'h1-playground',
slot, template: `
<h2 style="color: ${color || 'red'}">${text}</h2>
`,
})
})
onPageHeadActionsSlotted: IUserSlotHook<any>
onRouteChanged: IUserHook<{ path: string; template: string }, IUserOffHook>
onSidebarVisibleChanged: IUserHook<{ visible: boolean }, IUserOffHook>
onThemeModeChanged: IUserHook<{ mode: "light" | "dark" }, IUserOffHook>

Methods

  • _installPluginHook(pid: string, hook: string): void
  • _uninstallPluginHook(pid: string, hookOrAll: string | boolean): void
  • execGitCommand(args: string[]): Promise<string>
  • getInfo(key?: string | number): Promise<any>
  • added

    0.0.4

    Parameters

    • Optional key: string | number

    Returns Promise<any>

  • getStateFromStore<T>(path: string | string[]): Promise<T>
  • openExternalLink(url: string): Promise<void>
  • pushState(k: string, params?: Record<string, any>, query?: Record<string, any>): void
  • Parameters

    • k: string
    • Optional params: Record<string, any>
    • Optional query: Record<string, any>

    Returns void

  • queryElementById(id: string): Promise<string | boolean>
  • queryElementRect(selector: string): Promise<DOMRectReadOnly>
  • added

    0.0.5

    Parameters

    • selector: string

    Returns Promise<DOMRectReadOnly>

  • quit(): Promise<void>
  • registerPageMenuItem(tag: string, action: (e: IHookEvent & { page: string }) => void): void
  • registerUIItem(type: "toolbar" | "pagebar", opts: { key: string; template: string }): void
  • Parameters

    • type: "toolbar" | "pagebar"
    • opts: { key: string; template: string }
      • key: string
      • template: string

    Returns void

  • relaunch(): Promise<void>
  • replaceState(k: string, params?: Record<string, any>, query?: Record<string, any>): void
  • Parameters

    • k: string
    • Optional params: Record<string, any>
    • Optional query: Record<string, any>

    Returns void

  • setFullScreen(flag: boolean | "toggle"): void
  • setLeftSidebarVisible(flag: boolean | "toggle"): void
  • setRightSidebarVisible(flag: boolean | "toggle"): void
  • setZoomFactor(factor: number): void
  • showMsg(content: string, status?: string): void
  • deprecated

    Parameters

    • content: string
    • Optional status: string

    Returns void

Generated using TypeDoc