mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-08 16:40:30 +08:00
Merge pull request #5741 from chrootsu/riotcontrol
riotcontrol: added definitions and tests
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/// <reference path="./riotcontrol.d.ts" />
|
||||
|
||||
import riotcontrol = require('riotcontrol');
|
||||
|
||||
{
|
||||
let store: RiotControl.Store;
|
||||
let result: void;
|
||||
result = riotcontrol.addStore(store);
|
||||
}
|
||||
|
||||
{
|
||||
let events: string;
|
||||
let fn: Function;
|
||||
let result: void;
|
||||
result = riotcontrol.on(events, fn);
|
||||
}
|
||||
|
||||
{
|
||||
let name: string;
|
||||
let fn: Function;
|
||||
let result: void;
|
||||
result = riotcontrol.one(name, fn);
|
||||
}
|
||||
|
||||
{
|
||||
let events: string;
|
||||
let fn: Function;
|
||||
let result: void;
|
||||
result = riotcontrol.off(events);
|
||||
result = riotcontrol.off(events, fn);
|
||||
}
|
||||
|
||||
{
|
||||
let name: string;
|
||||
let arg: any;
|
||||
let result: void;
|
||||
result = riotcontrol.trigger(name);
|
||||
result = riotcontrol.trigger(name, arg);
|
||||
result = riotcontrol.trigger(name, arg, arg);
|
||||
result = riotcontrol.trigger(name, arg, arg, arg);
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for RiotControl
|
||||
// Project: https://github.com/jimsparkman/RiotControl
|
||||
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module RiotControl {
|
||||
interface Store {
|
||||
on(events: string, fn: Function): Store;
|
||||
one(name: string, fn: Function): Store;
|
||||
off(events: string, fn?: Function): Store;
|
||||
trigger(name: string, ...args: any[]): Store;
|
||||
}
|
||||
|
||||
var _stores: Store[];
|
||||
|
||||
function addStore(store: Store): void;
|
||||
|
||||
function on(events: string, fn: Function): void;
|
||||
function one(name: string, fn: Function): void;
|
||||
function off(events: string, fn?: Function): void;
|
||||
function trigger(name: string, ...args: any[]): void;
|
||||
}
|
||||
|
||||
declare module "riotcontrol" {
|
||||
export = RiotControl;
|
||||
}
|
||||
Reference in New Issue
Block a user