import React, { ReactNode } from "react";
export declare class Property<V = any> {
    private _value?;
    private watchers;
    /**
     * Optional name for debugging purposes.
     * When provided, changes to this property will be logged to the console in development mode,
     * making it easier to track state changes and debug reactive updates.
     *
     * Example: new Property<string>('', 'streamingText')
     * Will log: [CompositeState] streamingText: "" → "new value"
     */
    readonly name?: string;
    constructor(value?: V, name?: string);
    get value(): V | undefined;
    set value(value: V | undefined);
    watch(watcher: (value: V | undefined) => void): () => void;
}
type ConstructorOf<T = any> = new (...args: any[]) => T;
export declare function createCompositeStateProvider<T>(StateClass: ConstructorOf<T>): React.Provider<T>;
export declare class Slot {
    private consume;
    private _current;
    constructor(content?: ReactNode);
    set current(content: ReactNode);
    get current(): ReactNode;
    withConsumer(consume: ((content: ReactNode) => void) | undefined): this;
}
export declare function useCompositeState<T>(StateClass: ConstructorOf<T>): T;
export declare function useGetCompositeStateProperty<V>(property: Property<V>): V;
export declare function useSetCompositeStateProperty<V>(property: Property<V>, value: V | undefined): V | undefined;
export declare function useWatchCompositeStateProperty<V>(property: Property<V>, watcher: (value: V | undefined) => void): void;
export declare function useSlot(slot: Slot): string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
export declare function useWatchSlot(slot: Slot, watcher: (value: ReactNode | undefined) => void): void;
export declare function useDefineSlot(slot: Slot, value: ReactNode | undefined): void;
/**
 * Computed property that derives its value from other properties.
 * Automatically recalculates when any of its dependencies change.
 *
 * Think of it like a spreadsheet formula: if cell A1 = 5 and A2 = 10,
 * then A3 = A1 + A2 will automatically update to 15. If A1 changes to 7,
 * A3 automatically becomes 17.
 *
 * @example Basic usage
 * ```typescript
 * class MyState {
 *     count = new Property(0, 'count');
 *     multiplier = new Property(2, 'multiplier');
 *
 *     // Automatically recalculates when count or multiplier changes
 *     result = new ComputedProperty(
 *         () => (this.count.value || 0) * (this.multiplier.value || 0),
 *         [this.count, this.multiplier],
 *         'result'
 *     );
 * }
 *
 * state.count.value = 5;      // result automatically becomes 10
 * state.multiplier.value = 3; // result automatically becomes 15
 * ```
 *
 * @example Derived state
 * ```typescript
 * class EditorState {
 *     workingCopy = new Property<Interaction>();
 *     sourceInteraction = new Property<Interaction>();
 *
 *     // Automatically true when workingCopy differs from source
 *     isDirty = new ComputedProperty(
 *         () => JSON.stringify(this.workingCopy.value) !==
 *               JSON.stringify(this.sourceInteraction.value),
 *         [this.workingCopy, this.sourceInteraction],
 *         'isDirty'
 *     );
 * }
 * ```
 *
 * @example Cascading computed properties
 * ```typescript
 * class State {
 *     a = new Property(1);
 *     b = new Property(2);
 *     sum = new ComputedProperty(() => a.value + b.value, [a, b]);
 *     doubled = new ComputedProperty(() => sum.value * 2, [sum]);
 * }
 * ```
 *
 * Benefits:
 * - ✅ Automatic updates when dependencies change
 * - ✅ Memoization - only recalculates when needed
 * - ✅ Composable - can depend on other ComputedProperties
 * - ✅ Type-safe with full TypeScript support
 *
 * When to use:
 * - ✅ For derived state (values calculated from other values)
 * - ✅ When dependencies are other Properties or ComputedProperties
 * - ❌ NOT for async operations (use regular methods instead)
 * - ❌ NOT if compute function has side effects
 *
 * @important Remember to call dispose() when the ComputedProperty is no longer needed
 * to prevent memory leaks by unsubscribing from all dependencies.
 */
export declare class ComputedProperty<V = any> {
    private compute;
    private _value?;
    private watchers;
    private unsubscribers;
    /**
     * Optional name for debugging purposes.
     * When provided, recalculations will be logged to the console in development mode.
     */
    readonly name?: string;
    /**
     * @param compute - Function that calculates the derived value
     * @param dependencies - Array of Properties this computed value depends on
     * @param name - Optional name for debugging
     */
    constructor(compute: () => V, dependencies: Property<any>[], name?: string);
    private recalculate;
    get value(): V | undefined;
    watch(watcher: (value: V | undefined) => void): () => void;
    /**
     * Dispose of this ComputedProperty by unsubscribing from all dependencies.
     * Call this when the ComputedProperty is no longer needed to prevent memory leaks.
     *
     * @example
     * ```typescript
     * const computed = new ComputedProperty(...);
     *
     * // Later, when cleaning up:
     * computed.dispose();
     * ```
     */
    dispose(): void;
}
export {};
//# sourceMappingURL=CompositeState.d.ts.map