Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ILSPluginUser

Hierarchy

Implemented by

Index

Properties

App: IAppProxy & Record<string, any>
Editor: IEditorProxy & Record<string, any>
Experiments: LSPluginExperiments
FileStorage: LSPluginFileStorage

The plugin configurations from package.json

caller: LSPluginCaller

Duplex message caller

connected: boolean

Connection status with the main app

isMainUIVisible: boolean
settings?: { disabled: boolean }

The plugin user settings

Type declaration

  • [key: string]: any
  • disabled: boolean

Methods

  • addListener<T>(event: T, fn: (...args: any[]) => void, context?: any): ILSPluginUser
  • Type parameters

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns ILSPluginUser

  • beforeunload(callback: () => Promise<void>): void
  • Parameters

    • callback: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    Returns void

  • emit<T>(event: T, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Type parameters

    Parameters

    • event: T
    • Rest ...args: any[]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns LSPluginUserEvents[]

  • hideMainUI(opts?: { restoreEditingCursor: boolean }): void
  • hide the plugin's UI

    Parameters

    • Optional opts: { restoreEditingCursor: boolean }
      • restoreEditingCursor: boolean

    Returns void

  • hideSettingsUI(): void
  • Return the number of listeners listening to a given event.

    Parameters

    Returns number

  • listeners<T>(event: T): ((...args: any[]) => void)[]
  • Return the listeners registered for a given event.

    Type parameters

    Parameters

    • event: T

    Returns ((...args: any[]) => void)[]

  • off<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): ILSPluginUser
  • Type parameters

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns ILSPluginUser

  • on<T>(event: T, fn: (...args: any[]) => void, context?: any): ILSPluginUser
  • Add a listener for a given event.

    Type parameters

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns ILSPluginUser

  • onSettingsChanged<T>(cb: (a: T, b: T) => void): IUserOffHook
  • once<T>(event: T, fn: (...args: any[]) => void, context?: any): ILSPluginUser
  • Add a one-time listener for a given event.

    Type parameters

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns ILSPluginUser

  • Create a object to hold the methods referenced in provideUI

    example
    logseq.provideModel({
    openCalendar () {
    console.log('Open the calendar!')
    }
    })

    Parameters

    • model: Record<string, any>

    Returns ILSPluginUser

  • ready(model?: Record<string, any>): Promise<any>
  • ready(callback?: (e: any) => void | {}): Promise<any>
  • ready(model?: Record<string, any>, callback?: (e: any) => void | {}): Promise<any>
  • The main Logseq app is ready to run the plugin

    Parameters

    • Optional model: Record<string, any>

      same as the model in provideModel

    Returns Promise<any>

  • Parameters

    • Optional callback: (e: any) => void | {}

      a function to run when the main Logseq app is ready

        • (e: any): void | {}
        • Parameters

          • e: any

          Returns void | {}

    Returns Promise<any>

  • Parameters

    • Optional model: Record<string, any>
    • Optional callback: (e: any) => void | {}
        • (e: any): void | {}
        • Parameters

          • e: any

          Returns void | {}

    Returns Promise<any>

  • Remove all listeners, or those of the specified event.

    Parameters

    Returns ILSPluginUser

  • removeListener<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): ILSPluginUser
  • Remove the listeners of a given event.

    Type parameters

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns ILSPluginUser

  • resolveResourceFullUrl(filePath: string): string
  • setMainUIAttrs(attrs: Record<string, any>): void
  • setMainUIInlineStyle(style: Properties<0 | (string & {}), string & {}>): void
  • showMainUI(opts?: { autoFocus: boolean }): void
  • show the plugin's UI

    Parameters

    • Optional opts: { autoFocus: boolean }
      • autoFocus: boolean

    Returns void

  • showSettingsUI(): void
  • toggleMainUI(): void
  • updateSettings(attrs: Record<string, any>): void

Generated using TypeDoc