mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-02 16:15:39 +00:00
Merge pull request #1338 from HOLOEYE-JZ/feat/plugin-search-results
This commit is contained in:
+21
-7
@@ -1199,19 +1199,33 @@ export interface ConflictWarning {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returned by onProvideSearchResults transform handlers. Plugins extend the
|
||||
* initial array with their own results (CRM hits, Slack messages, etc.).
|
||||
* The host renders these in a grouped section below native email results.
|
||||
* Returned by onProvideSearchResults handlers: results from elsewhere (CRM
|
||||
* hits, chat messages, ...) for the search that is running. The host draws
|
||||
* them as a block above the search's message list, grouped by `source`.
|
||||
* A click on an entry that names a message the user can reach (`email`)
|
||||
* opens it in the reader, as a click on a row of the list does. Any other
|
||||
* click reaches the plugin that returned the entry as `onAction`, with
|
||||
* `surface: 'search-results'`, the entry's `key` as `actionId` and the
|
||||
* search's `query` in the context. Plain text only; see
|
||||
* lib/plugin-search-results.ts for the limits.
|
||||
*/
|
||||
export interface ExternalSearchResult {
|
||||
/** Stable unique key */
|
||||
/** Unique among the plugin's entries for this search; comes back as actionId. */
|
||||
key: string;
|
||||
title: string;
|
||||
snippet: string;
|
||||
/** Plugin-handled action when the result row is clicked */
|
||||
onClick: () => void;
|
||||
/** Optional source label, e.g. "Slack", "Notion" */
|
||||
/** Group heading, e.g. "CRM", "Slack"; the plugin's name when missing. */
|
||||
source?: string;
|
||||
/** The message the entry stands for, opened in the reader on a click. */
|
||||
email?: SearchResultEmail;
|
||||
}
|
||||
|
||||
/** A message named by a search result. */
|
||||
export interface SearchResultEmail {
|
||||
/** The message's JMAP id. */
|
||||
id: string;
|
||||
/** The JMAP account holding it (a shared or group account); the signed-in account's own when missing. */
|
||||
accountId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user