import { BusEventWithPayload } from '@grafana/data'; /** Operations Grafana Assistant can ask Pathfinder to perform. */ export declare const PATHFINDER_OPERATIONS: { /** Reload the open guide with the given resource name. */ readonly refreshGuide: 'refresh-guide'; }; export type PathfinderOperation = (typeof PATHFINDER_OPERATIONS)[keyof typeof PATHFINDER_OPERATIONS]; export interface PathfinderEventPayload { operation: PathfinderOperation; /** App Platform guide resource name, the value used in `doc=api:` links. */ name: string; } /** * Event published by grafana-assistant-app to ask Pathfinder to act on a guide, for example to * reload one that is already open after the Assistant saved, published or unpublished it. * The event is one-way and only reaches the browser page where the Assistant ran. * Receivers should ignore operations they do not know. * * @example * ```typescript * import { onPathfinderEvent, PATHFINDER_OPERATIONS } from '@grafana/assistant'; * * const unsubscribe = onPathfinderEvent(({ operation, name }) => { * if (operation === PATHFINDER_OPERATIONS.refreshGuide) { * reloadGuide(name); * } * }); * * // On unmount * unsubscribe(); * ``` */ export declare class PathfinderEvent extends BusEventWithPayload { static type: string; } /** * Subscribe to Pathfinder events emitted by grafana-assistant-app. * Returns an unsubscribe function. */ export declare function onPathfinderEvent(callback: (payload: PathfinderEventPayload) => void): () => void; //# sourceMappingURL=pathfinder.d.ts.map