import { ReactNode } from 'react';

type TriggerType = "custom-event" | "page-view";

interface TriggerDefinitionBase {
  type: TriggerType;
}

interface CustomEventTriggerDefinition extends TriggerDefinitionBase {
  type: "custom-event";
  eventName: string;
}

interface PageViewTriggerDefinition extends TriggerDefinitionBase {
  type: "page-view";
  pathname: string;
}

type TriggerDefinition =
  | CustomEventTriggerDefinition
  | PageViewTriggerDefinition;

interface TellusConfig {
    baseUrl?: string;
    token: string;
}
interface TellusWidget {
    event: (eventName: string) => void;
    clear: () => void;
    triggers: Record<string, TriggerDefinition>;
    ready: boolean;
}
interface Tellus {
    widget: TellusWidget;
}

interface TellusContextValue {
    config: TellusConfig;
    tellus: Tellus;
}
declare const TellusProvider: ({ children, config }: {
    children?: ReactNode;
    config: TellusConfig;
}) => JSX.Element;
declare type TellusReactWidget = Omit<TellusWidget, "ready">;
declare const useTellus: () => {
    ready: false;
    widget: null;
} | {
    ready: true;
    widget: TellusWidget;
};

export { TellusContextValue, TellusProvider, TellusReactWidget, useTellus };
