io.intentsAPIinterface
Intents API.
Properties (1)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| resolver⚓︎ | Resolver | x | x | API for controlling the Intents Resolver UI app. |
9 Methods
clearSavedHandlers()⚓︎
() => Promise<void>
Removes all saved Intent handlers for previously raised Intents.
filterHandlers()⚓︎
(handlerFilter: HandlerFilter) => Promise<FilterHandlersResult>
Filters Intent handlers by specified criteria. If there are more than one valid Intent handlers and the Intents Resolver UI is enabled, it will open and display the available handlers.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| handlerFilter⚓︎ | HandlerFilter | Filter for the list of Intent handlers to return. |
find()⚓︎
(intentFilter?: string | IntentFilter) => Promise<Intent[]>
Retrieves Intents by a specified filter. If no filter is supplied, all available Intents will be retrieved.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| intentFilter⚓︎ | string | IntentFilter | x | Filter for retrieving Intents. Can be the Intent name only, or an |
getIntents()⚓︎
(handler: IntentHandler) => Promise<GetIntentsResult>
Retrieves all Intents associated with an Intent handler.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| handler⚓︎ | IntentHandler | Intent handler whose Intents to retrieve. |
onHandlerAdded()⚓︎
(callback: (handler: IntentHandler, intentName: string) => void) => UnsubscribeFunction
Notifies when a handler for an Intent is added. Returns an unsubscribe function.
io.Connect Desktop 9.6Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (handler: IntentHandler, intentName: string) => void | Callback function for handling the event. Receives an object describing the added Intent handler as an argument. |
onHandlerRemoved()⚓︎
(callback: (handler: IntentHandler, intentName: string) => void) => UnsubscribeFunction
Notifies when a handler for an Intent is removed. Returns an unsubscribe function.
io.Connect Desktop 9.6Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (handler: IntentHandler, intentName: string) => void | Callback function for handling the event. Receives an object describing the removed Intent handler as an argument. |
raise()⚓︎
(request: string | IntentRequest) => Promise<IntentResult>
Raises an intent.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| request⚓︎ | string | IntentRequest | The name of the Intent to raise, or an |
register()⚓︎
(intent: string | AddIntentListenerRequest, handler: (context: IntentContext, caller?: Instance) => any) => Promise<{ unsubscribe: UnsubscribeFunction }>
Registers an Intent handler. If your app is already registered as an Intent handler through its configuration, use this method to supply a handler for the specified Intent. Otherwise, you can use it to register your app as an Intent handler dynamically at runtime. Dynamically registered Intent handlers share the life span of the respective app instance.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| intent⚓︎ | string | AddIntentListenerRequest | The name of the Intent to be handled, or an object specifying the Intent name and additional settings for handling the Intent. |
|
| handler⚓︎ | (context: IntentContext, caller?: Instance) => any | The callback that will handle a raised intent. Will be called with an IntentContext if it is provided by the raising application and caller - the Interop Instance which raised the intent |