/*** * Setup sdk-web testing environment with default values */ export declare const clearNavigationMocks: () => void; /** * 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} */ 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; } declare interface IntentCanceledError { reason: 'Canceled'; } 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. */ declare interface IntentPayload { /** * Maps property names to property values of any type */ [propertyName: string]: any; } declare interface IntentRejectedError { reason: 'Rejected'; payload?: unknown; } declare type IntentResponseEnvelope = IntentResponseOkEnvelope | IntentResponseErrorEnvelope; declare interface IntentResponseErrorEnvelope { ok: false; error: IntentError; } declare interface IntentResponseOkEnvelope { ok: true; data: { [key in T]: unknown; }; } /*** * Setup sdk-web for testing purposes * The sdk-web implementation will be overridden with passed mocked values or defaults mocks * @param setup - configuration with mocked values / function */ export declare const mockNavigation: (setup?: MockType) => void; declare type MockType = Partial; /** * 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 */ 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 */ declare interface PathChangeRequest { path: string; pathWithoutBasePath: string; } declare type Response_2 = { response: { [key in T]: unknown; }; }; declare type SendIntentOptions = { recommendedAppId: string; recommendedIntentId: string; keyProperties?: never; } | { keyProperties: Array; recommendedAppId?: never; recommendedIntentId?: never; }; declare type SendIntentWithResponseOptions = { responseProperties: T[]; recommendedAppId: string; recommendedIntentId: string; } | { responseProperties: T[]; recommendedAppId?: never; recommendedIntentId?: never; }; export declare const setupTestingEnv: () => void; declare const wrapper: { getIntent: () => Intent | null; getIntentLink: (intentPayload: IntentPayload, appId?: string, intentId?: string) => string; sendIntent: (intentPayload: T, legacyRecommendedAppIdOrSendIntentOptions?: string | SendIntentOptions, recommendedIntentId?: string) => void; sendIntentWithResponse: (intentPayload: IntentPayload, sendIntentWithResponseOptions: SendIntentWithResponseOptions) => Promise>; sendIntentWithResponseV2: (intentPayload: IntentPayload, sendIntentWithResponseOptions: SendIntentWithResponseOptions) => Promise>; getAppLink: (appId: string, pageToken?: string) => string; openApp: (appId: string, pageToken?: string) => void; setPathChangeHandler: (handler: PathChangeHandler) => void; getDocumentLink: (documentId: string) => string; openDocument: (documentId: string) => void; }; export { }