import { type ReactEventHandler, type JSX } from 'react'; import type { IntentPayload, SendIntentOptions, SendIntentWithResponseOptions } from '@dynatrace-sdk/navigation'; import type { AriaLabelingProps } from '../../types/a11y-props.js'; import type { BehaviorTrackingProps } from '../../types/behavior-tracking-props.js'; import type { DataTestId } from '../../types/data-props.js'; import type { MaskingProps } from '../../types/masking-props.js'; import type { StylingProps } from '../../types/styling-props.js'; import type { WithChildren } from '../../types/with-children.js'; /** * @public */ export interface SuccessRes { status: 'success'; data: Record; } /** * @public */ export interface ErrorRes { status: 'error'; error: Error; } /** * @public */ export interface IntentWithResponseProps extends IntentBaseProps { options: SendIntentWithResponseOptions; onResponse: (response: SuccessRes | ErrorRes) => void; } /** * @public */ export interface IntentWithoutResponseProps extends IntentBaseProps { options: SendIntentOptions; onResponse?: never; } /** * @public */ export type IntentProps = IntentWithResponseProps | IntentWithoutResponseProps; /** * @public */ export interface IntentBaseProps extends WithChildren, AriaLabelingProps, StylingProps, DataTestId, MaskingProps, BehaviorTrackingProps { /** * The intent payload sent to the connected application. */ payload: IntentPayload; /** * Whether the intent is disabled. * @defaultValue false */ disabled?: boolean; /** * A callback that is triggered after selecting the intent. */ onSelect?: ReactEventHandler; /** * A callback that is triggered with the intent response. */ onResponse?: never | ((response: SuccessRes | ErrorRes) => void); /** * An icon displayed next to the intent label. */ icon?: JSX.Element; } /** * Intent slot component. * @public */ export declare const Intent: { (props: IntentProps): null; displayName: string; };