import type { WidgetType } from '../components/widget/types'; /** * Fully resolved options for {@link useTrackWidgetInit}. The caller (a leaf widget) is * responsible for deriving each field from its own props so the hook stays free of * widget-shape concerns and runtime type casts. * * @internal */ export type UseTrackWidgetInitOptions = { /** Widget type (chart / pivot / text / custom). */ widgetType: WidgetType; /** Resolved widget kind — chart subtype, plugin name, or fixed string for pivot/text. */ widgetName: string; /** Widget title entered by the designer, or `null` if absent. */ widgetTitle: string | null; /** Stable unique widget identifier — the widget id/OID when available, otherwise a content hash. */ entityId: string; /** * When `false`, the event is suppressed. Pass the caller's render preconditions here * (e.g. `!!(chartType && dataOptions)` for `ChartWidget`) so we do not count mounts * whose render body early-returns `null`. The event fires once when this flips to `true`. * * @default true */ enabled?: boolean; }; /** * Fires the `sdkWidgetInit` tracking event exactly once per widget mount. * * Behavioral note: unlike `useTrackComponentInit`, this hook intentionally * IGNORES `TrackingContextProvider`'s skip-nested signal. Widgets rendered inside * a tracked parent (e.g. a ``) must still emit `sdkWidgetInit`, since * the event must count every widget render regardless of nesting. * * The payload includes envelope overrides (`eventType: 'action'`, * `featureName: 'composesdk'`, `entityType: 'widget'`) that override the defaults * set by `trackProductEvent`, as required by the data-tracking spec. * * `widgetTitle` is emitted as `null` rather than `undefined` when absent, matching the * spec's "null or [empty]" wire convention. * * @internal */ export declare const useTrackWidgetInit: (options: UseTrackWidgetInitOptions) => void;