chore(ts): fix TODOs that were pending on 1.6 upgrade

Closes #4377
This commit is contained in:
Alex Eagle 2015-09-25 14:48:17 -07:00 committed by Alex Eagle
parent 8ff65a30c7
commit b4fe590b2d
25 changed files with 165 additions and 190 deletions

View File

@ -7,13 +7,6 @@
// ES5, because they are redundant with lib.es6.d.ts. // ES5, because they are redundant with lib.es6.d.ts.
/// <reference path="../typings/es6-promise/es6-promise.d.ts"/> /// <reference path="../typings/es6-promise/es6-promise.d.ts"/>
// es6-promise.d.ts chose a different name for this interface than TS lib.es6.d.ts
// Generic Type Alises are in TS 1.6 (https://github.com/Microsoft/TypeScript/pull/3397)
// So we cannot write:
// declare type PromiseLike = Thenable;
// Until then we use a workaround:
interface PromiseLike<T> extends Thenable<T> {}
// Extend the ES5 standard library with some ES6 features we polyfill at runtime // Extend the ES5 standard library with some ES6 features we polyfill at runtime
// by loading es6-shim.js // by loading es6-shim.js

View File

@ -478,6 +478,10 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
num performanceNow() { num performanceNow() {
return window.performance.now(); return window.performance.now();
} }
parse(s) {
throw 'not implemented';
}
} }
var baseElement = null; var baseElement = null;

View File

