import type { components } from './settings.gen'; /** * The type of terms that apply to a tenant. * - 'msa': Master Service Agreement - only requires acceptance, no version checking * - 'termsAndConditions': Full terms and conditions - requires acceptance AND version checking */ export type TermsType = components['schemas']['TermsAndConditionsResponse']['termsType']; /** * Event name that is dispatched when terms and conditions are accepted. * Other components can listen to this event to refresh their UI. */ export declare const TERMS_AND_CONDITIONS_REFRESH_EVENT = "grafana-assistant-terms-and-conditions-refresh"; /** * Checks whether terms and conditions are accepted and up-to-date. * This function verifies that: * 1. Terms have been accepted * 2. The accepted version matches or exceeds the current version * * @returns A promise that resolves to `true` if terms are accepted and up-to-date, `false` otherwise * @throws Error if the API call fails * * @example * ```typescript * import { checkTerms } from '@grafana/assistant'; * * const accepted = await checkTerms(); * if (!accepted) { * // Show terms acceptance UI * console.log('Terms need to be accepted'); * } * ``` */ export declare function checkTerms(): Promise; /** * React hook to check terms and conditions acceptance status. * Automatically fetches terms data on mount and re-fetches when terms change * (via TERMS_AND_CONDITIONS_REFRESH_EVENT). * * @returns An object containing whether terms are accepted, the terms type, loading state, and error state * * @example * ```typescript * import { useTerms } from '@grafana/assistant'; * * function MyComponent() { * const { accepted, termsType, loading, error } = useTerms(); * * if (loading) return
Loading...
; * if (error) return
Error: {error}
; * return
Terms accepted
; * } * ``` */ export declare function useTerms(): { accepted: boolean; termsType: "msa" | "termsAndConditions" | null; loading: boolean; error: string | null; }; //# sourceMappingURL=index.d.ts.map