Produce .d.ts files from our typescript compilation.

Deliver them into our npm module output so users can consume them directly.

Fixes #3082
This commit is contained in:
Alex Eagle
2015-10-01 19:49:45 -07:00
committed by Alex Eagle
parent 393b0526b4
commit 95f984615b
30 changed files with 131 additions and 82 deletions

View File

@ -117,9 +117,6 @@ export function createNgZone(): NgZone {
var _platform: PlatformRef;
/**
* @internal
*/
export function platformCommon(bindings?: Array<Type | Binding | any[]>, initializer?: () => void):
PlatformRef {
if (isPresent(_platform)) {

View File

@ -2,9 +2,6 @@ import {isPresent} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
/**
* @internal
*/
export class Locals {
constructor(public parent: Locals, public current: Map<any, any>) {}

View File

@ -30,9 +30,6 @@ import {
} from './exceptions';
import {resolveForwardRef} from './forward_ref';
/**
* @internal
*/
export class Dependency {
constructor(public key: Key, public optional: boolean, public lowerBoundVisibility: any,
public upperBoundVisibility: any, public properties: any[]) {}
@ -280,7 +277,6 @@ export class ResolvedBinding_ implements ResolvedBinding {
}
/**
* @internal
* An internal resolved representation of a factory function created by resolving {@link Binding}.
*/
export class ResolvedFactory {

View File

@ -387,7 +387,6 @@ export class BindingWithVisibility {
}
/**
* @internal
* Used to provide dependencies that cannot be easily expressed as bindings.
*/
export interface DependencyProvider {

View File

@ -1,5 +1,4 @@
/**
* @internal
* Type literals is a Dart-only feature. This is here only so we can x-compile
* to multiple languages.
*/

View File

@ -2,3 +2,4 @@
// I need to be here to make TypeScript think this is a module.
import {} from 'angular2/src/core/facade/lang';
export var workaround_empty_observable_list_diff: any;

View File

@ -1,4 +1,3 @@
///<reference path="../../../typings/tsd.d.ts" />
import {global, isPresent} from 'angular2/src/core/facade/lang';
// TODO(jeffbcross): use ES6 import once typings are available
var Subject = require('@reactivex/rxjs/dist/cjs/Subject');
@ -56,14 +55,18 @@ export class PromiseWrapper {
}
}
export class TimerWrapper {
static setTimeout(fn: Function, millis: number): number { return global.setTimeout(fn, millis); }
static clearTimeout(id: number): void { global.clearTimeout(id); }
export namespace NodeJS {
export interface Timer {}
}
static setInterval(fn: Function, millis: number): number {
export class TimerWrapper {
static setTimeout(fn: (...args: any[]) => void, millis: number): NodeJS.Timer { return global.setTimeout(fn, millis); }
static clearTimeout(id: NodeJS.Timer): void { global.clearTimeout(id); }
static setInterval(fn: (...args: any[]) => void, millis: number): NodeJS.Timer {
return global.setInterval(fn, millis);
}
static clearInterval(id: number): void { global.clearInterval(id); }
static clearInterval(id: NodeJS.Timer): void { global.clearInterval(id); }
}
export class ObservableWrapper {

View File

@ -259,7 +259,7 @@ export class ListWrapper {
static toString<T>(l: T[]): string { return l.toString(); }
static toJSON<T>(l: T[]): string { return JSON.stringify(l); }
static maximum<T>(list: T[], predicate: (T) => number): T {
static maximum<T>(list: T[], predicate: (t: T) => number): T {
if (list.length == 0) {
return null;
}

View File

@ -1,5 +1,3 @@
/// <reference path="../../../manual_typings/globals.d.ts" />
import {ExceptionHandler} from './exception_handler';
export {ExceptionHandler} from './exception_handler';

View File

@ -1,5 +1,3 @@
/// <reference path="../../../manual_typings/globals.d.ts" />
// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492
declare var WorkerGlobalScope;
var globalScope: BrowserNodeGlobal;
@ -196,7 +194,7 @@ export class StringJoiner {
export class NumberParseError extends Error {
name: string;
constructor(public message: string) { super(message); }
constructor(public message: string) { super(); }
toString(): string { return this.message; }
}
@ -251,7 +249,7 @@ export class RegExpWrapper {
flags = flags.replace(/g/g, '');
return new _global.RegExp(regExpStr, flags + 'g');
}
static firstMatch(regExp: RegExp, input: string): string[] {
static firstMatch(regExp: RegExp, input: string): RegExpExecArray {
// Reset multimatch regex state
regExp.lastIndex = 0;
return regExp.exec(input);
@ -277,7 +275,7 @@ export class RegExpMatcherWrapper {
static next(matcher: {
re: RegExp;
input: string
}): string[] {
}): RegExpExecArray {
return matcher.re.exec(matcher.input);
}
}

View File

@ -1,9 +1,6 @@
import {MapWrapper} from 'angular2/src/core/facade/collection';
import {SimpleChange} from 'angular2/src/core/change_detection/change_detection_util';
/**
* @internal
*/
export enum LifecycleHooks {
OnInit,
OnDestroy,

View File

@ -13,13 +13,13 @@ interface Trace {
endTimeRange(range: Range);
}
interface Range {}
export interface Range {}
interface Events {
createScope(signature: string, flags: any): Scope;
}
interface Scope {
export interface Scope {
(...args): any;
}

View File

@ -9,7 +9,7 @@ import {
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper} from 'angular2/src/core/facade/collection';
import {GetterFn, SetterFn, MethodFn} from './types';
import {PlatformReflectionCapabilities} from 'platform_reflection_capabilities';
import {PlatformReflectionCapabilities} from './platform_reflection_capabilities';
export class ReflectionCapabilities implements PlatformReflectionCapabilities {
private _reflect: any;

View File

@ -1,5 +1,3 @@
/// <reference path="../../../../../typings/hammerjs/hammerjs.d.ts"/>
import {HammerGesturesPluginCommon} from './hammer_common';
import {isPresent} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';

View File

@ -90,7 +90,7 @@ export class KeyEventsPlugin extends EventManagerPlugin {
return fullKey;
}
static eventCallback(element: HTMLElement, fullKey: any, handler: (Event) => any, zone: NgZone):
static eventCallback(element: HTMLElement, fullKey: any, handler: (e: Event) => any, zone: NgZone):
(event: KeyboardEvent) => void {
return (event) => {
if (StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) {

View File

@ -236,7 +236,7 @@ if (!(Reflect && Reflect.getMetadata)) {
throw 'reflect-metadata shim is required when using class decorators';
}
export function makeDecorator(annotationCls, chainFn: (fn: Function) => void = null): (...args) =>
export function makeDecorator(annotationCls, chainFn: (fn: Function) => void = null): (...args: any[]) =>
(cls: any) => any {
function DecoratorFactory(objOrType): (cls: any) => any {
var annotationInstance = new (<any>annotationCls)(objOrType);