/** * Copyright (c) 2017-present, RobotlegsJS. All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { IOnceSignal } from "./IOnceSignal"; import { ISlot } from "./ISlot"; import { SlotList } from "./SlotList"; /** * Allows the valueClasses to be set in MXML, e.g. * {[String, uint]} */ /** * Signal dispatches events to multiple listeners. * It is inspired by C# events and delegates, and by * signals and slots * in Qt. * A Signal adds event dispatching functionality through composition and interfaces, * rather than inheriting from a dispatcher. *

* Project home: http://github.com/robertpenner/as3-signals/ */ export declare class OnceSignal implements IOnceSignal { protected _valueClasses: any[]; protected slots: SlotList; /** * Creates a Signal instance to dispatch value objects. * * @param valueClasses Any number of class references that enable type checks in dispatch(). * For example, new Signal(String, uint) * would allow: signal.dispatch("the Answer", 42) * but not: signal.dispatch(true, 42.5) * nor: signal.dispatch() * * NOTE: In AS3, subclasses cannot call super.apply(null, valueClasses), * but this constructor has logic to support super(valueClasses). */ constructor(...valueClasses: any[]); /** * @inheritDoc * @throws ArgumentError ArgumentError: Invalid valueClasses argument: item at index should be a Class but was not. */ get valueClasses(): any[]; set valueClasses(value: any[]); /** @inheritDoc */ get numListeners(): number; /** * @inheritDoc * @throws flash.errors.IllegalOperationError IllegalOperationError: You cannot addOnce() then add() the same listener without removing the relationship first. * @throws ArgumentError ArgumentError: Given listener is null. */ addOnce(listener: Function): ISlot; /** @inheritDoc */ remove(listener: Function): ISlot; /** @inheritDoc */ removeAll(): void; /** * @inheritDoc * @throws ArgumentError ArgumentError: Incorrect number of arguments. * @throws ArgumentError ArgumentError: Value object is not an instance of the appropriate valueClasses Class. */ dispatch(...valueObjects: any[]): void; protected registerListener(listener: Function, once?: boolean): ISlot; protected registrationPossible(listener: Function, once: boolean): boolean; }