@openfin/workspace-platform 4.3.0 → 4.7.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.
Files changed (102) hide show
  1. package/client-api/src/shapes.d.ts +596 -0
  2. package/{index.ts → client-api-platform/index.d.ts} +0 -0
  3. package/client-api-platform/src/api/app-directory.d.ts +7 -0
  4. package/client-api-platform/src/api/browser/browser-module.d.ts +13 -0
  5. package/client-api-platform/src/api/browser/index.d.ts +22 -0
  6. package/client-api-platform/src/api/pages/helper.d.ts +22 -0
  7. package/client-api-platform/src/api/pages/index.d.ts +30 -0
  8. package/client-api-platform/src/api/protocol.d.ts +48 -0
  9. package/client-api-platform/src/api/storage.d.ts +10 -0
  10. package/client-api-platform/src/api/theming.d.ts +5 -0
  11. package/client-api-platform/src/api/workspace-module.d.ts +3 -0
  12. package/client-api-platform/src/index.d.ts +6 -0
  13. package/client-api-platform/src/init/browser-window-focus.d.ts +19 -0
  14. package/client-api-platform/src/init/cleanup.d.ts +1 -0
  15. package/client-api-platform/src/init/index.d.ts +5 -0
  16. package/client-api-platform/src/init/override-callback.d.ts +3 -0
  17. package/client-api-platform/src/init/theming.d.ts +9 -0
  18. package/client-api-platform/src/init/utils.d.ts +39 -0
  19. package/client-api-platform/src/shapes.d.ts +278 -0
  20. package/client-api-platform/src/umd.d.ts +1 -0
  21. package/common/src/api/pages/attached.d.ts +101 -0
  22. package/common/src/api/pages/idb.d.ts +12 -0
  23. package/common/src/api/pages/index.d.ts +16 -0
  24. package/common/src/api/pages/legacy.d.ts +16 -0
  25. package/common/src/api/pages/shapes.d.ts +77 -0
  26. package/common/src/api/protocol.d.ts +63 -0
  27. package/common/src/api/theming.d.ts +60 -0
  28. package/common/src/api/workspaces/index.d.ts +7 -0
  29. package/common/src/utils/application.d.ts +38 -0
  30. package/common/src/utils/channels.d.ts +8 -0
  31. package/common/src/utils/debounce.d.ts +16 -0
  32. package/common/src/utils/env.d.ts +30 -0
  33. package/common/src/utils/layout.d.ts +52 -0
  34. package/common/src/utils/local-storage-key.d.ts +8 -0
  35. package/common/src/utils/logger/index.d.ts +26 -0
  36. package/common/src/utils/logger/manager.d.ts +35 -0
  37. package/common/src/utils/logger/shapes.d.ts +27 -0
  38. package/common/src/utils/route.d.ts +55 -0
  39. package/common/src/utils/shared-emitter.d.ts +10 -0
  40. package/common/src/utils/snapshot.d.ts +33 -0
  41. package/common/src/utils/strings.d.ts +5 -0
  42. package/common/src/utils/theming.d.ts +57 -0
  43. package/common/src/utils/umd.d.ts +2 -0
  44. package/common/src/utils/window.d.ts +146 -0
  45. package/index.d.ts +1 -0
  46. package/index.js +2 -0
  47. package/index.js.map +1 -0
  48. package/package.json +1 -34
  49. package/search-api/src/client/index.d.ts +6 -0
  50. package/search-api/src/client/internal.d.ts +38 -0
  51. package/search-api/src/client/remote/channel-client-factory.d.ts +2 -0
  52. package/search-api/src/client/remote/channel-client.d.ts +9 -0
  53. package/search-api/src/client/remote/data.d.ts +16 -0
  54. package/search-api/src/client/remote/disconnect.d.ts +7 -0
  55. package/search-api/src/client/remote/dispatch.d.ts +9 -0
  56. package/search-api/src/client/remote/requests.d.ts +5 -0
  57. package/search-api/src/client/remote/search-close.d.ts +14 -0
  58. package/search-api/src/common.d.ts +104 -0
  59. package/search-api/src/errors.d.ts +5 -0
  60. package/search-api/src/fin/index.d.ts +6 -0
  61. package/search-api/src/fin/shapes.d.ts +23 -0
  62. package/search-api/src/index.d.ts +7 -0
  63. package/search-api/src/internal-shapes.d.ts +134 -0
  64. package/search-api/src/logger.d.ts +1 -0
  65. package/search-api/src/provider/index.d.ts +8 -0
  66. package/search-api/src/provider/internal.d.ts +33 -0
  67. package/search-api/src/provider/remote/channel-factory.d.ts +6 -0
  68. package/search-api/src/provider/remote/channel.d.ts +23 -0
  69. package/search-api/src/provider/remote/connection.d.ts +20 -0
  70. package/search-api/src/provider/remote/data.d.ts +23 -0
  71. package/search-api/src/provider/remote/deregistration.d.ts +5 -0
  72. package/search-api/src/provider/remote/disconnect.d.ts +1 -0
  73. package/search-api/src/provider/remote/disconnection.d.ts +9 -0
  74. package/search-api/src/provider/remote/dispatch.d.ts +7 -0
  75. package/search-api/src/provider/remote/info.d.ts +5 -0
  76. package/search-api/src/provider/remote/registration.d.ts +23 -0
  77. package/search-api/src/provider/remote/search-close.d.ts +14 -0
  78. package/search-api/src/provider/remote/search.d.ts +8 -0
  79. package/search-api/src/shapes.d.ts +541 -0
  80. package/.eslintignore +0 -1
  81. package/.eslintrc.js +0 -2
  82. package/.prettierrc.js +0 -2
  83. package/babel.config.js +0 -2
  84. package/jest.config.js +0 -2
  85. package/src/api/app-directory.ts +0 -45
  86. package/src/api/browser/browser-module.ts +0 -65
  87. package/src/api/browser/index.ts +0 -46
  88. package/src/api/pages/helper.ts +0 -113
  89. package/src/api/pages/index.ts +0 -164
  90. package/src/api/protocol.ts +0 -60
  91. package/src/api/storage.ts +0 -32
  92. package/src/api/workspace-module.ts +0 -36
  93. package/src/index.ts +0 -35
  94. package/src/init/browser-window-focus.ts +0 -59
  95. package/src/init/cleanup.ts +0 -87
  96. package/src/init/index.ts +0 -42
  97. package/src/init/override-callback.ts +0 -159
  98. package/src/init/utils.ts +0 -164
  99. package/src/shapes.ts +0 -160
  100. package/src/umd.ts +0 -5
  101. package/tsconfig.json +0 -13
  102. package/webpack.common.config.js +0 -1
