electron-direct-ipc - v2.2.3
    Preparing search index...

    Base constraint for event handler maps. Maps event names to handler function signatures.

    IMPORTANT: The use of any here is intentional and necessary for proper type system behavior:

    1. Variance Requirements: Function parameters are contravariant. Using unknown[] or readonly unknown[] causes type incompatibility with transformed types like WithSender<T> which prepends named parameters to the function signature.

    2. Type Inference: any[] allows TypeScript's type inference to flow bidirectionally:

      • From concrete implementations (e.g., { 'user-updated': (userId: string) => void })
      • Through generic constraints (e.g., TMessageMap extends EventMap)
      • To call sites and type transformations
    3. Constraint Satisfaction: Types with named parameters like (sender: DirectIpcTarget, userId: string) => void must satisfy this constraint. Only any[] allows this due to how TypeScript handles tuple vs array variance.

    This is a legitimate use case for any in generic constraints. The actual type safety comes from the concrete generic type parameter, not from the constraint itself.

    See docs/EventMap-Any-Justification.md for detailed explanation.

    Indexable

    • [key: string]: (...args: any[]) => any