import type { InvestigationLensError, InvestigationLensErrorCode } from './types'; /** * Request passed to the lens implementation registered by the Grafana * Assistant plugin. */ export interface InvestigationLensRequest { investigationId: string; /** JSON Schema describing the shape of the desired structured view. */ schema: unknown; /** Attribution for the generation, e.g. `'grafana-irm/incident-detail'`. */ origin: string; /** When true, bypass the cached result and regenerate. */ refresh?: boolean; } /** * The lens implementation provided by the Grafana Assistant plugin. Resolves * with data conforming to the request's schema, or rejects with an error * carrying an {@link InvestigationLensErrorCode} `code` property. */ export type InvestigationLensImplementation = (request: InvestigationLensRequest) => Promise; export type InvestigationLensInitializer = () => Promise; /** * Typed error the lens implementation throws to signal a specific failure * mode. Consumers should not need this class — the hook converts failures to * plain {@link InvestigationLensError} values. Conversion is structural (it * reads the `code` property), so it works even when the host plugin and the * assistant plugin bundle different copies of this package. */ export declare class InvestigationLensRequestError extends Error { readonly code: InvestigationLensErrorCode; constructor(code: InvestigationLensErrorCode, message: string); } /** Converts any thrown value into a plain, typed lens error. */ export declare function toInvestigationLensError(err: unknown): InvestigationLensError; declare global { interface Window { [key: string]: any; } } export declare function setInvestigationLensImplementation(fn: InvestigationLensImplementation): void; /** * Register a lazy initializer that is called on first use. The Grafana * Assistant plugin registers this at bootstrap so the heavy implementation * loads only when a consumer actually requests a lens view. */ export declare function setInvestigationLensInitializer(fn: InvestigationLensInitializer): void; /** * Ensure the lens implementation is initialized, invoking the registered * initializer on first use. Throws an `unavailable` lens error when no * initializer is registered (assistant plugin missing or too old). */ export declare function ensureInvestigationLensInitialized(): Promise; export declare function getInvestigationLensImplementation(): InvestigationLensImplementation; //# sourceMappingURL=investigationLens.d.ts.map