import { Component } from "./Component";
/**
 * Signal is a typed event mechanism for Galacean Engine.
 * @typeParam T - Tuple type of the signal arguments
 */
export declare class Signal<T extends any[] = []> {
    private _listeners;
    /**
     * Add a listener for this signal.
     * @param fn - The callback function
     * @param target - The `this` context for the callback
     */
    on(fn: (...args: T) => void, target?: any): void;
    /**
     * Add a structured binding listener. Structured bindings support clone remapping.
     * The target method will be invoked as `method(...signalArgs, ...args)` —
     * runtime signal arguments come first, bound arguments are appended.
     * @param target - The target component
     * @param methodName - The method name to invoke on the target
     * @param args - Pre-resolved arguments appended after the runtime signal arguments
     */
    on(target: Component, methodName: string, ...args: any[]): void;
    /**
     * Add a one-time listener that is automatically removed after first invocation.
     * @param fn - The callback function
     * @param target - The `this` context for the callback
     */
    once(fn: (...args: T) => void, target?: any): void;
    /**
     * Add a one-time structured binding listener.
     * The target method will be invoked as `method(...signalArgs, ...args)` —
     * runtime signal arguments come first, bound arguments are appended.
     * @param target - The target component
     * @param methodName - The method name to invoke on the target
     * @param args - Pre-resolved arguments appended after the runtime signal arguments
     */
    once(target: Component, methodName: string, ...args: any[]): void;
    /**
     * Remove a listener. Both `fn` and `target` must match the values passed to `on`/`once`.
     * @param fn - The callback function to remove
     * @param target - The `this` context that was used when adding the listener
     */
    off(fn: (...args: T) => void, target?: any): void;
    /**
     * Remove a structured binding listener by target and method name.
     * @param target - The target component
     * @param methodName - The method name
     */
    off(target: Component, methodName: string): void;
    /**
     * Remove all listeners, or all listeners for a specific target.
     * @param target - If provided, only remove listeners bound to this target
     */
    removeAll(target?: any): void;
    /**
     * Invoke the signal, calling all listeners in order.
     * @param args - Arguments to pass to each listener
     */
    invoke(...args: T): void;
    private _cloneArguments;
    private _addListener;
}
