/** * Visual configuration options for an addon overlay. * @ignore */ export declare type AddonConfig = (AddonHeadless | AddonWithTitle) & { size?: AddonSize; }; /** * Discriminated union covering all addon display modes. * @ignore */ export declare type AddonDeclaration = IntentAddonOverlayDeclaration | IntentAddonUndefinedDeclaration; declare type AddonHeadless = { /** * When `true`, the addon is rendered without a title bar. */ headless: true; title?: never; }; /** * Size configuration for an addon overlay. */ declare type AddonSize = AddonSizeObject | AddonSizePreset | 'maximized'; /** * Object form of addon size configuration, allowing separate control of width and height. */ declare type AddonSizeObject = { height?: AddonSizePreset | 'auto' | number; width?: AddonSizePreset; }; /** * Preset size values for an addon overlay. */ declare type AddonSizePreset = 'small' | 'medium' | 'large'; declare type AddonWithTitle = { headless?: false; title?: string; }; /** @ignore */ export declare type BuiltinTypes = 'dt.query' | 'dt.timeframe' | 'dt.entity.host'; /** @ignore */ export declare interface DtRuntimeNavigation { getIntent(): Intent | null; getIntentLink(intentPayload: IntentPayload): string; getIntentLink(intentPayload: IntentPayload, appId: string, intentId: string): string; sendIntent(intentPayload: IntentPayload): void; sendIntent(intentPayload: T, sendIntentOptions: SendIntentOptions): void; /** * @deprecated */ sendIntent(intentPayload: IntentPayload, recommendedAppId: string, recommendedIntentId: string): void; sendIntentWithResponse(intentPayload: IntentPayload, sendIntentWithResponseOptions: SendIntentWithResponseOptions): Promise>; sendIntentWithResponseV2(intentPayload: IntentPayload, sendIntentWithResponseOptions: SendIntentWithResponseOptions): Promise>; openApp(appId: string, pageToken?: string | undefined): void; getAppLink(appId: string, pageToken?: string | undefined): string; setPathChangeHandler(handler: PathChangeHandler): void; getDocumentLink(documentId: string): string; openDocument(documentId: string): void; } /** * Generates a link that launches the specified app on current environment, with an optional internal route specified by pageToken * * *Note:* There is no guarantee that the specified app will be launched since different sets of apps could be installed on different platform instances. * Relying on explicitly hardcoded app could lead to broken UX. * * *Note:* A page token isn't a URL or route within your app. * It's a specific identifier in your app manifest that serves as a public API for navigation purposes. * App developers need to explicitly define these tokens in their manifest. * Learn more about [registering page tokens for routes](https://developer.dynatrace.com/develop/page-tokens/#register-page-token-for-a-route). * @param {string} appId ID of the app that will be launched. * @param {string} [pageToken] Id of the static path segment defining an internal route in app. *Warning:* not the same thing as URL or route. * @returns {string} URL to the specified app on current environment. */ export declare function getAppLink(appId: string, pageToken?: string | undefined): string; /** * Generates a link that opens the specified document on current environment. * * *Note:* Due to varying document availability across environments, there's no guarantee the link will always successfully open the document. * * @param {string} documentId The unique identifier (UUID or external ID) of the document to open. * @returns {string} A URL for the document in the current environment. */ export declare function getDocumentLink(documentId: string): string; /** * Retrieves the intent data passed to the app. * * `getIntent` method should be used only if the current app route is the intent handling route (`/intent/:intentId`). Otherwise, it returns `null`. * * *Note:* The intent is passed to the destination app via the intent handling route (`/intent/:intentId`). * If the app has routing already configured, a new route for handling intents must be declared. Otherwise, it won't be possible to retrieve the intent. * If the app has no routing at all, it's not required to configure it. * To register intents your app can handle, you must declare them in your app manifest. * Learn more about [declaring the intents](https://developer.dynatrace.com/develop/intents/receive-intents/#declare-the-intents). * @returns {Intent} Intent accessor, including definition of desired action (intent id) and its payload. * @see {@link Intent} */ export declare function getIntent(): Intent | null; /** * Generates a link that launches the AppShell on current environment and lets it handle the specified intent. * * *Note:* There is no guarantee that the specified app will be launched since different sets of apps could be installed on different platform instances. * Relying on explicitly hardcoded app could lead to broken UX. * @param {IntentPayload} intentPayload Set of properties to pass to the platform. * @returns {string} URL to the specified intent on current environment. * @see {@link IntentPayload} * @see {@link sendIntent} */ export declare function getIntentLink(intentPayload: IntentPayload): string; /** * Generates a link that launches the specified app on current environment and lets it handle the specified intent of given id. * * *Note:* There is no guarantee that the specified app will be launched since different sets of apps could be installed on different platform instances. * Relying on explicitly hardcoded app could lead to broken UX. * @param {IntentPayload} intentPayload Set of properties to pass to the specified app. * @param {string} [appId] ID of the app that will be launched to handle the intent. * @param {string} [intentId] ID of the action that will be passed to the app. * @returns {string} URL to the specified intent on current environment. * @see {@link IntentPayload} * @see {@link sendIntent} */ export declare function getIntentLink(intentPayload: IntentPayload, appId: string, intentId: string): string; /** @ignore */ export declare const getIntentPropertyDeclaration: (field: BuiltinTypes, required: boolean) => Record<"dt.query", IntentPropertyDeclaration<"dt.query">> | Record<"dt.timeframe", IntentPropertyDeclaration<"dt.timeframe">> | Record<"dt.entity.host", IntentPropertyDeclaration<"dt.entity.host">>; /** * Intent accessor API for retrieving received intent. * * Use it to retrieve the intent payload passed from the source app and the intent id selected by the user. * @see {@link getIntent} */ export declare interface Intent { /** * Retrieves the intent id selected by the user. * * It is passed via the intent handling route (`/intent/:intentId`). * @returns {string} intent id */ getId(): string; /** * Retrieves the intent payload object that was passed from the source app. * * It contains only these properties that are declared in the app manifest. * @returns {IntentPayload} Intent payload */ getPayload(): IntentPayload; /** * Retrieves value of a given property name from the intent payload. * @param {string} propertyName * @return {any} */ getProperty(propertyName: string): any; } /** * Intent addon declaration for overlay mode. * @ignore */ export declare type IntentAddonOverlayDeclaration = { /** Opens the addon as an overlay on top of the current view. */ addonMode: 'overlay'; /** Visual configuration for the overlay. */ addonConfig?: AddonConfig; /** Properties returned by the addon to the source. */ responseProperties?: IntentDeclarationProperties; }; /** * Intent addon declaration when no addon is declared. * @ignore */ export declare type IntentAddonUndefinedDeclaration = { addonMode?: never; addonConfig?: never; responseProperties?: never; }; declare interface IntentCanceledError { reason: 'Canceled'; } /** @ignore */ export declare type IntentDeclaration = { name?: string; description: string; properties: IntentDeclarationProperties; deprecated?: boolean; } & AddonDeclaration; /** @ignore */ export declare type IntentDeclarationProperties = Record>; export declare type IntentError = IntentCanceledError | IntentRejectedError; /** * Set of properties that could be passed between apps. * * *Note:* The intent payload contains one or more properties. The properties may be a resource-like (i.e., `dt.entity`, `dt.query`) and may define an additional context (i.e., chosen timeframe, associated problem) * Intents mechanism is the essential part of the platform navigation. It allows to pass the user flow from one app to another and provides the way to plug different apps into these flows, making the platform open and extendable. * Use {@link sendIntent} to pass the intent payload to the platform. * Use {@link getIntent} to handle intents in your app. */ export declare interface IntentPayload { /** * Maps property names to property values of any type */ [propertyName: string]: any; } /** @ignore */ export declare type IntentPropertyDeclaration = IntentPropertyDeclarationWithSchema | IntentPropertyDeclarationWithSchemas; /** @ignore */ export declare interface IntentPropertyDeclarationWithSchema { required: boolean; schema: IntentSchema; } /** @ignore */ export declare interface IntentPropertyDeclarationWithSchemas { required: boolean; schemas: Record; } declare interface IntentRejectedError { reason: 'Rejected'; payload?: unknown; } export declare type IntentResponseEnvelope = IntentResponseOkEnvelope | IntentResponseErrorEnvelope; export declare interface IntentResponseErrorEnvelope { ok: false; error: IntentError; } export declare interface IntentResponseOkEnvelope { ok: true; data: { [key in T]: unknown; }; } declare interface IntentSchema { type: any; [propertyName: string]: any; } /** @ignore */ export declare type IntentsDeclarations = Record; /** * Navigates user to the specified app, or its internal route if the `pageToken` is specified. * * *Note:* A page token isn't a URL or route within your app. * It's a specific identifier in your app manifest that serves as a public API for navigation purposes. * App developers need to explicitly define these tokens in their manifest. * Learn more about [registering page tokens for routes](https://developer.dynatrace.com/develop/page-tokens/#register-page-token-for-a-route). * *Note:* There is no guarantee that the specified app exists since different sets of apps could be installed on different platform instances. * Relying on explicitly hardcoded app could lead to broken UX. * @param {string} appId ID of the app that will be launched. * @param {string} [pageToken] Id of the static path segment defining an internal route in app. *Warning:* not the same thing as URL or route. * @see {@link Intent} */ export declare function openApp(appId: string, pageToken?: string | undefined): void; /** * Navigates the user to the specified document on current environment. * * *Note:* Due to varying document availability across environments, this function might not open the document if it doesn't exist in the environment. * * @param {string} documentId The unique identifier (UUID or external ID) of the document to navigate to. */ export declare function openDocument(documentId: string): void; /** * Handler function for changing the app's URL path. * * With a custom path change handler implementation it is possible to change the app route using ie. built-in routing library features without reloading the app document. * * @param {PathChangeRequest} pathChangeRequest Path change request object with a new path * @returns {void} * @ignore */ export declare type PathChangeHandler = ((pathChangeRequest: PathChangeRequest) => void) | null; /** * Path change request object with a new path. * * @property {string} path Absolute path * @property {string} pathWithoutBasePath Subpath that does not contain the app base path. Depending on the app routing library, it may be required to use this parameter when passing it to the router. * @ignore */ export declare interface PathChangeRequest { path: string; pathWithoutBasePath: string; } declare type Response_2 = { response: { [key in T]: unknown; }; }; export { Response_2 as Response } /** * Passes the specified `IntentPayload` to the Dynatrace platform, which then gets forwarded to the destination app selected by the user. * * *Note:* The list of possible actions and destination apps includes only these actions/apps whose intent declarations are matched against the intent payload. * The matching checks whether the payload contains all the properties required in the intent declaration and whether the properties have the correct types. * All the undeclared properties are removed from the intent payload when passing it to the destination app. * @param {IntentPayload} intentPayload an intent payload object to pass, it may include one or more properties * @see {@link IntentPayload} * @see {@link getIntent} */ export declare function sendIntent(intentPayload: IntentPayload): void; /** * @deprecated Wrap recommended app and intent ids with @see SendIntentOptions and pass as second parameter. * @ignore */ export declare function sendIntent(intentPayload: IntentPayload, recommendedAppId: string, recommendedIntentId: string): void; /** * Passes the specified `IntentPayload` to the specified app and lets it handle the specified intent of given id. * If the specified app does not exist or the specified intent payload does not match, * Dynatrace platform handles the intent as if regular `sendIntent(intentPayload: IntentPayload)` is used. * * *Note:* There is no guarantee that the specified app will be launched since different sets of apps could be installed on different platform instances. * And even if the app is installed, its version may not be capable of handling the specified intent payload. * @param {IntentPayload} intentPayload an intent payload object to pass, it may include one or more properties * @param {SendIntentOptions} sendIntentOptions an options object with: * - recommendedAppId - ID of the app that will be launched to handle the intent * - recommendedIntentId - ID of the action that will be passed to the app * - keyProperties - list of property names of the intent payload that must be matched with intent declarations * @see {@link IntentPayload} * @see {link SendIntentOptions} * @see {@link getIntent} */ export declare function sendIntent(intentPayload: T, sendIntentOptions: SendIntentOptions): void; export declare type SendIntentOptions = { recommendedAppId: string; recommendedIntentId: string; keyProperties?: never; } | { keyProperties: Array; recommendedAppId?: never; recommendedIntentId?: never; }; /** * Unlike regular `sendIntent` method, it requests what properties will be returned by the specified app handling the specified intent of given id. * * *Note:* The list of possible actions and destination apps includes only these actions/apps whose intent declarations are matched against the intent payload and response properties. * @param {IntentPayload} intentPayload an intent payload object to pass, it may be empty when sending an intent with response * @param {SendIntentWithResponseOptions} sendIntentWithResponseOptions an options object with: * - responseProperties - expected intent response, requested as a list of property names * - recommendedAppId - ID of the app that will be launched to handle the intent * - recommendedIntentId - ID of the action that will be passed to the app * @see {@link SendIntentWithResponseOptions} * @see {@link getIntent} */ export declare function sendIntentWithResponse(intentPayload: IntentPayload, sendIntentWithResponseOptions: SendIntentWithResponseOptions): Promise | undefined>; export declare type SendIntentWithResponseOptions = { responseProperties: T[]; recommendedAppId: string; recommendedIntentId: string; } | { responseProperties: T[]; recommendedAppId?: never; recommendedIntentId?: never; }; /** * Registers a custom handler for changing the app's URL path. * It is used only for the changes that are triggered externally, outside the app. * * If a custom handler is not set, the application is reloaded * by replacing the current document location with a new path. * * @param {PathChangeHandler} handler Custom handler for changing the app's URL path. * @returns {void} * @see {@link PathChangeHandler} * @see {@link PathChangeRequest} */ export declare function setPathChangeHandler(handler: PathChangeHandler): void; export { }