@ -61,6 +61,7 @@ var _chromeNumKeyPadMap = {
/* tslint:disable:requireParameterType */ /* tslint:disable:requireParameterType */
export class BrowserDomAdapter extends GenericBrowserDomAdapter { export class BrowserDomAdapter extends GenericBrowserDomAdapter {
parse(templateHtml: string) { throw new Error("parse not implemented"); }
static makeCurrent() { setRootDomAdapter(new BrowserDomAdapter()); } static makeCurrent() { setRootDomAdapter(new BrowserDomAdapter()); }
hasProperty(element, name: string): boolean { return name in element; } hasProperty(element, name: string): boolean { return name in element; }
setProperty(el: /*element*/ any, name: string, value: any) { el[name] = value; } setProperty(el: /*element*/ any, name: string, value: any) { el[name] = value; }

View File

@ -1,5 +1,4 @@
import {isBlank} from 'angular2/src/core/facade/lang'; import {isBlank} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
export var DOM: DomAdapter; export var DOM: DomAdapter;
@ -9,137 +8,129 @@ export function setRootDomAdapter(adapter: DomAdapter) {
} }
} }
function _abstract() {
return new BaseException('This method is abstract');
}
/* tslint:disable:requireParameterType */ /* tslint:disable:requireParameterType */
/** /**
* Provides DOM operations in an environment-agnostic way. * Provides DOM operations in an environment-agnostic way.
*/ */
export class DomAdapter { export abstract class DomAdapter {
hasProperty(element, name: string): boolean { throw _abstract(); } abstract hasProperty(element, name: string): boolean;
setProperty(el: Element, name: string, value: any) { throw _abstract(); } abstract setProperty(el: Element, name: string, value: any);
getProperty(el: Element, name: string): any { throw _abstract(); } abstract getProperty(el: Element, name: string): any;
invoke(el: Element, methodName: string, args: any[]): any { throw _abstract(); } abstract invoke(el: Element, methodName: string, args: any[]): any;
logError(error) { throw _abstract(); } abstract logError(error);
log(error) { throw _abstract(); } abstract log(error);
logGroup(error) { throw _abstract(); } abstract logGroup(error);
logGroupEnd() { throw _abstract(); } abstract logGroupEnd();
/** /**
* Maps attribute names to their corresponding property names for cases * Maps attribute names to their corresponding property names for cases
* where attribute name doesn't match property name. * where attribute name doesn't match property name.
*/ */
get attrToPropMap(): StringMap<string, string> { throw _abstract(); } attrToPropMap: StringMap<string, string>;
parse(templateHtml: string) { throw _abstract(); } abstract parse(templateHtml: string);
query(selector: string): any { throw _abstract(); } abstract query(selector: string): any;
querySelector(el, selector: string): HTMLElement { throw _abstract(); } abstract querySelector(el, selector: string): HTMLElement;
querySelectorAll(el, selector: string): any[] { throw _abstract(); } abstract querySelectorAll(el, selector: string): any[];
on(el, evt, listener) { throw _abstract(); } abstract on(el, evt, listener);
onAndCancel(el, evt, listener): Function { throw _abstract(); } abstract onAndCancel(el, evt, listener): Function;
dispatchEvent(el, evt) { throw _abstract(); } abstract dispatchEvent(el, evt);
createMouseEvent(eventType): any { throw _abstract(); } abstract createMouseEvent(eventType): any;
createEvent(eventType: string): any { throw _abstract(); } abstract createEvent(eventType: string): any;
preventDefault(evt) { throw _abstract(); } abstract preventDefault(evt);
isPrevented(evt): boolean { throw _abstract(); } abstract isPrevented(evt): boolean;
getInnerHTML(el): string { throw _abstract(); } abstract getInnerHTML(el): string;
getOuterHTML(el): string { throw _abstract(); } abstract getOuterHTML(el): string;
nodeName(node): string { throw _abstract(); } abstract nodeName(node): string;
nodeValue(node): string { throw _abstract(); } abstract nodeValue(node): string;
type(node): string { throw _abstract(); } abstract type(node): string;
content(node): any { throw _abstract(); } abstract content(node): any;
firstChild(el): Node { throw _abstract(); } abstract firstChild(el): Node;
nextSibling(el): Node { throw _abstract(); } abstract nextSibling(el): Node;
parentElement(el): Node { throw _abstract(); } abstract parentElement(el): Node;
childNodes(el): Node[] { throw _abstract(); } abstract childNodes(el): Node[];
childNodesAsList(el): Node[] { throw _abstract(); } abstract childNodesAsList(el): Node[];
clearNodes(el) { throw _abstract(); } abstract clearNodes(el);
appendChild(el, node) { throw _abstract(); } abstract appendChild(el, node);
removeChild(el, node) { throw _abstract(); } abstract removeChild(el, node);
replaceChild(el, newNode, oldNode) { throw _abstract(); } abstract replaceChild(el, newNode, oldNode);
remove(el): Node { throw _abstract(); } abstract remove(el): Node;
insertBefore(el, node) { throw _abstract(); } abstract insertBefore(el, node);
insertAllBefore(el, nodes) { throw _abstract(); } abstract insertAllBefore(el, nodes);
insertAfter(el, node) { throw _abstract(); } abstract insertAfter(el, node);
setInnerHTML(el, value) { throw _abstract(); } abstract setInnerHTML(el, value);
getText(el): string { throw _abstract(); } abstract getText(el): string;
setText(el, value: string) { throw _abstract(); } abstract setText(el, value: string);
getValue(el): string { throw _abstract(); } abstract getValue(el): string;
setValue(el, value: string) { throw _abstract(); } abstract setValue(el, value: string);
getChecked(el): boolean { throw _abstract(); } abstract getChecked(el): boolean;
setChecked(el, value: boolean) { throw _abstract(); } abstract setChecked(el, value: boolean);
createComment(text: string): any { throw _abstract(); } abstract createComment(text: string): any;
createTemplate(html): HTMLElement { throw _abstract(); } abstract createTemplate(html): HTMLElement;
createElement(tagName, doc = null): HTMLElement { throw _abstract(); } abstract createElement(tagName, doc?): HTMLElement;
createTextNode(text: string, doc = null): Text { throw _abstract(); } abstract createTextNode(text: string, doc?): Text;
createScriptTag(attrName: string, attrValue: string, doc = null): HTMLElement { abstract createScriptTag(attrName: string, attrValue: string, doc?): HTMLElement;
throw _abstract(); abstract createStyleElement(css: string, doc?): HTMLStyleElement;
} abstract createShadowRoot(el): any;
createStyleElement(css: string, doc = null): HTMLStyleElement { throw _abstract(); } abstract getShadowRoot(el): any;
createShadowRoot(el): any { throw _abstract(); } abstract getHost(el): any;
getShadowRoot(el): any { throw _abstract(); } abstract getDistributedNodes(el): Node[];
getHost(el): any { throw _abstract(); } abstract clone /*<T extends Node>*/ (node: Node /*T*/): Node /*T*/;
getDistributedNodes(el): Node[] { throw _abstract(); } abstract getElementsByClassName(element, name: string): HTMLElement[];
clone /*<T extends Node>*/ (node: Node /*T*/): Node /*T*/ { throw _abstract(); } abstract getElementsByTagName(element, name: string): HTMLElement[];
getElementsByClassName(element, name: string): HTMLElement[] { throw _abstract(); } abstract classList(element): any[];
getElementsByTagName(element, name: string): HTMLElement[] { throw _abstract(); } abstract addClass(element, classname: string);
classList(element): any[] { throw _abstract(); } abstract removeClass(element, classname: string);
addClass(element, classname: string) { throw _abstract(); } abstract hasClass(element, classname: string): boolean;
removeClass(element, classname: string) { throw _abstract(); } abstract setStyle(element, stylename: string, stylevalue: string);
hasClass(element, classname: string): boolean { throw _abstract(); } abstract removeStyle(element, stylename: string);
setStyle(element, stylename: string, stylevalue: string) { throw _abstract(); } abstract getStyle(element, stylename: string): string;
removeStyle(element, stylename: string) { throw _abstract(); } abstract tagName(element): string;
getStyle(element, stylename: string): string { throw _abstract(); } abstract attributeMap(element): Map<string, string>;
tagName(element): string { throw _abstract(); } abstract hasAttribute(element, attribute: string): boolean;
attributeMap(element): Map<string, string> { throw _abstract(); } abstract getAttribute(element, attribute: string): string;
hasAttribute(element, attribute: string): boolean { throw _abstract(); } abstract setAttribute(element, name: string, value: string);
getAttribute(element, attribute: string): string { throw _abstract(); } abstract removeAttribute(element, attribute: string);
setAttribute(element, name: string, value: string) { throw _abstract(); } abstract templateAwareRoot(el);
removeAttribute(element, attribute: string) { throw _abstract(); } abstract createHtmlDocument(): HTMLDocument;
templateAwareRoot(el) { throw _abstract(); } abstract defaultDoc(): HTMLDocument;
createHtmlDocument(): HTMLDocument { throw _abstract(); } abstract getBoundingClientRect(el);
defaultDoc(): HTMLDocument { throw _abstract(); } abstract getTitle(): string;
getBoundingClientRect(el) { throw _abstract(); } abstract setTitle(newTitle: string);
getTitle(): string { throw _abstract(); } abstract elementMatches(n, selector: string): boolean;
setTitle(newTitle: string) { throw _abstract(); } abstract isTemplateElement(el: any): boolean;
elementMatches(n, selector: string): boolean { throw _abstract(); } abstract isTextNode(node): boolean;
isTemplateElement(el: any): boolean { throw _abstract(); } abstract isCommentNode(node): boolean;
isTextNode(node): boolean { throw _abstract(); } abstract isElementNode(node): boolean;
isCommentNode(node): boolean { throw _abstract(); } abstract hasShadowRoot(node): boolean;
isElementNode(node): boolean { throw _abstract(); } abstract isShadowRoot(node): boolean;
hasShadowRoot(node): boolean { throw _abstract(); } abstract importIntoDoc /*<T extends Node>*/ (node: Node /*T*/): Node /*T*/;
isShadowRoot(node): boolean { throw _abstract(); } abstract adoptNode /*<T extends Node>*/ (node: Node /*T*/): Node /*T*/;
importIntoDoc /*<T extends Node>*/ (node: Node /*T*/): Node /*T*/ { throw _abstract(); } abstract isPageRule(rule): boolean;
adoptNode /*<T extends Node>*/ (node: Node /*T*/): Node /*T*/ { throw _abstract(); } abstract isStyleRule(rule): boolean;
isPageRule(rule): boolean { throw _abstract(); } abstract isMediaRule(rule): boolean;
isStyleRule(rule): boolean { throw _abstract(); } abstract isKeyframesRule(rule): boolean;
isMediaRule(rule): boolean { throw _abstract(); } abstract getHref(element): string;
isKeyframesRule(rule): boolean { throw _abstract(); } abstract getEventKey(event): string;
getHref(element): string { throw _abstract(); } abstract resolveAndSetHref(element, baseUrl: string, href: string);
getEventKey(event): string { throw _abstract(); } abstract cssToRules(css: string): any[];
resolveAndSetHref(element, baseUrl: string, href: string) { throw _abstract(); } abstract supportsDOMEvents(): boolean;
cssToRules(css: string): any[] { throw _abstract(); } abstract supportsNativeShadowDOM(): boolean;
supportsDOMEvents(): boolean { throw _abstract(); } abstract getGlobalEventTarget(target: string): any;
supportsNativeShadowDOM(): boolean { throw _abstract(); } abstract getHistory(): History;
getGlobalEventTarget(target: string): any { throw _abstract(); } abstract getLocation(): Location;
getHistory(): History { throw _abstract(); } abstract getBaseHref(): string;
getLocation(): Location { throw _abstract(); } abstract resetBaseElement(): void;
getBaseHref(): string { throw _abstract(); } abstract getUserAgent(): string;
resetBaseElement(): void { throw _abstract(); } abstract setData(element, name: string, value: string);
getUserAgent(): string { throw _abstract(); } abstract getComputedStyle(element): any;
setData(element, name: string, value: string) { throw _abstract(); } abstract getData(element, name: string): string;
getComputedStyle(element): any { throw _abstract(); } abstract setGlobalVar(name: string, value: any);
getData(element, name: string): string { throw _abstract(); } abstract requestAnimationFrame(callback): number;
setGlobalVar(name: string, value: any) { throw _abstract(); } abstract cancelAnimationFrame(id);
requestAnimationFrame(callback): number { throw _abstract(); } abstract performanceNow(): number;
cancelAnimationFrame(id) { throw _abstract(); } abstract getAnimationPrefix(): string;
performanceNow(): number { throw _abstract(); } abstract getTransitionEnd(): string;
getAnimationPrefix(): string { throw _abstract(); } abstract supportsAnimation(): boolean;
getTransitionEnd(): string { throw _abstract(); }
supportsAnimation(): boolean { throw _abstract(); }
} }

