-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
896 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
interface Constructor<T> { | ||
new (...args: any[]): T; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,61 @@ | ||
declare module 'aurelia-event-aggregator' { | ||
import * as LogManager from 'aurelia-logging'; | ||
|
||
/** | ||
* Represents a disposable subsciption to an EventAggregator event. | ||
*/ | ||
export interface Subscription { | ||
|
||
/** | ||
* Represents a disposable subsciption to an EventAggregator event. | ||
*/ | ||
export interface Subscription { | ||
/** | ||
* Disposes the subscription. | ||
*/ | ||
* Disposes the subscription. | ||
*/ | ||
dispose(): void; | ||
} | ||
class Handler { | ||
constructor(messageType: any, callback: any); | ||
handle(message: any): any; | ||
} | ||
|
||
/** | ||
* Enables loosely coupled publish/subscribe messaging. | ||
*/ | ||
export class EventAggregator { | ||
|
||
} | ||
/** | ||
* Enables loosely coupled publish/subscribe messaging. | ||
*/ | ||
export declare class EventAggregator { | ||
private eventLookup; | ||
private messageHandlers; | ||
/** | ||
* Creates an instance of the EventAggregator class. | ||
*/ | ||
constructor(); | ||
|
||
* Publishes a message. | ||
* @param event The message data type to publish to. | ||
*/ | ||
publish<T>(event: T): void; | ||
/** | ||
* Publishes a message. | ||
* @param event The event or channel to publish to. | ||
* @param data The data to publish on the channel. | ||
*/ | ||
publish(event: string | any, data?: any): void; | ||
|
||
* Publishes a message. | ||
* @param event The message channel to publish to. | ||
* @param data The data to publish on the channel. | ||
*/ | ||
publish(event: string, data?: any): void; | ||
/** | ||
* Subscribes to a message channel or message type. | ||
* @param event The event channel or event data type. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribe(event: string | Function, callback: Function): Subscription; | ||
|
||
* Subscribes to a message type. | ||
* @param event The message data Type to subscribe to. | ||
* @param callback The callback to be invoked when the specified message is published. | ||
*/ | ||
subscribe<T>(event: Constructor<T>, callback: (message: T) => void): Subscription; | ||
/** | ||
* Subscribes to a message channel or message type, then disposes the subscription automatically after the first message is received. | ||
* @param event The event channel or event data type. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribeOnce(event: string | Function, callback: Function): Subscription; | ||
} | ||
|
||
/** | ||
* Includes EA functionality into an object instance. | ||
* @param obj The object to mix Event Aggregator functionality into. | ||
*/ | ||
export function includeEventsIn(obj: Object): EventAggregator; | ||
|
||
/** | ||
* Configures a global EA by merging functionality into the Aurelia instance. | ||
* @param config The Aurelia Framework configuration object used to configure the plugin. | ||
*/ | ||
export function configure(config: Object): void; | ||
} | ||
* Subscribes to a message channel. | ||
* @param event The message channel to subscribe to. | ||
* @param callback The callback to be invoked when the specified message is published. | ||
*/ | ||
subscribe(event: string, callback: (message: any, event?: string) => void): Subscription; | ||
/** | ||
* Subscribes to a message type, then disposes the subscription automatically after the first message is received. | ||
* @param event The message data Type to subscribe to. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribeOnce<T>(event: Constructor<T>, callback: (message: T) => void): Subscription; | ||
/** | ||
* Subscribes to a message channel, then disposes the subscription automatically after the first message is received. | ||
* @param event The message channel to subscribe to. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribeOnce(event: string, callback: (message: any, event?: string) => void): Subscription; | ||
} | ||
/** | ||
* Includes Event Aggregator functionality into an object instance. | ||
* @param obj The object to mix Event Aggregator functionality into. | ||
*/ | ||
export declare function includeEventsIn(obj: any): EventAggregator; | ||
/** | ||
* Configures a global Event Aggregator by merging functionality into the Aurelia instance. | ||
* @param config The Aurelia Framework configuration object used to configure the plugin. | ||
*/ | ||
export declare function configure(config: any): void; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,61 @@ | ||
declare module 'aurelia-event-aggregator' { | ||
import * as LogManager from 'aurelia-logging'; | ||
|
||
/** | ||
* Represents a disposable subsciption to an EventAggregator event. | ||
*/ | ||
export interface Subscription { | ||
|
||
/** | ||
* Represents a disposable subsciption to an EventAggregator event. | ||
*/ | ||
export interface Subscription { | ||
/** | ||
* Disposes the subscription. | ||
*/ | ||
* Disposes the subscription. | ||
*/ | ||
dispose(): void; | ||
} | ||
class Handler { | ||
constructor(messageType: any, callback: any); | ||
handle(message: any): any; | ||
} | ||
|
||
/** | ||
* Enables loosely coupled publish/subscribe messaging. | ||
*/ | ||
export class EventAggregator { | ||
|
||
} | ||
/** | ||
* Enables loosely coupled publish/subscribe messaging. | ||
*/ | ||
export declare class EventAggregator { | ||
private eventLookup; | ||
private messageHandlers; | ||
/** | ||
* Creates an instance of the EventAggregator class. | ||
*/ | ||
constructor(); | ||
|
||
* Publishes a message. | ||
* @param event The message data type to publish to. | ||
*/ | ||
publish<T>(event: T): void; | ||
/** | ||
* Publishes a message. | ||
* @param event The event or channel to publish to. | ||
* @param data The data to publish on the channel. | ||
*/ | ||
publish(event: string | any, data?: any): void; | ||
|
||
* Publishes a message. | ||
* @param event The message channel to publish to. | ||
* @param data The data to publish on the channel. | ||
*/ | ||
publish(event: string, data?: any): void; | ||
/** | ||
* Subscribes to a message channel or message type. | ||
* @param event The event channel or event data type. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribe(event: string | Function, callback: Function): Subscription; | ||
|
||
* Subscribes to a message type. | ||
* @param event The message data Type to subscribe to. | ||
* @param callback The callback to be invoked when the specified message is published. | ||
*/ | ||
subscribe<T>(event: Constructor<T>, callback: (message: T) => void): Subscription; | ||
/** | ||
* Subscribes to a message channel or message type, then disposes the subscription automatically after the first message is received. | ||
* @param event The event channel or event data type. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribeOnce(event: string | Function, callback: Function): Subscription; | ||
} | ||
|
||
/** | ||
* Includes EA functionality into an object instance. | ||
* @param obj The object to mix Event Aggregator functionality into. | ||
*/ | ||
export function includeEventsIn(obj: Object): EventAggregator; | ||
|
||
/** | ||
* Configures a global EA by merging functionality into the Aurelia instance. | ||
* @param config The Aurelia Framework configuration object used to configure the plugin. | ||
*/ | ||
export function configure(config: Object): void; | ||
} | ||
* Subscribes to a message channel. | ||
* @param event The message channel to subscribe to. | ||
* @param callback The callback to be invoked when the specified message is published. | ||
*/ | ||
subscribe(event: string, callback: (message: any, event?: string) => void): Subscription; | ||
/** | ||
* Subscribes to a message type, then disposes the subscription automatically after the first message is received. | ||
* @param event The message data Type to subscribe to. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribeOnce<T>(event: Constructor<T>, callback: (message: T) => void): Subscription; | ||
/** | ||
* Subscribes to a message channel, then disposes the subscription automatically after the first message is received. | ||
* @param event The message channel to subscribe to. | ||
* @param callback The callback to be invoked when when the specified message is published. | ||
*/ | ||
subscribeOnce(event: string, callback: (message: any, event?: string) => void): Subscription; | ||
} | ||
/** | ||
* Includes Event Aggregator functionality into an object instance. | ||
* @param obj The object to mix Event Aggregator functionality into. | ||
*/ | ||
export declare function includeEventsIn(obj: any): EventAggregator; | ||
/** | ||
* Configures a global Event Aggregator by merging functionality into the Aurelia instance. | ||
* @param config The Aurelia Framework configuration object used to configure the plugin. | ||
*/ | ||
export declare function configure(config: any): void; |
Oops, something went wrong.