/**
 * Configuration options for the useViewModel hook.
 */
export interface UseViewModelOptions {
    /**
     * When true, calls the ViewModel's dispose() method on unmount
     * and when dependencies change causing recreation.
     * Default: true (if dispose method exists)
     */
    disposeOnUnmount?: boolean;
}
/**
 * Result returned by useViewModel when the ViewModel implements IKosViewModelReady.
 */
export interface UseViewModelResult<T> {
    /** The ViewModel instance */
    viewModel: T;
    /** Whether the ViewModel's ready() hook has completed */
    ready: boolean;
    /** Error from the ready() hook, if any */
    error: Error | undefined;
}
/**
 * React hook for creating and managing ViewModel instances.
 *
 * The hook:
 * - Creates the ViewModel using the provided factory function
 * - Calls ready() if the ViewModel implements IKosViewModelReady
 * - Automatically calls dispose() on unmount (if the method exists)
 * - Re-creates the ViewModel when dependencies change
 * - Disposes the previous ViewModel when recreating
 *
 * @param factory - Function that creates the ViewModel instance
 * @param deps - Dependency array (similar to useEffect/useMemo)
 * @param options - Optional configuration
 * @returns UseViewModelResult with viewModel, ready state, and error
 *
 * @example
 * ```typescript
 * // Basic usage (no ready hook)
 * function Counter() {
 *   const { viewModel: vm, ready } = useViewModel(() => new CounterViewModel(), []);
 *
 *   return (
 *     <div>
 *       <span>{vm.count}</span>
 *       <button onClick={() => vm.increment()}>+</button>
 *     </div>
 *   );
 * }
 *
 * // With ready hook for async initialization
 * function OrderSummary({ orderId }: Props) {
 *   const { model: order } = useKosModel<IOrderModel>({ modelId: orderId });
 *   const { model: inventory } = useKosModel<IInventoryModel>({ modelId: 'inventory' });
 *
 *   const { viewModel: vm, ready, error } = useViewModel(
 *     () => new OrderSummaryViewModel(order!, inventory!),
 *     [order, inventory]
 *   );
 *
 *   if (error) return <ErrorDisplay error={error} />;
 *   if (!ready) return <Loading />;
 *
 *   return <div>Total: ${vm.total}</div>;
 * }
 *
 * // Disable auto-disposal
 * const { viewModel: vm } = useViewModel(
 *   () => new MyViewModel(),
 *   [],
 *   { disposeOnUnmount: false }
 * );
 * ```
 *
 * @category KOS React Hook
 */
export declare function useViewModel<T>(factory: () => T, deps: React.DependencyList, options?: UseViewModelOptions): UseViewModelResult<T>;
//# sourceMappingURL=use-view-model.d.ts.map