chore: add more type annotations

This commit is contained in:
Kevin Moore
2015-04-19 14:47:02 -07:00
parent e23004df52
commit f7f06c5ad4
17 changed files with 80 additions and 81 deletions

View File

@ -15,7 +15,7 @@ export class CSSClass {
this._domEl = ngEl.domElement;
}
_toggleClass(className, enabled) {
_toggleClass(className, enabled):void {
if (enabled) {
DOM.addClass(this._domEl, className);
} else {

View File

@ -40,7 +40,7 @@ export class If {
this.prevCondition = null;
}
set condition(newCondition) {
set condition(newCondition /* boolean */) {
if (newCondition && (isBlank(this.prevCondition) || !this.prevCondition)) {
this.prevCondition = true;
this.viewContainer.create();

View File

@ -65,7 +65,7 @@ export class Switch {
this._switchValue = value;
}
_onWhenValueChanged(oldWhen, newWhen, viewContainer: ViewContainer) {
_onWhenValueChanged(oldWhen, newWhen, viewContainer: ViewContainer):void {
this._deregisterViewContainer(oldWhen, viewContainer);
this._registerViewContainer(newWhen, viewContainer);
@ -88,7 +88,7 @@ export class Switch {
}
}
_emptyAllActiveViewContainers() {
_emptyAllActiveViewContainers():void {
var activeContainers = this._activeViewContainers;
for (var i = 0; i < activeContainers.length; i++) {
activeContainers[i].remove();
@ -96,7 +96,7 @@ export class Switch {
this._activeViewContainers = ListWrapper.create();
}
_activateViewContainers(containers: List<ViewContainer>) {
_activateViewContainers(containers: List<ViewContainer>):void {
// TODO(vicb): assert(this._activeViewContainers.length === 0);
if (isPresent(containers)) {
for (var i = 0; i < containers.length; i++) {
@ -106,7 +106,7 @@ export class Switch {
}
}
_registerViewContainer(value, container: ViewContainer) {
_registerViewContainer(value, container: ViewContainer): void {
var containers = MapWrapper.get(this._valueViewContainers, value);
if (isBlank(containers)) {
containers = ListWrapper.create();
@ -115,7 +115,7 @@ export class Switch {
ListWrapper.push(containers, container);
}
_deregisterViewContainer(value, container: ViewContainer) {
_deregisterViewContainer(value, container: ViewContainer):void {
// `_whenDefault` is used a marker for non-registered whens
if (value == _whenDefault) return;
var containers = MapWrapper.get(this._valueViewContainers, value);