fix(typings): add more missing typings.

This is the same bug pattern I reported in https://github.com/Microsoft/TypeScript/issues/5187

Closes #4636
This commit is contained in:
Alex Eagle 2015-10-09 09:28:12 -07:00 committed by Alex Eagle
parent c178ad476e
commit aab0c57aee
6 changed files with 17 additions and 17 deletions

View File

@ -260,7 +260,7 @@ export class SelectorMatcher {
* @param matchedCallback This callback will be called with the object handed into `addSelectable` * @param matchedCallback This callback will be called with the object handed into `addSelectable`
* @return boolean true if a match was found * @return boolean true if a match was found
*/ */
match(cssSelector: CssSelector, matchedCallback: (CssSelector, any) => void): boolean { match(cssSelector: CssSelector, matchedCallback: (c: CssSelector, a: any) => void): boolean {
var result = false; var result = false;
var element = cssSelector.element; var element = cssSelector.element;
var classNames = cssSelector.classNames; var classNames = cssSelector.classNames;
@ -313,7 +313,7 @@ export class SelectorMatcher {
} }
_matchTerminal(map: Map<string, SelectorContext[]>, name, cssSelector: CssSelector, _matchTerminal(map: Map<string, SelectorContext[]>, name, cssSelector: CssSelector,
matchedCallback: (CssSelector, any) => void): boolean { matchedCallback: (c: CssSelector, a: any) => void): boolean {
if (isBlank(map) || isBlank(name)) { if (isBlank(map) || isBlank(name)) {
return false; return false;
} }
@ -336,7 +336,7 @@ export class SelectorMatcher {
} }
_matchPartial(map: Map<string, SelectorMatcher>, name, cssSelector: CssSelector, _matchPartial(map: Map<string, SelectorMatcher>, name, cssSelector: CssSelector,
matchedCallback /*: (CssSelector, any) => void*/): boolean { matchedCallback /*: (c: CssSelector, a: any) => void*/): boolean {
if (isBlank(map) || isBlank(name)) { if (isBlank(map) || isBlank(name)) {
return false; return false;
} }
@ -367,7 +367,7 @@ export class SelectorContext {
this.notSelectors = selector.notSelectors; this.notSelectors = selector.notSelectors;
} }
finalize(cssSelector: CssSelector, callback: (CssSelector, any) => void): boolean { finalize(cssSelector: CssSelector, callback: (c: CssSelector, a: any) => void): boolean {
var result = true; var result = true;
if (this.notSelectors.length > 0 && if (this.notSelectors.length > 0 &&
(isBlank(this.listContext) || !this.listContext.alreadyMatched)) { (isBlank(this.listContext) || !this.listContext.alreadyMatched)) {

View File

@ -12,11 +12,11 @@ import {NgZone} from 'angular2/src/core/zone/ng_zone';
import {Injectable} from 'angular2/src/core/di'; import {Injectable} from 'angular2/src/core/di';
var modifierKeys = ['alt', 'control', 'meta', 'shift']; var modifierKeys = ['alt', 'control', 'meta', 'shift'];
var modifierKeyGetters: {[key: string]: Function} = { var modifierKeyGetters: {[key: string]: (event: KeyboardEvent) => boolean} = {
'alt': (event) => event.altKey, 'alt': (event: KeyboardEvent) => event.altKey,
'control': (event) => event.ctrlKey, 'control': (event: KeyboardEvent) => event.ctrlKey,
'meta': (event) => event.metaKey, 'meta': (event: KeyboardEvent) => event.metaKey,
'shift': (event) => event.shiftKey 'shift': (event: KeyboardEvent) => event.shiftKey
}; };
@Injectable() @Injectable()
@ -69,7 +69,7 @@ export class KeyEventsPlugin extends EventManagerPlugin {
return result; return result;
} }
static getEventFullKey(event: Event): string { static getEventFullKey(event: KeyboardEvent): string {
var fullKey = ''; var fullKey = '';
var key = DOM.getEventKey(event); var key = DOM.getEventKey(event);
key = key.toLowerCase(); key = key.toLowerCase();
@ -91,7 +91,7 @@ export class KeyEventsPlugin extends EventManagerPlugin {
} }
static eventCallback(element: HTMLElement, fullKey: any, handler: (Event) => any, zone: NgZone): static eventCallback(element: HTMLElement, fullKey: any, handler: (Event) => any, zone: NgZone):
(event: Event) => void { (event: KeyboardEvent) => void {
return (event) => { return (event) => {
if (StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { if (StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) {
zone.run(() => handler(event)); zone.run(() => handler(event));

View File

@ -90,7 +90,7 @@ export class NgZone {
_onTurnStart: () => void; _onTurnStart: () => void;
_onTurnDone: () => void; _onTurnDone: () => void;
_onEventDone: () => void; _onEventDone: () => void;
_onErrorHandler: (error, stack) => void; _onErrorHandler: (error: any, stack: any) => void;
// Number of microtasks pending from _innerZone (& descendants) // Number of microtasks pending from _innerZone (& descendants)
_pendingMicrotasks: number; _pendingMicrotasks: number;

View File

@ -10956,7 +10956,7 @@
} }
}, },
"ts2dart": { "ts2dart": {
"version": "0.7.11", "version": "0.7.12",
"dependencies": { "dependencies": {
"source-map": { "source-map": {
"version": "0.4.4", "version": "0.4.4",

6
npm-shrinkwrap.json generated
View File

@ -16912,9 +16912,9 @@
} }
}, },
"ts2dart": { "ts2dart": {
"version": "0.7.11", "version": "0.7.12",
"from": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.11.tgz", "from": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.12.tgz",
"resolved": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.11.tgz", "resolved": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.12.tgz",
"dependencies": { "dependencies": {
"source-map": { "source-map": {
"version": "0.4.4", "version": "0.4.4",

View File

@ -128,7 +128,7 @@
"temp": "^0.8.1", "temp": "^0.8.1",
"ternary-stream": "^1.2.3", "ternary-stream": "^1.2.3",
"through2": "^0.6.1", "through2": "^0.6.1",
"ts2dart": "^0.7.11", "ts2dart": "^0.7.12",
"tsd": "^0.6.5-beta", "tsd": "^0.6.5-beta",
"tslint": "^2.5.0", "tslint": "^2.5.0",
"typescript": "^1.6.2", "typescript": "^1.6.2",