Interface ExtensionModule

interface ExtensionModule {
    apps?: App[];
    icon: string;
    initialize?: ((settings: Record<string, any>) => void);
    initializeAsync?: ((callback: ((data: unknown) => void), settings: Record<string, any>) => Promise<void>);
    name: string;
    onMessage?: ((data: unknown) => void);
    run: ((context: ExtensionContext) => Promise<void>);
    settings?: Record<string, Setting>;
}

Properties

apps?: App[]

A list of apps that the extension provides.

Apps are a way to group multiple extension results together. They are shown in a separate page with a private results list.

icon: string

A base64 encoded string of the icon for the extension.

initialize?: ((settings: Record<string, any>) => void)

A function that will be called when the extension is initialized. It will be called synchronously, before the extension is executed.

For long running tasks, use initializeAsync instead.

initializeAsync?: ((callback: ((data: unknown) => void), settings: Record<string, any>) => Promise<void>)

Type declaration

    • (callback, settings): Promise<void>
    • Parameters

      • callback: ((data: unknown) => void)

        The function you can use to send data to the onMessage method.

          • (data): void
          • Parameters

            • data: unknown

            Returns void

      • settings: Record<string, any>

        The user settings for the extension.

      Returns Promise<void>

name: string

The name of the extension.

This name will be displayed in the extension list, and will be used to identify the extension in the settings.

onMessage?: ((data: unknown) => void)

This method will be called when the initializeAsync method calls the callback. This is useful to retrieve data for the extension after performing long running tasks.

Type declaration

    • (data): void
    • Parameters

      Returns void

run: ((context: ExtensionContext) => Promise<void>)

The entry point for the extension. This function will be called to execute the extension.

settings?: Record<string, Setting>

The settings for the extension.

This is a WIP, and will be used to provide the extension with settings from the user.