package openidea:plugin@1.0.0; /// Writes to the IDE log, tagged with the plugin id. interface log { use types.{log-level}; log: func(level: log-level, message: string); } interface ui { use types.{notification-level}; record status-item { text: string, tooltip: option, /// One of the plugin's commands, run when the item is clicked. command: option, } /// Shows a notification balloon in the window the current command or /// event came from (every window when there is none). show-notification: func(level: notification-level, title: string, body: string); /// Shows or updates the plugin's status bar item `id` in every window. set-status-item: func(id: string, item: status-item); remove-status-item: func(id: string); } /// Persistent key-value storage of the plugin (survives restarts and idle /// reclaim; instance memory does not). Requires `storage`. At most 1 MiB. interface storage { use types.{error}; get: func(key: string) -> result, error>; set: func(key: string, value: string) -> result<_, error>; delete: func(key: string) -> result<_, error>; /// Keys starting with `prefix`, sorted. keys: func(prefix: string) -> result, error>; }