chore(typings): remove StringMap

This was a poorly typed attempt to mimic TypeScript's index signatures,
which we can use instead.
This eliminates a very strange type that we were exposing to users, but
not re-exporting through our public API.

Fixes #4483
This commit is contained in:
Alex Eagle
2015-10-02 16:47:54 -07:00
committed by Alex Eagle
parent 2ebc74ddcc
commit 7c4199cd1c
76 changed files with 231 additions and 291 deletions
@@ -1,4 +1,4 @@
import {StringMap, StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
import {StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
import {
MessageBusSink,
MessageBusSource,
@@ -13,11 +13,11 @@ import {NgZone} from 'angular2/src/core/zone/ng_zone';
* Such that whatever goes into one's sink comes out the others source.
*/
export function createPairedMessageBuses(): PairedMessageBuses {
var firstChannels: StringMap<string, MockEventEmitter> = {};
var firstChannels: {[key: string]: MockEventEmitter} = {};
var workerMessageBusSink = new MockMessageBusSink(firstChannels);
var uiMessageBusSource = new MockMessageBusSource(firstChannels);
var secondChannels: StringMap<string, MockEventEmitter> = {};
var secondChannels: {[key: string]: MockEventEmitter} = {};
var uiMessageBusSink = new MockMessageBusSink(secondChannels);
var workerMessageBusSource = new MockMessageBusSource(secondChannels);
@@ -30,7 +30,7 @@ export class PairedMessageBuses {
}
export class MockMessageBusSource implements MessageBusSource {
constructor(private _channels: StringMap<string, MockEventEmitter>) {}
constructor(private _channels: {[key: string]: MockEventEmitter}) {}
initChannel(channel: string, runInZone = true) {
if (!StringMapWrapper.contains(this._channels, channel)) {
@@ -49,7 +49,7 @@ export class MockMessageBusSource implements MessageBusSource {
}
export class MockMessageBusSink implements MessageBusSink {
constructor(private _channels: StringMap<string, MockEventEmitter>) {}
constructor(private _channels: {[key: string]: MockEventEmitter}) {}
initChannel(channel: string, runInZone = true) {
if (!StringMapWrapper.contains(this._channels, channel)) {