/**
 * Boolean toggle with reactive subscription.
 *
 * @example
 * ```ts
 * const [open, toggle, setOpen] = useToggle(false)
 * toggle()       // true
 * setOpen(false)  // false
 * open.subscribe(v => console.log('open:', v))
 * ```
 */
export declare function useToggle(initial?: boolean): [ToggleRef, () => void, (v: boolean) => void];
/**
 * Numeric counter with min/max bounds.
 *
 * @example
 * ```ts
 * const counter = useCounter(0, { min: 0, max: 10 })
 * counter.inc()   // 1
 * counter.dec(3)  // 0 (clamped to min)
 * counter.set(5)  // 5
 * counter.reset() // 0
 * ```
 */
export declare function useCounter(initial?: number, options?: CounterOptions): CounterRef;
/**
 * Run a handler when clicking outside a target element.
 *
 * @example
 * ```ts
 * useClickOutside('#dropdown', () => closeDropdown())
 * useClickOutside(menuElement, () => closeMenu())
 * ```
 */
export declare function useClickOutside(target: string | Element, handler: (event: MouseEvent) => void): ClickOutsideRef;
/**
 * Track and control focus state of an element.
 *
 * @example
 * ```ts
 * const { isFocused, focus, blur } = useFocus('#search-input')
 * focus()
 * ```
 */
export declare function useFocus(target: string | Element): FocusRef;
/**
 * Wrap an async function with reactive loading/error/data state.
 *
 * @example
 * ```ts
 * const { data, isLoading, error, execute } = useAsync(
 *   () => fetch('/api/users').then(r => r.json()),
 *   { immediate: true }
 * )
 * ```
 */
export declare function useAsync<T>(fn: (...args: any[]) => Promise<T>, options?: AsyncOptions): AsyncRef<T>;
/**
 * useToggle, useCounter, useClickOutside, useFocus, useAsync
 *
 * General-purpose utility composables with auto-cleanup.
 * SSR-safe — DOM-dependent composables return no-op stubs when `window` is unavailable.
 */
// =============================================================================
// Types
// =============================================================================
export declare interface ToggleRef {
  readonly value: boolean
  subscribe: (fn: (value: boolean) => void) => () => void
}
export declare interface CounterOptions {
  min?: number
  max?: number
}
export declare interface CounterRef {
  readonly count: number
  inc: (step?: number) => void
  dec: (step?: number) => void
  set: (value: number) => void
  reset: () => void
  subscribe: (fn: (count: number) => void) => () => void
}
export declare interface ClickOutsideRef {
  remove: () => void
}
export declare interface FocusRef {
  readonly isFocused: boolean
  focus: () => void
  blur: () => void
  subscribe: (fn: (isFocused: boolean) => void) => () => void
}
export declare interface AsyncRef<T> {
  readonly state: AsyncState
  readonly isLoading: boolean
  readonly error: Error | null
  readonly data: T | null
  execute: (...args: any[]) => Promise<T | null>
  subscribe: (fn: (snapshot: { state: AsyncState, data: T | null, error: Error | null }) => void) => () => void
}
export declare interface AsyncOptions {
  immediate?: boolean
}
export type AsyncState = 'idle' | 'loading' | 'success' | 'error';
