amitt - v1.0.20
    Preparing search index...

    Interface AmittEmitter<Keys, Events>

    interface AmittEmitter<
        Keys extends EventType = any,
        Events extends Map<string, Set<any>> = Map<string, Set<any>>,
    > {
        emit<U extends any[] = [], V extends any[] = any[]>(
            type: Keys,
            ...args: U,
        ): V;
        off<U = any>(type: string, handler: U): boolean;
        on<U extends any[] = [], V = any>(
            type: string,
            handler: (
                ...args: [...U[], { once: boolean; type: Keys }],
            ) => V | Promise<V>,
        ): boolean;
        once<U extends any[] = [], V = any>(
            type: string,
            handler: (
                ...args: [...U[], { once: boolean; type: Keys }],
            ) => V | Promise<V>,
        ): boolean;
    }

    Type Parameters

    • Keys extends EventType = any
    • Events extends Map<string, Set<any>> = Map<string, Set<any>>
    Index

    Methods

    Methods

    • Type Parameters

      • U extends any[] = []
      • V extends any[] = any[]

      Parameters

      Returns V

    • Type Parameters

      • U = any

      Parameters

      • type: string
      • handler: U

      Returns boolean

    • Type Parameters

      • U extends any[] = []
      • V = any

      Parameters

      • type: string
      • handler: (...args: [...U[], { once: boolean; type: Keys }]) => V | Promise<V>

      Returns boolean

    • Type Parameters

      • U extends any[] = []
      • V = any

      Parameters

      • type: string
      • handler: (...args: [...U[], { once: boolean; type: Keys }]) => V | Promise<V>

      Returns boolean