import type { JsonRpcEngineEndCallback } from "@metamask/json-rpc-engine"; import type { Messenger } from "@metamask/messenger"; import type { TrackEventParams, TrackEventResult } from "@metamask/snaps-sdk"; import type { InferMatching } from "@metamask/snaps-utils"; import type { Json, PendingJsonRpcResponse } from "@metamask/utils"; import type { JsonRpcRequestWithOrigin, SnapControllerGetSnapAction } from "../types.mjs"; import type { MethodHooksObject } from "../utils.mjs"; export type TrackEventMethodHooks = { /** * Track an event. * * @param event - The event object containing event details and properties. */ trackEvent: (event: TrackEventObject) => void; }; export type TrackEventMethodActions = SnapControllerGetSnapAction; export type TrackEventObject = { event: string; properties?: Record; sensitiveProperties?: Record; }; declare const TrackEventParametersStruct: import("@metamask/superstruct").Struct<{ event: { event: string; properties?: Record | undefined; sensitiveProperties?: Record | undefined; }; }, { event: import("@metamask/superstruct").Struct<{ event: string; properties?: Record | undefined; sensitiveProperties?: Record | undefined; }, { event: import("@metamask/superstruct").Struct; properties: import("@metamask/superstruct").Struct | undefined, null>; sensitiveProperties: import("@metamask/superstruct").Struct | undefined, null>; }>; }>; export type TrackEventParameters = InferMatching; /** * Handler for the `snap_trackEvent` method. * * @internal */ export declare const trackEventHandler: { implementation: typeof getTrackEventImplementation; hookNames: MethodHooksObject; actionNames: "SnapController:getSnap"[]; }; /** * The `snap_trackEvent` method implementation. * This method allows pre-installed Snaps to submit tracking events to the client. * * @param req - The JSON-RPC request object. * @param res - The JSON-RPC response object. * @param _next - The `json-rpc-engine` "next" callback. Not used by this function. * @param end - The `json-rpc-engine` "end" callback. * @param hooks - The RPC method hooks. * @param hooks.trackEvent - The function to track the event. * @param messenger - The messenger used to call controller actions. * @returns Nothing. */ declare function getTrackEventImplementation(req: JsonRpcRequestWithOrigin, res: PendingJsonRpcResponse, _next: unknown, end: JsonRpcEngineEndCallback, { trackEvent }: TrackEventMethodHooks, messenger: Messenger): void; export {}; //# sourceMappingURL=trackEvent.d.mts.map