@redhat-cloud-services/types 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +20 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -120,6 +120,25 @@ export type ChromeWsPayload<T> = {
|
|
|
120
120
|
export type ChromeWsEventListener<T> = (event: ChromeWsPayload<T>) => void;
|
|
121
121
|
export type UnSubscribeFromChromeWsEvent = () => void;
|
|
122
122
|
export type AddChromeWsEventListener = <T>(type: ChromeWsEventTypes, listener: ChromeWsEventListener<T>) => UnSubscribeFromChromeWsEvent;
|
|
123
|
+
export type SearchDataType = 'legacy' | 'generated';
|
|
124
|
+
export interface SearchEntry {
|
|
125
|
+
id: string;
|
|
126
|
+
title: string;
|
|
127
|
+
description: string;
|
|
128
|
+
uri: string;
|
|
129
|
+
pathname: string;
|
|
130
|
+
bundleTitle: string;
|
|
131
|
+
altTitle?: string[];
|
|
132
|
+
icon?: string;
|
|
133
|
+
type: SearchDataType;
|
|
134
|
+
}
|
|
135
|
+
export interface ChromeSearchAPI {
|
|
136
|
+
fillStore: (type: SearchDataType, data: SearchEntry[]) => Promise<void>;
|
|
137
|
+
query: (term: string, type?: SearchDataType, env?: string, limit?: number) => Promise<SearchEntry[]>;
|
|
138
|
+
getAvailableTypes: () => SearchDataType[];
|
|
139
|
+
clearType: (type: SearchDataType) => Promise<void>;
|
|
140
|
+
getCachedData: (type: SearchDataType) => SearchEntry[] | undefined;
|
|
141
|
+
}
|
|
123
142
|
export type DrawerPanelActions = {
|
|
124
143
|
setDrawerPanelContent: (data: {
|
|
125
144
|
scope: string;
|
|
@@ -255,6 +274,7 @@ export interface ChromeAPI {
|
|
|
255
274
|
enablePackagesDebug: () => void;
|
|
256
275
|
requestPdf: (options: PDFRequestOptions) => Promise<void>;
|
|
257
276
|
drawerActions: DrawerPanelActions;
|
|
277
|
+
search?: ChromeSearchAPI;
|
|
258
278
|
}
|
|
259
279
|
declare global {
|
|
260
280
|
interface Window {
|
package/package.json
CHANGED