/**
 * TraitProvider Component
 *
 * Provides trait state machines to child components via React context.
 *
 * @packageDocumentation
 */
import React from 'react';
import type { ResolvedTrait, ResolvedTraitBinding, ResolvedEntity } from './types';
export interface TraitInstance {
    /** Trait name */
    name: string;
    /** Current state */
    currentState: string;
    /** Available events (can be triggered) */
    availableEvents: string[];
    /** Dispatch an event to the state machine */
    dispatch: (eventKey: string, payload?: Record<string, unknown>) => void;
    /** Check if an event can be dispatched */
    canDispatch: (eventKey: string) => boolean;
    /** Get the full trait definition */
    trait: ResolvedTrait;
}
export interface TraitContextValue {
    /** All trait instances on this page */
    traits: Map<string, TraitInstance>;
    /** Get a trait instance by name */
    getTrait: (name: string) => TraitInstance | undefined;
    /** Dispatch an event to a specific trait */
    dispatchToTrait: (traitName: string, eventKey: string, payload?: Record<string, unknown>) => void;
    /** Check if an event can be dispatched to a trait */
    canDispatch: (traitName: string, eventKey: string) => boolean;
}
export declare const TraitContext: React.Context<TraitContextValue | null>;
export interface TraitProviderProps {
    /** Trait bindings for this page */
    traits: ResolvedTraitBinding[];
    /** Entity map for context */
    entities: Map<string, ResolvedEntity>;
    /** Children to render */
    children: React.ReactNode;
}
export declare function TraitProvider({ traits: traitBindings, children, }: TraitProviderProps): React.ReactElement;
/**
 * Access the trait context from within the TraitProvider.
 */
export declare function useTraitContext(): TraitContextValue;
/**
 * Access a specific trait instance.
 */
export declare function useTrait(traitName: string): TraitInstance | undefined;
export default TraitProvider;