View File

@ -5,7 +5,7 @@ import {DomAdapter} from './dom_adapter';
/** /**
* Provides DOM operations in any browser environment. * Provides DOM operations in any browser environment.
*/ */
export class GenericBrowserDomAdapter extends DomAdapter { export abstract class GenericBrowserDomAdapter extends DomAdapter {
private _animationPrefix: string = null; private _animationPrefix: string = null;
private _transitionEnd: string = null; private _transitionEnd: string = null;
constructor() { constructor() {

View File

@ -46,6 +46,10 @@ class Html5LibDomAdapter implements DomAdapter {
'tabindex': 'tabIndex', 'tabindex': 'tabIndex',
}; };
set attrToPropMap(value) {
throw 'readonly';
}
@override @override
getGlobalEventTarget(String target) { getGlobalEventTarget(String target) {
throw 'not implemented'; throw 'not implemented';

View File

@ -562,6 +562,11 @@ export class Parse5DomAdapter extends DomAdapter {
getAnimationPrefix(): string { return ''; } getAnimationPrefix(): string { return ''; }
getTransitionEnd(): string { return 'transitionend'; } getTransitionEnd(): string { return 'transitionend'; }
supportsAnimation(): boolean { return true; } supportsAnimation(): boolean { return true; }
replaceChild(el, newNode, oldNode) { throw new Error('not implemented'); }
parse(templateHtml: string) { throw new Error('not implemented'); }
invoke(el: Element, methodName: string, args: any[]): any { throw new Error('not implemented'); }
getEventKey(event): string { throw new Error('not implemented'); }
} }
// TODO: build a proper list, this one is all the keys of a HTMLInputElement // TODO: build a proper list, this one is all the keys of a HTMLInputElement

View File

@ -17,10 +17,6 @@ class CONST {
const CONST(); const CONST();
} }
class ABSTRACT {
const ABSTRACT();
}
bool isPresent(obj) => obj != null; bool isPresent(obj) => obj != null;
bool isBlank(obj) => obj == null; bool isBlank(obj) => obj == null;
bool isString(obj) => obj is String; bool isString(obj) => obj is String;

View File

@ -62,10 +62,6 @@ export function CONST(): ClassDecorator {
return (target) => target; return (target) => target;
} }
export function ABSTRACT(): ClassDecorator {
return (t) => t;
}
export function isPresent(obj: any): boolean { export function isPresent(obj: any): boolean {
return obj !== undefined && obj !== null; return obj !== undefined && obj !== null;
} }

View File

@ -2,10 +2,13 @@ import {ControlValueAccessor} from './control_value_accessor';
import {AbstractControlDirective} from './abstract_control_directive'; import {AbstractControlDirective} from './abstract_control_directive';
/** /**
* An abstract class that all control directive extend. * A base class that all control directive extend.
*
* It binds a {@link Control} object to a DOM element. * It binds a {@link Control} object to a DOM element.
*/ */
// Cannot currently be abstract because it would contain
// an abstract method in the public API, and we cannot reflect
// on that in Dart due to https://github.com/dart-lang/sdk/issues/18721
// Also we don't have abstract setters, see https://github.com/Microsoft/TypeScript/issues/4669
export class NgControl extends AbstractControlDirective { export class NgControl extends AbstractControlDirective {
name: string = null; name: string = null;
valueAccessor: ControlValueAccessor = null; valueAccessor: ControlValueAccessor = null;

View File

@ -1,4 +1,4 @@
import {ABSTRACT, CONST, Type} from 'angular2/src/core/facade/lang'; import {CONST, Type} from 'angular2/src/core/facade/lang';
import {ViewEncapsulation} from 'angular2/src/core/render/api'; import {ViewEncapsulation} from 'angular2/src/core/render/api';
export {ViewEncapsulation} from 'angular2/src/core/render/api'; export {ViewEncapsulation} from 'angular2/src/core/render/api';

View File

@ -1,4 +1,4 @@
import {ABSTRACT, CONST, Type} from 'angular2/src/core/facade/lang'; import {CONST, Type} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
export class InvalidPipeArgumentException extends BaseException { export class InvalidPipeArgumentException extends BaseException {

View File

@ -11,15 +11,15 @@ import {URLSearchParams} from './url_search_params';
* The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given * The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given
* {@link Request}. * {@link Request}.
*/ */
export class ConnectionBackend { export abstract class ConnectionBackend {
constructor() {} constructor() {}
createConnection(request: any): Connection { throw new BaseException('Abstract!'); } abstract createConnection(request: any): Connection;
} }
/** /**
* Abstract class from which real connections are derived. * Abstract class from which real connections are derived.
*/ */
export class Connection { export abstract class Connection {
readyState: ReadyStates; readyState: ReadyStates;
request: Request; request: Request;
response: EventEmitter; // TODO: generic of <Response>; response: EventEmitter; // TODO: generic of <Response>;

View File

@ -38,4 +38,6 @@ export class MockLocationStrategy extends LocationStrategy {
this.simulatePopState(nextUrl); this.simulatePopState(nextUrl);
} }
} }
forward(): void { throw 'not implemented'; }
} }

View File

@ -1,9 +1,3 @@
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
function _abstract() {
return new BaseException('This method is abstract');
}
/** /**
* `LocationStrategy` is responsible for representing and reading route state * `LocationStrategy` is responsible for representing and reading route state
* from the the browser's URL. Angular provides two strategies: * from the the browser's URL. Angular provides two strategies:
@ -20,11 +14,11 @@ function _abstract() {
* *
* See these two classes for more. * See these two classes for more.
*/ */
export class LocationStrategy { export abstract class LocationStrategy {
path(): string { throw _abstract(); } abstract path(): string;
pushState(ctx: any, title: string, url: string): void { throw _abstract(); } abstract pushState(ctx: any, title: string, url: string): void;
forward(): void { throw _abstract(); } abstract forward(): void;
back(): void { throw _abstract(); } abstract back(): void;
onPopState(fn: (_: any) => any): void { throw _abstract(); } abstract onPopState(fn: (_: any) => any): void;
getBaseHref(): string { throw _abstract(); } abstract getBaseHref(): string;
} }

View File

@ -1,19 +1,14 @@
import {EventEmitter} from 'angular2/src/core/facade/async'; import {EventEmitter} from 'angular2/src/core/facade/async';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {NgZone} from 'angular2/src/core/zone/ng_zone'; import {NgZone} from 'angular2/src/core/zone/ng_zone';
export {EventEmitter, Observable} from 'angular2/src/core/facade/async'; export {EventEmitter, Observable} from 'angular2/src/core/facade/async';
function _abstract() {
throw new BaseException("This method is abstract");
}
/** /**
* Message Bus is a low level API used to communicate between the UI and the background. * Message Bus is a low level API used to communicate between the UI and the background.
* Communication is based on a channel abstraction. Messages published in a * Communication is based on a channel abstraction. Messages published in a
* given channel to one MessageBusSink are received on the same channel * given channel to one MessageBusSink are received on the same channel
* by the corresponding MessageBusSource. * by the corresponding MessageBusSource.
*/ */
export /* abstract (with TS 1.6) */ class MessageBus implements MessageBusSource, MessageBusSink { export abstract class MessageBus implements MessageBusSource, MessageBusSink {
/** /**
* Sets up a new channel on the MessageBus. * Sets up a new channel on the MessageBus.
* MUST be called before calling from or to on the channel. * MUST be called before calling from or to on the channel.
@ -22,27 +17,27 @@ export /* abstract (with TS 1.6) */ class MessageBus implements MessageBusSource
* if runInZone is false then the source will emit events inside the global zone * if runInZone is false then the source will emit events inside the global zone
* and the sink will send messages immediately. * and the sink will send messages immediately.
*/ */
initChannel(channel: string, runInZone: boolean = true): void { throw _abstract(); } abstract initChannel(channel: string, runInZone?: boolean): void;
/** /**
* Assigns this bus to the given zone. * Assigns this bus to the given zone.
* Any callbacks attached to channels where runInZone was set to true on initialization * Any callbacks attached to channels where runInZone was set to true on initialization
* will be executed in the given zone. * will be executed in the given zone.
*/ */
attachToZone(zone: NgZone): void { throw _abstract(); } abstract attachToZone(zone: NgZone): void;
/** /**
* Returns an {@link EventEmitter} that emits every time a message * Returns an {@link EventEmitter} that emits every time a message
* is received on the given channel. * is received on the given channel.
*/ */
from(channel: string): EventEmitter { throw _abstract(); } abstract from(channel: string): EventEmitter;
/** /**
* Returns an {@link EventEmitter} for the given channel * Returns an {@link EventEmitter} for the given channel
* To publish methods to that channel just call next (or add in dart) on the returned emitter * To publish methods to that channel just call next (or add in dart) on the returned emitter
*/ */
to(channel: string): EventEmitter { throw _abstract(); } abstract to(channel: string): EventEmitter;
} }
export interface MessageBusSource { export interface MessageBusSource {

View File

@ -1,7 +1,7 @@
import {StringWrapper, RegExpWrapper, isJsObject} from 'angular2/src/core/facade/lang'; import {StringWrapper, RegExpWrapper, isJsObject} from 'angular2/src/core/facade/lang';
var IS_FIELD = RegExpWrapper.create('^\\w+[\\.|\\#]\\w+=?$'); var IS_FIELD = RegExpWrapper.create('^\\w+[\\.|\\#]\\w+=?$');
var IS_INTERFACE = RegExpWrapper.create('^\\{\\w+\\}'); var IS_INTERFACE = RegExpWrapper.create('^\\{.+\\}');
var IS_DART = RegExpWrapper.create('\\:dart$'); var IS_DART = RegExpWrapper.create('\\:dart$');
var IS_JS = RegExpWrapper.create('\\:js$'); var IS_JS = RegExpWrapper.create('\\:js$');
var IS_OPTIONAL = RegExpWrapper.create('\\:optional$'); var IS_OPTIONAL = RegExpWrapper.create('\\:optional$');

View File

@ -1,14 +1,12 @@
import {bind, Binding} from 'angular2/src/core/di'; import {bind, Binding} from 'angular2/src/core/di';
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
import {ABSTRACT} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {StringMap} from 'angular2/src/core/facade/collection'; import {StringMap} from 'angular2/src/core/facade/collection';
/** /**
* A metric is measures values * A metric is measures values
*/ */
@ABSTRACT() export abstract class Metric {
export class Metric {
static bindTo(delegateToken): Binding[] { static bindTo(delegateToken): Binding[] {
return [bind(Metric).toFactory((delegate) => delegate, [delegateToken])]; return [bind(Metric).toFactory((delegate) => delegate, [delegateToken])];
} }

View File

@ -1,14 +1,12 @@
import {bind, Binding} from 'angular2/src/core/di'; import {bind, Binding} from 'angular2/src/core/di';
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
import {ABSTRACT} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {MeasureValues} from './measure_values'; import {MeasureValues} from './measure_values';
/** /**
* A reporter reports measure values and the valid sample. * A reporter reports measure values and the valid sample.
*/ */
@ABSTRACT() export abstract class Reporter {
export class Reporter {
static bindTo(delegateToken): Binding[] { static bindTo(delegateToken): Binding[] {
return [bind(Reporter).toFactory((delegate) => delegate, [delegateToken])]; return [bind(Reporter).toFactory((delegate) => delegate, [delegateToken])];
} }

View File

@ -1,6 +1,5 @@
import {bind, Binding} from 'angular2/src/core/di'; import {bind, Binding} from 'angular2/src/core/di';
import {StringMap} from 'angular2/src/core/facade/collection'; import {StringMap} from 'angular2/src/core/facade/collection';
import {ABSTRACT} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {MeasureValues} from './measure_values'; import {MeasureValues} from './measure_values';
@ -10,8 +9,7 @@ import {MeasureValues} from './measure_values';
* A valid sample is a sample that represents the population that should be observed * A valid sample is a sample that represents the population that should be observed
* in the correct way. * in the correct way.
*/ */
@ABSTRACT() export abstract class Validator {
export class Validator {
static bindTo(delegateToken): Binding[] { static bindTo(delegateToken): Binding[] {
return [bind(Validator).toFactory((delegate) => delegate, [delegateToken])]; return [bind(Validator).toFactory((delegate) => delegate, [delegateToken])];
} }

View File

@ -1,6 +1,5 @@
import {bind, Binding} from 'angular2/src/core/di'; import {bind, Binding} from 'angular2/src/core/di';
import {Promise} from 'angular2/src/core/facade/async'; import {Promise} from 'angular2/src/core/facade/async';
import {ABSTRACT} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {Map} from 'angular2/src/core/facade/collection'; import {Map} from 'angular2/src/core/facade/collection';
@ -9,8 +8,7 @@ import {Map} from 'angular2/src/core/facade/collection';
* e.g. JS vs Dart Async vs Dart Sync webdriver. * e.g. JS vs Dart Async vs Dart Sync webdriver.
* Needs one implementation for every supported WebDriver client. * Needs one implementation for every supported WebDriver client.
*/ */
@ABSTRACT() export abstract class WebDriverAdapter {
export class WebDriverAdapter {
static bindTo(delegateToken): Binding[] { static bindTo(delegateToken): Binding[] {
return [bind(WebDriverAdapter).toFactory((delegate) => delegate, [delegateToken])]; return [bind(WebDriverAdapter).toFactory((delegate) => delegate, [delegateToken])];
} }

View File

@ -1,6 +1,6 @@
import {bind, Binding, Injector, OpaqueToken} from 'angular2/src/core/di'; import {bind, Binding, Injector, OpaqueToken} from 'angular2/src/core/di';
import {ABSTRACT, isBlank, isPresent} from 'angular2/src/core/facade/lang'; import {isBlank, isPresent} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
@ -12,8 +12,7 @@ import {Options} from './common_options';
* for a given browser, independent of the WebDriverAdapter. * for a given browser, independent of the WebDriverAdapter.
* Needs one implementation for every supported Browser. * Needs one implementation for every supported Browser.
*/ */
@ABSTRACT() export abstract class WebDriverExtension {
export class WebDriverExtension {
static bindTo(childTokens): Binding[] { static bindTo(childTokens): Binding[] {
var res = [ var res = [
bind(_CHILDREN) bind(_CHILDREN)

View File

@ -10026,7 +10026,7 @@
} }
}, },
"ts2dart": { "ts2dart": {
"version": "0.7.7", "version": "0.7.9",
"dependencies": { "dependencies": {
"source-map": { "source-map": {
"version": "0.4.4", "version": "0.4.4",

6
npm-shrinkwrap.json generated
View File

@ -15496,9 +15496,9 @@
} }
}, },
"ts2dart": { "ts2dart": {
"version": "0.7.7", "version": "0.7.9",
"from": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.7.tgz", "from": "ts2dart@0.7.9",
"resolved": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.7.tgz", "resolved": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.9.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.7", "ts2dart": "^0.7.9",
"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",