Skip to content

Commit bb71379

Browse files
Merge pull request #43 from RobotlegsJS/general-types
Adhere to TypeScript Guidelines for General Types
2 parents a1425bf + 63f4e4e commit bb71379

File tree

11 files changed

+28
-26
lines changed

11 files changed

+28
-26
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
### v0.0.13
2222

23+
- Adhere to TypeScript Guidelines for General Types (see #43).
24+
2325
- Improve code coverage to reach 100% (see #42).
2426

2527
- Use `rimraf` instead of `rm -rf` (see #41).

src/org/osflash/signals/DeluxeSignal.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IEvent } from "./events/IEvent";
1919
* Project home: <a target="_top" href="http://github.com/robertpenner/as3-signals/">http://github.com/robertpenner/as3-signals/</a>
2020
*/
2121
export class DeluxeSignal extends PrioritySignal {
22-
protected _target: Object;
22+
protected _target: any;
2323

2424
/**
2525
* Creates a DeluxeSignal instance to dispatch events on behalf of a target object.
@@ -33,7 +33,7 @@ export class DeluxeSignal extends PrioritySignal {
3333
* NOTE: Subclasses cannot call super.apply(null, valueClasses),
3434
* but this constructor has logic to support super(valueClasses).
3535
*/
36-
constructor(target: Object = null, ...valueClasses: any[]) {
36+
constructor(target: any = null, ...valueClasses: any[]) {
3737
// Cannot use super.apply(null, valueClasses), so allow the subclass to call super(valueClasses).
3838
valueClasses = valueClasses.length === 1 && valueClasses[0] instanceof Array ? valueClasses[0] : valueClasses;
3939

@@ -45,11 +45,11 @@ export class DeluxeSignal extends PrioritySignal {
4545
}
4646

4747
/** @inheritDoc */
48-
public get target(): Object {
48+
public get target(): any {
4949
return this._target;
5050
}
5151

52-
public set target(value: Object) {
52+
public set target(value: any) {
5353
if (value === this._target) {
5454
return;
5555
}
@@ -109,7 +109,7 @@ export class DeluxeSignal extends PrioritySignal {
109109
return;
110110
}
111111

112-
let currentTarget: Object = this.target;
112+
let currentTarget: any = this.target;
113113

114114
while (currentTarget && currentTarget.hasOwnProperty("parent")) {
115115
currentTarget = (<any>currentTarget).parent;

src/org/osflash/signals/ISlot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface ISlot {
5151
* Existing <code>params</code> are appended before the listener is called.
5252
* @param value The argument for the listener.
5353
*/
54-
execute1(value: Object): void;
54+
execute1(value: any): void;
5555

5656
/**
5757
* Executes a listener of arity <code>n</code> where <code>n</code> is

src/org/osflash/signals/Slot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class Slot implements ISlot {
5757
/**
5858
* @inheritDoc
5959
*/
60-
public execute1(value: Object): void {
60+
public execute1(value: any): void {
6161
if (!this._enabled) {
6262
return;
6363
}

src/org/osflash/signals/events/GenericEvent.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { IPrioritySignal } from "../IPrioritySignal";
88
*/
99
export class GenericEvent implements IEvent {
1010
protected _bubbles: boolean;
11-
protected _target: Object;
12-
protected _currentTarget: Object;
11+
protected _target: any;
12+
protected _currentTarget: any;
1313
protected _signal: IPrioritySignal;
1414

1515
constructor(bubbles: boolean = false) {
@@ -26,20 +26,20 @@ export class GenericEvent implements IEvent {
2626
}
2727

2828
/** @inheritDoc */
29-
public get target(): Object {
29+
public get target(): any {
3030
return this._target;
3131
}
3232

33-
public set target(value: Object) {
33+
public set target(value: any) {
3434
this._target = value;
3535
}
3636

3737
/** @inheritDoc */
38-
public get currentTarget(): Object {
38+
public get currentTarget(): any {
3939
return this._currentTarget;
4040
}
4141

42-
public set currentTarget(value: Object) {
42+
public set currentTarget(value: any) {
4343
this._currentTarget = value;
4444
}
4545

src/org/osflash/signals/events/IEvent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ export interface IEvent {
55
* The object that originally dispatched the event.
66
* When dispatched from an signal, the target is the object containing the signal.
77
*/
8-
target: Object;
8+
target: any;
99

1010
/**
1111
* The object that added the listener for the event.
1212
*/
13-
currentTarget: Object;
13+
currentTarget: any;
1414

1515
/**
1616
* The signal that dispatched the event.

test/org/osflash/signals/AmbiguousRelationshipTest.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Signal } from "../../../../src/org/osflash/signals/Signal";
66
import { failIfCalled } from "../../../util/TestBase";
77

88
describe("AmbiguousRelationshipTest", () => {
9-
let target: Object;
9+
let target: any;
1010
let instance: Signal;
1111

1212
beforeEach(() => {

test/org/osflash/signals/DeluxeSignalWithBubblingEventTest.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ describe("DeluxeSignalWithBubblingEventTest", () => {
8383
});
8484

8585
class Child implements IBubbleEventHandler {
86-
public parent: Object;
86+
public parent: any;
8787
public completed: DeluxeSignal;
8888
public name: string;
8989
public listener: Function = null;
9090
public popsBubbles: boolean = false;
9191

92-
constructor(parent: Object = null, name = "", listener = null) {
92+
constructor(parent: any = null, name = "", listener = null) {
9393
this.parent = parent;
9494
this.name = name;
9595
this.listener = listener;

test/org/osflash/signals/MonoSignalDispatchNonEventTest.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("MonoSignalDispatchNonEventTest", () => {
3838
completed.dispatch(0, 0);
3939
});
4040

41-
function onZeroZero(a: Object, b: Object): void {
41+
function onZeroZero(a: any, b: any): void {
4242
assert.equal(0, a);
4343
assert.equal(0, b);
4444
}

test/org/osflash/signals/PromiseTest.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ describe("PromiseTest", () => {
2525
});
2626

2727
it("addOncedListenerWillReceiveDataWhenPromiseIsDispatched()", () => {
28-
let received: Object;
28+
let received: any;
2929

30-
function listener(data: Object): void {
30+
function listener(data: any): void {
3131
received = data;
3232
}
3333

34-
let object: Object = { hello: "world" };
34+
let object: any = { hello: "world" };
3535
promise.addOnce(listener);
3636
promise.dispatch(object);
3737

@@ -52,13 +52,13 @@ describe("PromiseTest", () => {
5252
});
5353

5454
it("listenerWillReceiveDataWhenBoundAfterPromiseIsDispatched()", () => {
55-
let received: Object;
55+
let received: any;
5656

57-
function listener(data: Object): void {
57+
function listener(data: any): void {
5858
received = data;
5959
}
6060

61-
let object: Object = { hello: "world" };
61+
let object: any = { hello: "world" };
6262
promise.dispatch(object);
6363
promise.addOnce(listener);
6464

0 commit comments

Comments
 (0)