import type { PostHog, PostHogConfig } from 'posthog-js'; import type { RegistryScriptInput, UseScriptContext } from '#nuxt-scripts/types'; import { PostHogOptions } from './schemas.js'; export { PostHogOptions }; export type PostHogInput = Omit, 'config'> & { /** * Additional PostHog configuration options passed directly to `posthog.init()`. * @see https://posthog.com/docs/libraries/js/config */ config?: Partial; }; export interface PostHogApi { posthog: PostHog; } declare global { interface Window { posthog?: PostHog; __posthogInitPromise?: Promise; _posthogQueue?: { prop: string | symbol; args: any[]; }[]; } } export interface PostHogConsent { /** Call `posthog.opt_in_capturing()`. */ optIn: () => void; /** Call `posthog.opt_out_capturing()`. For boot-time opt-out, use `defaultConsent: 'opt-out'` instead. */ optOut: () => void; } export declare function useScriptPostHog(_options?: PostHogInput): UseScriptContext;