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

View File

@ -117,7 +117,7 @@ class DirectiveWithoutModuleId {
class ComponentWithEverything implements OnChanges,
OnInit, DoCheck, OnDestroy, AfterContentInit, AfterContentChecked, AfterViewInit,
AfterViewChecked {
onChanges(changes: StringMap<string, SimpleChange>): void {}
onChanges(changes: {[key: string]: SimpleChange}): void {}
onInit(): void {}
doCheck(): void {}
onDestroy(): void {}

View File

@ -1,10 +1,9 @@
import {ElementSchemaRegistry} from 'angular2/src/core/compiler/schema/element_schema_registry';
import {StringMap} from 'angular2/src/core/facade/collection';
import {isPresent} from 'angular2/src/core/facade/lang';
export class MockSchemaRegistry implements ElementSchemaRegistry {
constructor(public existingProperties: StringMap<string, boolean>,
public attrPropMapping: StringMap<string, string>) {}
constructor(public existingProperties: {[key: string]: boolean},
public attrPropMapping: {[key: string]: string}) {}
hasProperty(tagName: string, property: string): boolean {
var result = this.existingProperties[property];
return isPresent(result) ? result : true;

View File

@ -325,10 +325,10 @@ function testableStylesModule(sourceModule: SourceModule): SourceModule {
// Attention: read by eval!
export function humanizeTemplate(template: CompiledTemplate,
humanizedTemplates: Map<number, StringMap<string, any>> = null):
StringMap<string, any> {
humanizedTemplates: Map<number, {[key: string]: any}> = null):
{[key: string]: any} {
if (isBlank(humanizedTemplates)) {
humanizedTemplates = new Map<number, StringMap<string, any>>();
humanizedTemplates = new Map<number, {[key: string]: any}>();
}
var result = humanizedTemplates.get(template.id);
if (isPresent(result)) {
@ -369,7 +369,7 @@ function testChangeDetector(changeDetectorFactory: Function): string[] {
class CommandHumanizer implements CommandVisitor {
constructor(private result: any[],
private humanizedTemplates: Map<number, StringMap<string, any>>) {}
private humanizedTemplates: Map<number, {[key: string]: any}>) {}
visitText(cmd: TextCmd, context: any): any {
this.result.push(`#text(${cmd.value})`);
return null;