@@ -0,0 +1,104 @@
1
+ import { InternalSearchListenerRequest, InternalSearchListenerResponse } from './internal-shapes';
2
+ import { Action, DeregisterListener, DispatchedSearchResult, Identity, RegisterListener, ScoreOrder, SearchProvider, SearchRequest, SearchResult } from './shapes';
3
+ export declare const defaultSearchTopic = "all";
4
+ /**
5
+ * The stream id that data is requested and transported back to the creator of a search topic on.
6
+ */
7
+ export declare const remoteProviderDataStreamId = "0";
8
+ /**
9
+ * The stream id that handles search request to the creator of a search topic from remote client like views.
10
+ */
11
+ export declare const remoteClientSearchStreamId = "1";
12
+ /**
13
+ * The stream id for registering a remote search provider with the creator of a search topic.
14
+ */
15
+ export declare const remoteProviderRegistrationStreamId = "2";
16
+ /**
17
+ * The stream id for deregistering a remote search provider with the creator of a search topic.
18
+ */
19
+ export declare const remoteProviderDeregistrationStreamId = "3";
20
+ /**
21
+ * The stream id for sharing remote search provider information with the creator of a search topic.
22
+ */
23
+ export declare const remoteProviderInfoStreamId = "4";
24
+ /**
25
+ * The stream id for dispatching search results back to a remote search provider.
26
+ */
27
+ export declare const remoteProviderDispatchStreamId = "5";
28
+ /**
29
+ * The stream id for notifying remote search providers that the request have closed.
30
+ */
31
+ export declare const remoteSearchCloseStreamId = "6";
32
+ export declare const noop: () => void;
33
+ /**
34
+ * Apply given namespace to topic.
35
+ * @param namespace the namespace to apply.
36
+ * @param topicId the original topic id.
37
+ */
38
+ export declare function getNamespacedTopic(namespace: string, topicId: string): string;
39
+ /**
40
+ * Get the channel name for search topic.
41
+ * @param namespacedTopic the namespaced search topic id.
42
+ */
43
+ export declare function getTopicChannelName(namespacedTopic: string): string;
44
+ export declare function addRegisterListener(namespacedTopic: string, listener: RegisterListener): void;
45
+ export declare function removeRegisterListener(namespacedTopic: string, listener: RegisterListener): void;
46
+ export declare function addDeregisterListener(namespacedTopic: string, listener: DeregisterListener): void;
47
+ export declare function removeDeregisterListener(namespacedTopic: string, listener: DeregisterListener): void;
48
+ /**
49
+ * Add a provider.
50
+ * @param namespacedTopic the namespaced search topic to register the provider on.
51
+ * @param provider the search provider to register.
52
+ */
53
+ export declare function addProvider(namespacedTopic: string, provider: SearchProvider): void;
54
+ /**
55
+ * Remove a provider.
56
+ * @param namespacedTopic the namespaced search topic of the provider.
57
+ * @param id the id of the provider.
58
+ */
59
+ export declare function removeProvider(namespacedTopic: string, id: string): void;
60
+ /**
61
+ * Get all providers for a topic.
62
+ * @param namespacedTopic the namespaced search topic.
63
+ */
64
+ export declare function getProviders(namespacedTopic: string): SearchProvider[];
65
+ /**
66
+ * Clears all search providers for a search topic.
67
+ * @param namespacedTopic the namespaced search topic.
68
+ */
69
+ export declare function clearProviders(namespacedTopic: string): void;
70
+ /**
71
+ * Get a provider for a topic.
72
+ * @param namespacedTopic the namespaced search topic that the provider is registered on.
73
+ * @param name the name of the search provider.
74
+ */
75
+ export declare function getProvider(namespacedTopic: string, id: string): SearchProvider | null;
76
+ /**
77
+ * Make a dispatched search result.
78
+ * @param result the original search result.
79
+ * @param action the action this search result is dispatched with.
80
+ */
81
+ export declare function makeDispatchedSearchResult(result: SearchResult, dispatcherIdentity: Identity, actionParam?: Action): DispatchedSearchResult;
82
+ /**
83
+ * Algorithm for aggregating search results.
84
+ *
85
+ * Any search results in the old set of results will be replaced with
86
+ * new search results if their `key` field matches.
87
+ *
88
+ * The array will then be sorted by `score`.
89
+ */
90
+ export declare function aggregate(oldResultsParam: SearchResult[], newResults: SearchResult[], order?: ScoreOrder): SearchResult[];
91
+ /**
92
+ * Creates a wrapper around a search listener response that can be used internally
93
+ * to listen for search results that were added to the buffer or response status changes.
94
+ * @param scoreOrder the order to aggregate search results in.
95
+ */
96
+ export declare function makeInternalSearchListenerResponse(scoreOrder?: ScoreOrder): InternalSearchListenerResponse;
97
+ /**
98
+ * Creates a wrapper around a search listener request that can be used
99
+ * internally to close the request.
100
+ * @param topic the topic the search request was dispatched on.
101
+ * @param id the id of the search request.
102
+ * @param req the search request.
103
+ */
104
+ export declare function makeInternalSearchListenerRequest(topic: string, id: string, req: SearchRequest): InternalSearchListenerRequest;
@@ -0,0 +1,5 @@
1
+ export declare const providerNotExist: Error;
2
+ export declare const providerExists: Error;
3
+ export declare const badPayload: Error;
4
+ export declare const subscriptionRejected: Error;
5
+ export declare const channelNotExist: Error;
@@ -0,0 +1,6 @@
1
+ import type { Identity } from '../shapes';
2
+ import type { Channel, ChannelClient } from './shapes';
3
+ export declare function getIdentity(): Identity;
4
+ export declare function getPlatformNamespace(): string | undefined;
5
+ export declare function connectToChannel(name: string): Promise<ChannelClient>;
6
+ export declare function createChannel(name: string): Promise<Channel>;
@@ -0,0 +1,23 @@
1
+ import type { Identity } from '../shapes';
2
+ export declare type MessageListener = (message: any, identity: Identity) => any;
3
+ export declare type ConnectionListener = (identity: Identity) => Promise<void>;
4
+ /**
5
+ * Represents a channel client.
6
+ */
7
+ export interface ChannelClient {
8
+ register(topic: string, listener: MessageListener): void;
9
+ dispatch(topic: string, message: any): Promise<any>;
10
+ disconnect(): Promise<void>;
11
+ onDisconnection(listeber: ConnectionListener): void;
12
+ }
13
+ /**
14
+ * Represents a channel.
15
+ */
16
+ export interface Channel {
17
+ register(topic: string, listener: MessageListener): void;
18
+ publish(topic: string, message: any): Promise<void>;
19
+ dispatch(to: Identity, topic: string, message: any): Promise<any>;
20
+ onConnection(listener: ConnectionListener): void;
21
+ onDisconnection(listener: ConnectionListener): void;
22
+ destroy(): Promise<void>;
23
+ }
@@ -0,0 +1,7 @@
1
+ import * as client from './client';
2
+ import * as provider from './provider';
3
+ export declare const create: typeof provider.create;
4
+ export declare const subscribe: typeof client.subscribe;
5
+ export declare const defaultTopic = "all";
6
+ export type { SearchProviderResponse, SearchRequest, SearchTopicClient, SearchTopic, SearchProviderInfo, ScoreOrder, Action, SearchResult, SearchListenerRequest, SearchListenerResponse, UserInputListener, DispatchedSearchResult, ResultDispatchListener, SearchProvider, SearchTopicSubscribeRequest, SearchTag, SearchResponse } from './shapes';
7
+ export { SearchTagBackground } from './shapes';
@@ -0,0 +1,134 @@
1
+ import type { DispatchedSearchResult, SearchListenerRequest, SearchListenerResponse, SearchProviderResponse, SearchProviderResponseGeneratorState, SearchRequest, SearchResponse, SearchResult } from './shapes';
2
+ /**
3
+ * Message for dispatching a search request.
4
+ * This interface is used when sending a dispatch request from a remote OpenFin identity
5
+ * to the search topic creator.
6
+ */
7
+ export interface InternalSearchRequest extends SearchRequest {
8
+ /**
9
+ * The id of the search request.
10
+ * On initial search request from remote provider, this ID is generated.
11
+ * The remote OpenFin identity is required to pass this id on all subsequent requests.
12
+ */
13
+ id?: string;
14
+ }
15
+ /**
16
+ * Response for a remote search request.
17
+ */
18
+ export interface InternalSearchResponse {
19
+ /**
20
+ * The ID of the search request the response pertains to.
21
+ */
22
+ id: string;
23
+ /**
24
+ * True if the all search providers have responded to the search request.
25
+ */
26
+ done?: boolean;
27
+ /**
28
+ * The state of the search response generator.
29
+ */
30
+ state: SearchProviderResponseGeneratorState;
31
+ /**
32
+ * The current list of responses.
33
+ */
34
+ value: SearchProviderResponse[];
35
+ }
36
+ /**
37
+ * Close a search request.
38
+ * Used to notify search topic creator that a remote OpenFin identity has closed a search request.
39
+ */
40
+ export interface InternalSearchCloseRequest {
41
+ /**
42
+ * The id of the remote search request to close.
43
+ */
44
+ id: string;
45
+ }
46
+ /**
47
+ * Request data from a specific remote search provider.
48
+ * This interface is used when requesting data from a search provider that is maintained in another OpenFin application.
49
+ */
50
+ export interface InternalDataRequest {
51
+ id: string;
52
+ query: string;
53
+ context: any;
54
+ providerId: string;
55
+ targets: string[];
56
+ }
57
+ export declare enum InternalSearchListenerResponseStatus {
58
+ /**
59
+ * The intial status of a new search listener response object.
60
+ *
61
+ * Denotes that the search provider listener has not taken use of the search listener response object,
62
+ * as in `response.open()` nor `response.close()` has not been called yet.
63
+ */
64
+ Initial = 0,
65
+ /**
66
+ * Denotes that the search provider is done sending new or updated search results
67
+ * for the corresponding request.
68
+ */
69
+ Open = 1,
70
+ /**
71
+ * Denotes that the search provider is done sending new or updated search results
72
+ * for the corresponding request.
73
+ */
74
+ Close = 2
75
+ }
76
+ /**
77
+ * Respond to the provider data request with data.
78
+ * This interface is used when responding to the provider with data from datasources maintained in views.
79
+ */
80
+ export interface InternalDataResponse extends SearchResponse {
81
+ id: string;
82
+ providerId: string;
83
+ revoked?: string[];
84
+ status?: InternalSearchListenerResponseStatus;
85
+ }
86
+ export interface InternalErrorResponse {
87
+ /**
88
+ * An error message, denoting that something went wrong.
89
+ */
90
+ error: string;
91
+ }
92
+ /**
93
+ * Dispatch search result back to provider with an action.
94
+ * This interface is used when dispatching a search result that came from a provider in another window or view.
95
+ */
96
+ export interface InternalDispatchRequest {
97
+ result: DispatchedSearchResult;
98
+ providerId: string;
99
+ }
100
+ export interface InternalSearchListenerResponse {
101
+ getResultBuffer(): SearchResult[];
102
+ setResultBuffer(results: SearchResult[]): void;
103
+ getRevokedBuffer(): string[];
104
+ setRevokedBuffer(resultIds: string[]): void;
105
+ onChange(): void;
106
+ getStatus(): InternalSearchListenerResponseStatus;
107
+ res: SearchListenerResponse;
108
+ }
109
+ export interface InternalSearchListenerRequest {
110
+ close(): void;
111
+ req: SearchListenerRequest;
112
+ }
113
+ export interface InternalSearchResponseGeneratorHooks {
114
+ setState(state: SearchProviderResponseGeneratorState): void;
115
+ }
116
+ export interface InternalSearchTopicContext {
117
+ /**
118
+ * The search topic identifier passed via a `subscribe` or `create` call.
119
+ * This identifier is unique to the platform the search topic was created in.
120
+ */
121
+ topic: string;
122
+ /**
123
+ * The namespace of the search topic.
124
+ *
125
+ * This is used for scoping, such that two platform for example can declare
126
+ * the same topic ID without name collisions.
127
+ */
128
+ namespace: string;
129
+ /**
130
+ * The search topic concatenated with the namespace.
131
+ * This ID is unique across the desktop.
132
+ */
133
+ namespacedTopic: string;
134
+ }
@@ -0,0 +1 @@
1
+ export declare function error(err: Error): void;
@@ -0,0 +1,8 @@
1
+ import type { SearchTopic, SearchTopicCreateRequest } from '../shapes';
2
+ /**
3
+ * Create a topic.
4
+ * If the OpenFin identity creating the topic is running in a platform, the search topic will be sandboxed to the platform.
5
+ * In order to subscribe to a sandboxed search topic, the UUID of the platform must be specifed explicitly or the subscribing OpenFin identity must be running in the platform.
6
+ * @param req the topic create request.
7
+ */
8
+ export declare function create(req?: string | SearchTopicCreateRequest): Promise<SearchTopic>;
@@ -0,0 +1,33 @@
1
+ import { InternalSearchTopicContext } from '../internal-shapes';
2
+ import { Action, SearchProvider, SearchProviderInfo, SearchProviderResponseGeneratorExtended, SearchRequest, SearchResult } from '../shapes';
3
+ /**
4
+ * Get all registered providers' info for an topic.
5
+ * @param namespacedTopic the namespaced search topic id.
6
+ */
7
+ export declare function getAllProviders(namespacedTopic: string): SearchProviderInfo[];
8
+ /**
9
+ * Register a provider.
10
+ * @param namespacedTopic the namespaced search topic to register the provider on.
11
+ * @param provider the provider to register.
12
+ */
13
+ export declare function register(namespacedTopic: string, provider: SearchProvider): void;
14
+ /**
15
+ * Deregister a provider.
16
+ * @param namespacedTopic the namespaced search topic to deregister the provider on.
17
+ * @param name the name of the search provider to deregister.
18
+ */
19
+ export declare function deregister(namespacedTopic: string, name: string): void;
20
+ /**
21
+ * Dispatch a search result back to the respective provider.
22
+ * @param namespacedTopic the namespaced search topic id.
23
+ * @param providerId the name of the provider to dispatch the result back to.
24
+ * @param result the search result to dispatch back to the provider.
25
+ * @param action the action to dispatch the search result with.
26
+ */
27
+ export declare function dispatch(namespacedTopic: string, providerId: string, result: SearchResult, action: Action): Promise<void>;
28
+ /**
29
+ * Returns an extended search generator object.
30
+ * @param ctx the search topic context.
31
+ * @param req the search request.
32
+ */
33
+ export declare function search({ namespacedTopic, topic }: InternalSearchTopicContext, req: SearchRequest): SearchProviderResponseGeneratorExtended;
@@ -0,0 +1,6 @@
1
+ import { InternalSearchTopicContext } from '../../internal-shapes';
2
+ /**
3
+ * Create a channel for interacting with remote search providers.
4
+ * @param ctx the context of the search topic to create the channel for.
5
+ */
6
+ export declare function create(ctx: InternalSearchTopicContext): Promise<import("../../fin/shapes").Channel>;
@@ -0,0 +1,23 @@
1
+ import type { Channel } from '../../fin/shapes';
2
+ /**
3
+ * Get the OpenFin channel that represents a topic.
4
+ * If not found, will throw an error.
5
+ * @param topicId the search topic id.
6
+ */
7
+ export declare function getOrFail(topicId: string): Channel;
8
+ /**
9
+ * Get the OpenFin channel that represents a topic.
10
+ * @param topicId the search topic id.
11
+ */
12
+ export declare function get(topicId: string): Channel;
13
+ /**
14
+ * Set the OpenFin channel for a search topic.
15
+ * @param topic the search topic id.
16
+ * @param channel the channel for the search topic.
17
+ */
18
+ export declare function set(topic: string, channel: Channel): void;
19
+ /**
20
+ * Remove the channel corresponding to a search topic.
21
+ * @param topic the search topic.
22
+ */
23
+ export declare function remove(topic: string): void;
@@ -0,0 +1,20 @@
1
+ import { InternalSearchTopicContext } from '../../internal-shapes';
2
+ import type { Identity, SubscriptionListener } from '../../shapes';
3
+ /**
4
+ * Add a listener that is called whenever someone remotely subscribes to a search topic.
5
+ * @param namespacedTopic the namespaced search topic.
6
+ * @param listener the subscription listener to add.
7
+ */
8
+ export declare function addSubscriptionListener(namespacedTopic: string, listener: SubscriptionListener): void;
9
+ /**
10
+ * Remove a listener that is called whenever someone remotely subscribes to a search topic.
11
+ * @param namespacedTopic the namespaced search topic.
12
+ * @param listener the listener to remove.
13
+ */
14
+ export declare function removeSubscriptionListener(namespacedTopic: string, listener: SubscriptionListener): void;
15
+ /**
16
+ * Called when a remote OpenFin identity connects to a channel to listen on topic invocations.
17
+ * If a subscription listener registered for this search topic returns false, the request will be rejected.
18
+ * @param ctx the search topic context.
19
+ */
20
+ export declare function makeStreamListener({ namespacedTopic }: InternalSearchTopicContext): (identity: Identity) => Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { InternalDataResponse } from '../../internal-shapes';
2
+ import type { DispatchedSearchResult, SearchListenerRequest, SearchListenerResponse, SearchProviderInfo } from '../../shapes';
3
+ /**
4
+ * Listens for pushed new/updated remote search provider results or status changes.
5
+ * When a message is received, call all listeners corresponding to the response.
6
+ * @param namespacedTopic the namespaced search topic.
7
+ */
8
+ export declare function makeStreamListener(namespacedTopic: string): (res: InternalDataResponse) => void;
9
+ /**
10
+ * Make a search listener for a remote search provider.
11
+ * This listener will be called by the provider when the topic is searched.
12
+ * When called, the listener waits and returns the response from the view for the data request.
13
+ * @param topicId the search topic for the listener.
14
+ * @param info the provider info.
15
+ */
16
+ export declare function makeOnSearch(topicId: string, info: SearchProviderInfo): (request: SearchListenerRequest, response: SearchListenerResponse) => Promise<InternalDataResponse>;
17
+ /**
18
+ * Make a dispatch result listener for a remote search provider.
19
+ * When called, the listener sends a result dispatch request to the underlying remote OpenFin identity.
20
+ * @param topicId the search topic id.
21
+ * @param info the remote search provider info.
22
+ */
23
+ export declare function makeOnResultDispatch(topicId: string, info: SearchProviderInfo): (result: DispatchedSearchResult) => Promise<any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make a channel listener for deregistering remote search providers from search topics.
3
+ * @param namespacedTopic the namespaced search topic.
4
+ */
5
+ export declare function makeStreamListener(namespacedTopic: string): (name: string) => void;
@@ -0,0 +1 @@
1
+ export declare function disconnect(namespacedTopic: string): Promise<void>;
@@ -0,0 +1,9 @@
1
+ import type { DisconnectListener, Identity } from '../../shapes';
2
+ export declare function addDisconnectListener(namespacedTopic: string, listener: DisconnectListener): void;
3
+ export declare function removeDisconnectListener(namespacedTopic: string, listener: DisconnectListener): void;
4
+ /**
5
+ * Called when a remote OpenFin identity disconnects from the channel for a search topic.
6
+ * Disconnecting will clean up all search providers correlated to the OpenFin identity.
7
+ * @param namespacedTopic the namespaced search topic id.
8
+ */
9
+ export declare function makeStreamListener(namespacedTopic: string): (identity: Identity) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ import type { InternalDispatchRequest } from '../../internal-shapes';
2
+ import type { Identity } from '../../shapes';
3
+ /**
4
+ * Make a channel listener for proxying search result dispatch from a remote OpenFin identity back to the respective provider.
5
+ * @param namespacedTopic the namespaced search topic id.
6
+ */
7
+ export declare function makeStreamListener(namespacedTopic: string): (req: InternalDispatchRequest, identity: Identity) => Promise<void>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Make a channel listener for sending search provider info to a remote OpenFin identity.
3
+ * @param namespacedTopic the context of the search topic to get the provider info from.
4
+ */
5
+ export declare function makeStreamListener(namespacedTopic: string): () => Promise<import("../..").SearchProviderInfo[]>;
@@ -0,0 +1,23 @@
1
+ import type { Identity, SearchProviderInfo } from '../../shapes';
2
+ /**
3
+ * Add a remote search provider.
4
+ * @param topic the search topic to add the provider on.
5
+ * @param info the search provider info. Must include identity.
6
+ */
7
+ export declare function addRemoteProvider(topic: string, info: SearchProviderInfo): void;
8
+ /**
9
+ * Removes a remote search provider.
10
+ * @param topic the search topic id.
11
+ * @param name the name of the search provider.
12
+ */
13
+ export declare function removeRemoteProvider(topic: string, id: string): void;
14
+ /**
15
+ * Remove all search providers registered by the remote OpenFin identity.
16
+ * @param topic the search topic to remove the providers on.
17
+ * @param identity the identity that registered the remote search providers.
18
+ */
19
+ export declare function removeRemoteProvidersForIdentity(topic: string, identity: Identity): void;
20
+ /**
21
+ * Make a channel listener that allows remote OpenFin identities to register a search provider to a search topic.
22
+ */
23
+ export declare function makeStreamListener(namespacedTopic: string): (info: SearchProviderInfo, identity: Identity) => void;
@@ -0,0 +1,14 @@
1
+ import type { InternalSearchCloseRequest } from '../../internal-shapes';
2
+ import type { Identity } from '../../shapes';
3
+ /**
4
+ * Sends a message notifying a remote OpenFin identity that a search request has been closed.
5
+ * @param topicId the search topic id.
6
+ * @param identity the remote OpenFin identity to notify.
7
+ * @param requestId the search request id.
8
+ */
9
+ export declare function sendRequestCloseToIdentity(topicId: string, identity: Identity, requestId: string): Promise<any>;
10
+ /**
11
+ * Listen for search request close messages from remote providers.
12
+ * On message, close the remote search request.
13
+ */
14
+ export declare function makeStreamListener(namespacedTopic: string): (req: InternalSearchCloseRequest) => void;
@@ -0,0 +1,8 @@
1
+ import type { InternalErrorResponse, InternalSearchRequest, InternalSearchResponse, InternalSearchTopicContext } from '../../internal-shapes';
2
+ export declare function closeRemoteSearchRequest(topicId: string, requestId: string): void;
3
+ /**
4
+ * Listen for search requests from remote OpenFin identities.
5
+ * On message, setup search generator that remote identity can check the status of in subsequent requests.
6
+ * @param namespacedTopic the search topic context.
7
+ */
8
+ export declare function makeStreamListener(ctx: InternalSearchTopicContext): (request: InternalSearchRequest, ...p: any[]) => Promise<InternalSearchResponse | InternalErrorResponse>;