feat: typescript 2.9 support (#24652)

PR Close #24652
This commit is contained in:
Igor Minar 2018-06-25 11:11:22 +02:00 committed by Miško Hevery
parent 0c3738a780
commit e3064d5432
38 changed files with 293 additions and 204 deletions

View File

@ -20,9 +20,9 @@ http_archive(
http_archive(
name = "build_bazel_rules_typescript",
url = "https://github.com/bazelbuild/rules_typescript/archive/7c49a0943e7ccca73bee0b8fc5f01ca2c3dcfe8b.zip",
strip_prefix = "rules_typescript-7c49a0943e7ccca73bee0b8fc5f01ca2c3dcfe8b",
sha256 = "9707cdafc0e59f06cf5336b1c68d8f3d04fae9f3471c0eb205a669b8b5fafc81",
url = "https://github.com/rkirov/rules_typescript/archive/v0.16.0.zip",
strip_prefix = "rules_typescript-0.16.0",
sha256 = "f5aedd3a792e5af19cd0c0f0318cb692e2989e816e896e794152d07808fccacd",
)
http_archive(

View File

@ -0,0 +1,49 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as compiler from '@angular/compiler';
import * as compilerTesting from '@angular/compiler/testing';
import * as core from '@angular/core';
import * as coreTesting from '@angular/core/testing';
import * as elements from '@angular/elements';
import * as forms from '@angular/forms';
import * as http from '@angular/http';
import * as httpTesting from '@angular/http/testing';
import * as platformBrowser from '@angular/platform-browser';
import * as platformBrowserTesting from '@angular/platform-browser/testing';
import * as platformBrowserDynamic from '@angular/platform-browser-dynamic';
import * as platformServer from '@angular/platform-server';
import * as platformServerTesting from '@angular/platform-server/testing';
import * as platformWebworker from '@angular/platform-webworker';
import * as platformWebworkerDynamic from '@angular/platform-webworker-dynamic';
import * as router from '@angular/router';
import * as routerTesting from '@angular/router/testing';
import * as serviceWorker from '@angular/service-worker';
import * as upgrade from '@angular/upgrade';
export default {
compiler,
compilerTesting,
core,
coreTesting,
elements,
forms,
http,
httpTesting,
platformBrowser,
platformBrowserTesting,
platformBrowserDynamic,
platformServer,
platformServerTesting,
platformWebworker,
platformWebworkerDynamic,
router,
routerTesting,
serviceWorker,
upgrade,
};

View File

@ -0,0 +1,31 @@
{
"name": "angular-integration",
"description": "Assert that users with TypeScript 2.8 can type-check an Angular application",
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@angular/animations": "file:../../dist/packages-dist/animations",
"@angular/common": "file:../../dist/packages-dist/common",
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@angular/core": "file:../../dist/packages-dist/core",
"@angular/elements": "file:../../dist/packages-dist/elements",
"@angular/forms": "file:../../dist/packages-dist/forms",
"@angular/http": "file:../../dist/packages-dist/http",
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
"@angular/platform-webworker": "file:../../dist/packages-dist/platform-webworker",
"@angular/platform-webworker-dynamic": "file:../../dist/packages-dist/platform-webworker-dynamic",
"@angular/router": "file:../../dist/packages-dist/router",
"@angular/service-worker": "file:../../dist/packages-dist/service-worker",
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
"@types/jasmine": "2.5.41",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "2.8.x",
"zone.js": "file:../../node_modules/zone.js"
},
"scripts": {
"test": "tsc"
}
}

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../../dist/typings_test_ts28/",
"rootDir": ".",
"target": "es5",
"lib": [
"es5",
"dom",
"es2015.collection",
"es2015.iterable",
"es2015.promise"
],
"types": [],
"strictNullChecks": true
},
"files": [
"include-all.ts",
"node_modules/@types/jasmine/index.d.ts"
]
}

View File

@ -7,10 +7,8 @@
*/
import {NgIf} from '@angular/common';
import {ComponentFactory, ComponentFactoryResolver, ComponentRef, ErrorHandler, Injector, NgModuleRef, RendererFactory2, RootRenderer, Sanitizer, TemplateRef, ViewContainerRef} from '@angular/core';
import {ArgumentType, BindingFlags, NodeFlags, ViewDefinition, ViewFlags, anchorDef, createComponentFactory, directiveDef, elementDef, initServicesIfNeeded, textDef, viewDef} from '@angular/core/src/view/index';
import {DomRendererFactory2} from '@angular/platform-browser/src/dom/dom_renderer';
import {DomSanitizerImpl, SafeStyle} from '@angular/platform-browser/src/security/dom_sanitization_service';
import {ComponentFactory, ComponentFactoryResolver, ComponentRef, ErrorHandler, Injector, NgModuleRef, RendererFactory2, RootRenderer, Sanitizer, TemplateRef, ViewContainerRef, ɵArgumentType as ArgumentType, ɵBindingFlags as BindingFlags, ɵNodeFlags as NodeFlags, ɵViewDefinition as ViewDefinition, ɵViewFlags as ViewFlags, ɵand as anchorDef, ɵccf as createComponentFactory, ɵdid as directiveDef, ɵeld as elementDef, ɵinitServicesIfNeeded as initServicesIfNeeded, ɵted as textDef, ɵvid as viewDef} from '@angular/core';
import {SafeStyle, ɵDomRendererFactory2 as DomRendererFactory2, ɵDomSanitizerImpl as DomSanitizerImpl} from '@angular/platform-browser';
import {TreeNode, emptyTree} from '../util';

View File

@ -7,7 +7,6 @@
*/
import {ɵC as C, ɵE as E, ɵRenderFlags as RenderFlags, ɵT as T, ɵV as V, ɵb as b, ɵcR as cR, ɵcr as cr, ɵdefineComponent as defineComponent, ɵdetectChanges as _detectChanges, ɵe as e, ɵi1 as i1, ɵp as p, ɵsn as sn, ɵt as t, ɵv as v} from '@angular/core';
import {ComponentDefInternal} from '@angular/core/src/render3/interfaces/definition';
import {TreeNode, buildTree, emptyTree} from '../util';
@ -35,7 +34,7 @@ export class TreeComponent {
data: TreeNode = emptyTree;
/** @nocollapse */
static ngComponentDef: ComponentDefInternal<TreeComponent> = defineComponent({
static ngComponentDef = defineComponent({
type: TreeComponent,
selectors: [['tree']],
template: function(rf: RenderFlags, ctx: TreeComponent) {
@ -95,7 +94,7 @@ export class TreeFunction {
data: TreeNode = emptyTree;
/** @nocollapse */
static ngComponentDef: ComponentDefInternal<TreeFunction> = defineComponent({
static ngComponentDef = defineComponent({
type: TreeFunction,
selectors: [['tree']],
template: function(rf: RenderFlags, ctx: TreeFunction) {

View File

@ -110,11 +110,11 @@
"source-map": "0.5.7",
"source-map-support": "0.4.18",
"systemjs": "0.18.10",
"tsickle": "^0.29.0",
"tsickle": "0.32",
"tslint": "5.7.0",
"tslint-eslint-rules": "4.1.1",
"tsutils": "2.20.0",
"typescript": "2.8.x",
"typescript": "2.9.x",
"uglify-es": "^3.3.9",
"universal-analytics": "0.4.15",
"vlq": "0.2.2",

View File

@ -13,7 +13,7 @@
},
"peerDependencies": {
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
"typescript": ">=2.7.2 <2.9"
"typescript": ">=2.7.2 <2.10"
},
"repository": {
"type": "git",

View File

@ -152,7 +152,7 @@ function main(args: string[]): number {
allsrcs.filter(hasFileExtension('.d.ts')).forEach((f: string) => {
const content = fs.readFileSync(f, 'utf-8')
// Strip the named AMD module for compatibility with non-bazel users
.replace(/^\/\/\/ <amd-module name=.*\/>\n/, '');
.replace(/^\/\/\/ <amd-module name=.*\/>\n/gm, '');
writeFileFromInputPath(f, content);
});

View File

@ -22,6 +22,10 @@ npm_package(
# We don't actually import anything in the locale code so we can
# null out the require reference passed into the module.
"factory\(require, exports\)": "factory(null, exports)",
# Workaround for `.d.ts`` containing `/// <amd-module .../>`
# which are generated in TypeScript v2.9, but not before.
"/// <amd-module name=.*/>": "",
},
deps = [":locales"],
)

View File

@ -11,11 +11,11 @@
"dependencies": {
"reflect-metadata": "^0.1.2",
"minimist": "^1.2.0",
"tsickle": "^0.29.0",
"tsickle": "^0.30.0",
"chokidar": "^1.4.2"
},
"peerDependencies": {
"typescript": ">=2.7.2 <2.9",
"typescript": ">=2.7.2 <2.10",
"@angular/compiler": "0.0.0-PLACEHOLDER"
},
"engines" : {

View File

@ -109,7 +109,7 @@ const MIN_TS_VERSION = '2.7.2';
* supported typescript version v, v < MAX_TS_VERSION
* MAX_TS_VERSION is not considered as a supported TypeScript version
*/
const MAX_TS_VERSION = '2.9.0';
const MAX_TS_VERSION = '2.10.0';
class AngularCompilerProgram implements Program {
private rootNames: string[];

View File

@ -974,7 +974,7 @@ describe('Collector', () => {
});
});
describe('regerssion', () => {
describe('regression', () => {
it('should be able to collect a short-hand property value', () => {
const metadata = collectSource(`
const children = { f1: 1 };
@ -1040,37 +1040,6 @@ describe('Collector', () => {
.not.toBeUndefined('typeGuard was not collected');
});
it('should be able to collect an invalid access expression', () => {
const source = createSource(`
import {Component} from '@angular/core';
const value = [];
@Component({
provider: [{provide: 'some token', useValue: value[]}]
})
export class MyComponent {}
`);
const metadata = collector.getMetadata(source) !;
expect(metadata.metadata.MyComponent).toEqual({
__symbolic: 'class',
decorators: [{
__symbolic: 'call',
expression: {
__symbolic: 'reference',
module: '@angular/core',
name: 'Component',
line: 4,
character: 9
},
arguments: [{
__symbolic: 'error',
message: 'Expression form not supported',
line: 5,
character: 55
}]
}]
});
});
});
describe('references', () => {

View File

@ -28,5 +28,5 @@ export {_sanitizeUrl as ɵ_sanitizeUrl} from './sanitization/url_sanitizer';
export {global as ɵglobal, looseIdentical as ɵlooseIdentical, stringify as ɵstringify} from './util';
export {makeDecorator as ɵmakeDecorator} from './util/decorators';
export {isObservable as ɵisObservable, isPromise as ɵisPromise} from './util/lang';
export {clearOverrides as ɵclearOverrides, overrideComponentView as ɵoverrideComponentView, overrideProvider as ɵoverrideProvider} from './view/index';
export {clearOverrides as ɵclearOverrides, initServicesIfNeeded as ɵinitServicesIfNeeded, overrideComponentView as ɵoverrideComponentView, overrideProvider as ɵoverrideProvider} from './view/index';
export {NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from './view/provider';

View File

@ -209,7 +209,7 @@ export function defineComponent<T>(componentDefinition: {
const type = componentDefinition.type;
const pipeTypes = componentDefinition.pipes !;
const directiveTypes = componentDefinition.directives !;
const declaredInputs: {[P in keyof T]: P} = {} as any;
const declaredInputs: {[key: string]: string} = {} as any;
const def: ComponentDefInternal<any> = {
type: type,
diPublic: null,

View File

@ -1525,7 +1525,7 @@ export function baseDirectiveCreate<T>(
* @param tNode The static data for this node
*/
function setInputsFromAttrs<T>(
directiveIndex: number, instance: T, inputs: {[key: string]: string}, tNode: TNode): void {
directiveIndex: number, instance: T, inputs: {[P in keyof T]: string;}, tNode: TNode): void {
let initialInputData = tNode.initialInputs as InitialInputData | undefined;
if (initialInputData === undefined || directiveIndex >= initialInputData.length) {
initialInputData = generateInitialInputs(directiveIndex, inputs, tNode);

View File

@ -84,7 +84,7 @@ export interface DirectiveDef<T, Selector extends string> {
type: Type<T>;
/** Function that makes a directive public to the DI system. */
diPublic: ((def: DirectiveDef<any, string>) => void)|null;
diPublic: ((def: DirectiveDef<T, string>) => void)|null;
/** The selectors that will be used to match nodes to this directive. */
selectors: CssSelectorList;
@ -94,7 +94,7 @@ export interface DirectiveDef<T, Selector extends string> {
* are their aliases if any, or their original unminified property names
* (as in `@Input('alias') propertyName: any;`).
*/
readonly inputs: {[P in keyof T]: P};
readonly inputs: {[P in keyof T]: string};
/**
* @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of

View File

@ -6,10 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
// Import zero symbols from zone.js. This causes the zone ambient type to be
// added to the type-checker, without emitting any runtime module load statement
import {} from 'zone.js';
// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492
declare var WorkerGlobalScope: any /** TODO #9100 */;
// CommonJS / Node have global context exposed as "global" variable.

View File

@ -6,9 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
// Import zero symbols from zone.js. This causes the zone ambient type to be
// added to the type-checker, without emitting any runtime module load statement
import {} from 'zone.js';
import {EventEmitter} from '../event_emitter';
/**

View File

@ -63,6 +63,14 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
tryCall(fileName, () => <T>(m.call(ls, fileName, p1, p2, p3, p4)));
}
function tryFilenameFiveCall<T, P1, P2, P3, P4, P5>(
m: (fileName: string, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) =>
T): (fileName: string, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => T {
return (fileName, p1, p2, p3, p4, p5) =>
tryCall(fileName, () => <T>(m.call(ls, fileName, p1, p2, p3, p4, p5)));
}
function typescriptOnly(ls: ts.LanguageService): ts.LanguageService {
const languageService: ts.LanguageService = {
cleanupSemanticCache: () => ls.cleanupSemanticCache(),
@ -74,7 +82,7 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
getEncodedSyntacticClassifications: tryFilenameOneCall(ls.getEncodedSyntacticClassifications),
getEncodedSemanticClassifications: tryFilenameOneCall(ls.getEncodedSemanticClassifications),
getCompletionsAtPosition: tryFilenameTwoCall(ls.getCompletionsAtPosition),
getCompletionEntryDetails: tryFilenameFourCall(ls.getCompletionEntryDetails),
getCompletionEntryDetails: tryFilenameFiveCall(ls.getCompletionEntryDetails),
getCompletionEntrySymbol: tryFilenameThreeCall(ls.getCompletionEntrySymbol),
getQuickInfoAtPosition: tryFilenameOneCall(ls.getQuickInfoAtPosition),
getNameOrDottedNameSpan: tryFilenameTwoCall(ls.getNameOrDottedNameSpan),
@ -106,22 +114,28 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
getDocCommentTemplateAtPosition: tryFilenameOneCall(ls.getDocCommentTemplateAtPosition),
isValidBraceCompletionAtPosition: tryFilenameTwoCall(ls.isValidBraceCompletionAtPosition),
getSpanOfEnclosingComment: tryFilenameTwoCall(ls.getSpanOfEnclosingComment),
getCodeFixesAtPosition: tryFilenameFourCall(ls.getCodeFixesAtPosition),
getCodeFixesAtPosition: tryFilenameFiveCall(ls.getCodeFixesAtPosition),
applyCodeActionCommand:
<any>((action: any) => tryCall(undefined, () => ls.applyCodeActionCommand(action))),
getEmitOutput: tryFilenameCall(ls.getEmitOutput),
getProgram: () => ls.getProgram(),
dispose: () => ls.dispose(),
getApplicableRefactors: tryFilenameOneCall(ls.getApplicableRefactors),
getEditsForRefactor: tryFilenameFourCall(ls.getEditsForRefactor),
getApplicableRefactors: tryFilenameTwoCall(ls.getApplicableRefactors),
getEditsForRefactor: tryFilenameFiveCall(ls.getEditsForRefactor),
getDefinitionAndBoundSpan: tryFilenameOneCall(ls.getDefinitionAndBoundSpan),
getCombinedCodeFix:
(scope: ts.CombinedCodeFixScope, fixId: {}, formatOptions: ts.FormatCodeSettings) =>
tryCall(undefined, () => ls.getCombinedCodeFix(scope, fixId, formatOptions)),
(scope: ts.CombinedCodeFixScope, fixId: {}, formatOptions: ts.FormatCodeSettings,
preferences: ts.UserPreferences) =>
tryCall(
undefined, () => ls.getCombinedCodeFix(scope, fixId, formatOptions, preferences)),
// TODO(kyliau): dummy implementation to compile with ts 2.8, create real one
getSuggestionDiagnostics: (fileName: string) => [],
// TODO(kyliau): dummy implementation to compile with ts 2.8, create real one
organizeImports: (scope: ts.CombinedCodeFixScope, formatOptions: ts.FormatCodeSettings) => [],
// TODO: dummy implementation to compile with ts 2.9, create a real one
getEditsForFileRename:
(oldFilePath: string, newFilePath: string, formatOptions: ts.FormatCodeSettings,
preferences: ts.UserPreferences | undefined) => []
} as ts.LanguageService;
return languageService;
}

View File

@ -10,10 +10,6 @@ import {isPlatformServer} from '@angular/common';
import {Inject, Injectable, NgZone, Optional, PLATFORM_ID} from '@angular/core';
// Import zero symbols from zone.js. This causes the zone ambient type to be
// added to the type-checker, without emitting any runtime module load statement
import {} from 'zone.js';
import {DOCUMENT} from '../dom_tokens';
import {EventManagerPlugin} from './event_manager';

View File

@ -19,3 +19,4 @@ export {DomEventsPlugin as ɵDomEventsPlugin} from './dom/events/dom_events';
export {HammerGesturesPlugin as ɵHammerGesturesPlugin} from './dom/events/hammer_gestures';
export {KeyEventsPlugin as ɵKeyEventsPlugin} from './dom/events/key_events';
export {DomSharedStylesHost as ɵDomSharedStylesHost, SharedStylesHost as ɵSharedStylesHost} from './dom/shared_styles_host';
export {DomSanitizerImpl as ɵDomSanitizerImpl} from './security/dom_sanitization_service';

View File

@ -8,6 +8,7 @@
import {Attribute, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Injector, OnDestroy, OnInit, Output, ViewContainerRef} from '@angular/core';
import {Data} from '../config';
import {ChildrenOutletContexts} from '../router_outlet_context';
import {ActivatedRoute} from '../router_state';
import {PRIMARY_OUTLET} from '../shared';
@ -83,7 +84,7 @@ export class RouterOutlet implements OnDestroy, OnInit {
return this._activatedRoute as ActivatedRoute;
}
get activatedRouteData() {
get activatedRouteData(): Data {
if (this._activatedRoute) {
return this._activatedRoute.snapshot.data;
}

View File

@ -21,7 +21,7 @@ travisFoldEnd "test.unit.tools"
# Run unit tests in node
travisFoldStart "test.unit.node"
node ./dist/tools/tsc-watch/ node runCmdsOnly
node --harmony ./dist/tools/tsc-watch/ node runCmdsOnly
travisFoldEnd "test.unit.node"

View File

@ -27,5 +27,5 @@ else
echo "Creating packages .metadata.json files..."
node --max-old-space-size=3000 dist/tools/@angular/compiler-cli/src/main -p packages/tsconfig-metadata.json
fi
node dist/tools/tsc-watch/ $1 watch $2
node --harmony dist/tools/tsc-watch/ $1 watch $2
fi

View File

@ -60,6 +60,8 @@ var specFiles: any =
'@angular/examples/**',
'@angular/platform-browser/**',
'@angular/platform-browser-dynamic/**',
'@angular/compiler/test/aot/**',
'@angular/compiler/test/render3/**',
'@angular/core/test/bundling/**',
'@angular/core/test/zone/**',
'@angular/core/test/render3/**',

View File

@ -2,7 +2,7 @@ export declare function animate(timings: string | number, styles?: AnimationStyl
export declare function animateChild(options?: AnimateChildOptions | null): AnimationAnimateChildMetadata;
export interface AnimateChildOptions extends AnimationOptions {
export declare interface AnimateChildOptions extends AnimationOptions {
duration?: number | string;
}
@ -75,10 +75,10 @@ export declare const enum AnimationMetadataType {
AnimateChild = 9,
AnimateRef = 10,
Query = 11,
Stagger = 12,
Stagger = 12
}
export interface AnimationOptions {
export declare interface AnimationOptions {
delay?: number | string;
params?: {
[name: string]: any;
@ -102,7 +102,7 @@ export interface AnimationPlayer {
play(): void;
reset(): void;
restart(): void;
setPosition(p: any): void;
setPosition(p: any /** TODO #9100 */): void;
}
export interface AnimationQueryMetadata extends AnimationMetadata {
@ -111,7 +111,7 @@ export interface AnimationQueryMetadata extends AnimationMetadata {
selector: string;
}
export interface AnimationQueryOptions extends AnimationOptions {
export declare interface AnimationQueryOptions extends AnimationOptions {
limit?: number;
optional?: boolean;
}

View File

@ -3,8 +3,8 @@ export declare const APP_BASE_HREF: InjectionToken<string>;
export declare class AsyncPipe implements OnDestroy, PipeTransform {
constructor(_ref: ChangeDetectorRef);
ngOnDestroy(): void;
transform<T>(obj: Promise<T> | null | undefined): T | null;
transform<T>(obj: Observable<T> | null | undefined): T | null;
transform<T>(obj: Promise<T> | null | undefined): T | null;
transform<T>(obj: undefined): undefined;
transform<T>(obj: null): null;
}
@ -66,13 +66,13 @@ export declare enum FormatWidth {
Short = 0,
Medium = 1,
Long = 2,
Full = 3,
Full = 3
}
/** @experimental */
export declare enum FormStyle {
Format = 0,
Standalone = 1,
Standalone = 1
}
/** @experimental */
@ -291,10 +291,10 @@ export declare class NgIfContext {
/** @experimental */
export declare class NgLocaleLocalization extends NgLocalization {
/** @deprecated */ protected deprecatedPluralFn: ((locale: string, value: string | number) => Plural) | null | undefined;
/** @deprecated */ protected deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined;
protected locale: string;
constructor(locale: string,
/** @deprecated */ deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined);
/** @deprecated */ deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined);
getPluralCategory(value: any, locale?: string): string;
}
@ -350,7 +350,7 @@ export declare enum NumberFormatStyle {
Decimal = 0,
Percent = 1,
Currency = 2,
Scientific = 3,
Scientific = 3
}
/** @experimental */
@ -368,7 +368,7 @@ export declare enum NumberSymbol {
NaN = 10,
TimeSeparator = 11,
CurrencyDecimal = 12,
CurrencyGroup = 13,
CurrencyGroup = 13
}
export declare class PathLocationStrategy extends LocationStrategy {
@ -389,9 +389,9 @@ export declare class PercentPipe implements PipeTransform {
}
export declare abstract class PlatformLocation {
readonly abstract hash: string;
readonly abstract pathname: string;
readonly abstract search: string;
abstract readonly hash: string;
abstract readonly pathname: string;
abstract readonly search: string;
abstract back(): void;
abstract forward(): void;
abstract getBaseHrefFromDOM(): string;
@ -408,7 +408,7 @@ export declare enum Plural {
Two = 2,
Few = 3,
Many = 4,
Other = 5,
Other = 5
}
/** @experimental */
@ -441,7 +441,7 @@ export declare enum TranslationWidth {
Narrow = 0,
Abbreviated = 1,
Wide = 2,
Short = 3,
Short = 3
}
export declare class UpperCasePipe implements PipeTransform {
@ -467,5 +467,5 @@ export declare enum WeekDay {
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
Saturday = 6
}

View File

@ -1516,7 +1516,7 @@ export declare enum HttpEventType {
ResponseHeader = 2,
DownloadProgress = 3,
Response = 4,
User = 5,
User = 5
}
export declare abstract class HttpHandler {

View File

@ -59,7 +59,7 @@ export declare const Attribute: AttributeDecorator;
export declare enum ChangeDetectionStrategy {
OnPush = 0,
Default = 1,
Default = 1
}
export declare abstract class ChangeDetectorRef {
@ -114,17 +114,17 @@ export interface ComponentDecorator {
}
export declare abstract class ComponentFactory<C> {
readonly abstract componentType: Type<any>;
readonly abstract inputs: {
abstract readonly componentType: Type<any>;
abstract readonly inputs: {
propName: string;
templateName: string;
}[];
readonly abstract ngContentSelectors: string[];
readonly abstract outputs: {
abstract readonly ngContentSelectors: string[];
abstract readonly outputs: {
propName: string;
templateName: string;
}[];
readonly abstract selector: string;
abstract readonly selector: string;
abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, ngModule?: NgModuleRef<any>): ComponentRef<C>;
}
@ -134,12 +134,12 @@ export declare abstract class ComponentFactoryResolver {
}
export declare abstract class ComponentRef<C> {
readonly abstract changeDetectorRef: ChangeDetectorRef;
readonly abstract componentType: Type<any>;
readonly abstract hostView: ViewRef;
readonly abstract injector: Injector;
readonly abstract instance: C;
readonly abstract location: ElementRef;
abstract readonly changeDetectorRef: ChangeDetectorRef;
abstract readonly componentType: Type<any>;
abstract readonly hostView: ViewRef;
abstract readonly injector: Injector;
abstract readonly instance: C;
abstract readonly location: ElementRef;
abstract destroy(): void;
abstract onDestroy(callback: Function): void;
}
@ -280,8 +280,8 @@ export declare class ElementRef<T = any> {
/** @experimental */
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
readonly abstract context: C;
readonly abstract rootNodes: any[];
abstract readonly context: C;
abstract readonly rootNodes: any[];
}
export declare function enableProdMode(): void;
@ -378,7 +378,7 @@ export declare const enum InjectFlags {
Host = 1,
Self = 2,
SkipSelf = 4,
Optional = 8,
Optional = 8
}
export declare class InjectionToken<T> {
@ -494,7 +494,7 @@ export declare const LOCALE_ID: InjectionToken<string>;
export declare enum MissingTranslationStrategy {
Error = 0,
Warning = 1,
Ignore = 2,
Ignore = 2
}
/** @experimental */
@ -515,7 +515,7 @@ export declare const NgModule: NgModuleDecorator;
/** @experimental */
export declare abstract class NgModuleFactory<T> {
readonly abstract moduleType: Type<T>;
abstract readonly moduleType: Type<T>;
abstract create(parentInjector: Injector | null): NgModuleRef<T>;
}
@ -524,9 +524,9 @@ export declare abstract class NgModuleFactoryLoader {
}
export declare abstract class NgModuleRef<T> {
readonly abstract componentFactoryResolver: ComponentFactoryResolver;
readonly abstract injector: Injector;
readonly abstract instance: T;
abstract readonly componentFactoryResolver: ComponentFactoryResolver;
abstract readonly injector: Injector;
abstract readonly instance: T;
abstract destroy(): void;
abstract onDestroy(callback: () => void): void;
}
@ -547,7 +547,7 @@ export declare class NgZone {
readonly onMicrotaskEmpty: EventEmitter<any>;
readonly onStable: EventEmitter<any>;
readonly onUnstable: EventEmitter<any>;
constructor({enableLongStackTrace}: {
constructor({ enableLongStackTrace }: {
enableLongStackTrace?: boolean;
});
run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T;
@ -642,7 +642,7 @@ export declare class QueryList<T> {
/** @deprecated */
export declare abstract class ReflectiveInjector implements Injector {
readonly abstract parent: Injector | null;
abstract readonly parent: Injector | null;
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
abstract get(token: any, notFoundValue?: any): any;
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
@ -699,7 +699,7 @@ export declare abstract class Renderer {
/** @experimental */
export declare abstract class Renderer2 {
readonly abstract data: {
abstract readonly data: {
[key: string]: any;
};
destroyNode: ((node: any) => void) | null;
@ -735,7 +735,7 @@ export declare abstract class RendererFactory2 {
/** @experimental */
export declare enum RendererStyleFlags2 {
Important = 1,
DashCase = 2,
DashCase = 2
}
/** @experimental */
@ -753,8 +753,8 @@ export declare class ResolvedReflectiveFactory {
dependencies: ReflectiveDependency[];
factory: Function;
constructor(
factory: Function,
dependencies: ReflectiveDependency[]);
factory: Function,
dependencies: ReflectiveDependency[]);
}
/** @experimental */
@ -787,7 +787,7 @@ export declare enum SecurityContext {
STYLE = 2,
SCRIPT = 3,
URL = 4,
RESOURCE_URL = 5,
RESOURCE_URL = 5
}
export declare const Self: SelfDecorator;
@ -834,7 +834,7 @@ export declare abstract class SystemJsNgModuleLoaderConfig {
}
export declare abstract class TemplateRef<C> {
readonly abstract elementRef: ElementRef;
abstract readonly elementRef: ElementRef;
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
}
@ -919,10 +919,10 @@ export interface ViewChildrenDecorator {
}
export declare abstract class ViewContainerRef {
readonly abstract element: ElementRef;
readonly abstract injector: Injector;
readonly abstract length: number;
readonly abstract parentInjector: Injector;
abstract readonly element: ElementRef;
abstract readonly injector: Injector;
abstract readonly length: number;
abstract readonly parentInjector: Injector;
abstract clear(): void;
abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;
abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
@ -938,13 +938,13 @@ export declare enum ViewEncapsulation {
Emulated = 0,
Native = 1,
None = 2,
ShadowDom = 3,
ShadowDom = 3
}
export declare abstract class ViewRef extends ChangeDetectorRef {
readonly abstract destroyed: boolean;
abstract readonly destroyed: boolean;
abstract destroy(): void;
abstract onDestroy(callback: Function): any;
abstract onDestroy(callback: Function): any /** TODO #9100 */;
}
export declare class WrappedValue {

View File

@ -78,13 +78,13 @@ export declare class TestBed implements Injector {
}): void;
configureTestingModule(moduleDef: TestModuleMetadata): void;
createComponent<T>(component: Type<T>): ComponentFixture<T>;
deprecatedOverrideProvider(token: any, provider: {
useValue: any;
}): void;
/** @deprecated */ deprecatedOverrideProvider(token: any, provider: {
useFactory: Function;
deps: any[];
}): void;
deprecatedOverrideProvider(token: any, provider: {
useValue: any;
}): void;
execute(tokens: any[], fn: Function, context?: any): any;
get(token: any, notFoundValue?: any): any;
/** @experimental */ initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
@ -123,11 +123,11 @@ export declare class TestBed implements Injector {
static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): typeof TestBed;
static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): typeof TestBed;
static overrideProvider(token: any, provider: {
useFactory: Function;
deps: any[];
useValue: any;
}): typeof TestBed;
static overrideProvider(token: any, provider: {
useValue: any;
useFactory: Function;
deps: any[];
}): typeof TestBed;
static overrideTemplate(component: Type<any>, template: string): typeof TestBed;
static overrideTemplateUsingTestingModule(component: Type<any>, template: string): typeof TestBed;

View File

@ -64,7 +64,7 @@ export declare abstract class AbstractControl {
}
export declare abstract class AbstractControlDirective {
readonly abstract control: AbstractControl | null;
abstract readonly control: AbstractControl | null;
readonly dirty: boolean | null;
readonly disabled: boolean | null;
readonly enabled: boolean | null;

View File

@ -108,7 +108,7 @@ export declare enum ReadyState {
HeadersReceived = 2,
Loading = 3,
Done = 4,
Cancelled = 5,
Cancelled = 5
}
/** @deprecated */
@ -132,7 +132,7 @@ export declare enum RequestMethod {
Delete = 3,
Options = 4,
Head = 5,
Patch = 6,
Patch = 6
}
/** @deprecated */
@ -184,7 +184,7 @@ export declare enum ResponseContentType {
Text = 0,
Json = 1,
ArrayBuffer = 2,
Blob = 3,
Blob = 3
}
/** @deprecated */
@ -213,7 +213,7 @@ export declare enum ResponseType {
Cors = 1,
Default = 2,
Error = 3,
Opaque = 4,
Opaque = 4
}
/** @deprecated */
@ -249,7 +249,7 @@ export declare class XHRConnection implements Connection {
request: Request;
response: Observable<Response>;
constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions);
setDetectedContentType(req: any, _xhr: any): void;
setDetectedContentType(req: any /** TODO Request */, _xhr: any /** XMLHttpRequest */): void;
}
/** @deprecated */

View File

@ -58,7 +58,7 @@ export interface ReceivedMessage {
export declare const enum SerializerTypes {
RENDERER_TYPE_2 = 0,
PRIMITIVE = 1,
RENDER_STORE_OBJECT = 2,
RENDER_STORE_OBJECT = 2
}
/** @experimental */
@ -73,7 +73,7 @@ export declare class ServiceMessageBrokerFactory {
/** @experimental */
export declare class UiArguments {
args: FnArg[] | undefined;
args?: FnArg[] | undefined;
method: string;
constructor(method: string, args?: FnArg[] | undefined);
}

View File

@ -41,7 +41,7 @@ export declare class ActivatedRouteSnapshot {
export declare class ActivationEnd {
snapshot: ActivatedRouteSnapshot;
constructor(
snapshot: ActivatedRouteSnapshot);
snapshot: ActivatedRouteSnapshot);
toString(): string;
}
@ -49,7 +49,7 @@ export declare class ActivationEnd {
export declare class ActivationStart {
snapshot: ActivatedRouteSnapshot;
constructor(
snapshot: ActivatedRouteSnapshot);
snapshot: ActivatedRouteSnapshot);
toString(): string;
}
@ -73,7 +73,7 @@ export interface CanLoad {
export declare class ChildActivationEnd {
snapshot: ActivatedRouteSnapshot;
constructor(
snapshot: ActivatedRouteSnapshot);
snapshot: ActivatedRouteSnapshot);
toString(): string;
}
@ -81,7 +81,7 @@ export declare class ChildActivationEnd {
export declare class ChildActivationStart {
snapshot: ActivatedRouteSnapshot;
constructor(
snapshot: ActivatedRouteSnapshot);
snapshot: ActivatedRouteSnapshot);
toString(): string;
}
@ -129,11 +129,11 @@ export declare class GuardsCheckEnd extends RouterEvent {
state: RouterStateSnapshot;
urlAfterRedirects: string;
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot,
shouldActivate: boolean);
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot,
shouldActivate: boolean);
toString(): string;
}
@ -142,10 +142,10 @@ export declare class GuardsCheckStart extends RouterEvent {
state: RouterStateSnapshot;
urlAfterRedirects: string;
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
toString(): string;
}
@ -156,27 +156,27 @@ export declare type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any
export declare class NavigationCancel extends RouterEvent {
reason: string;
constructor(
id: number,
url: string,
reason: string);
id: number,
url: string,
reason: string);
toString(): string;
}
export declare class NavigationEnd extends RouterEvent {
urlAfterRedirects: string;
constructor(
id: number,
url: string,
urlAfterRedirects: string);
id: number,
url: string,
urlAfterRedirects: string);
toString(): string;
}
export declare class NavigationError extends RouterEvent {
error: any;
constructor(
id: number,
url: string,
error: any);
id: number,
url: string,
error: any);
toString(): string;
}
@ -197,10 +197,10 @@ export declare class NavigationStart extends RouterEvent {
navigationId: number;
} | null;
constructor(
id: number,
url: string,
navigationTrigger?: 'imperative' | 'popstate' | 'hashchange',
restoredState?: {
id: number,
url: string,
navigationTrigger?: 'imperative' | 'popstate' | 'hashchange',
restoredState?: {
navigationId: number;
} | null);
toString(): string;
@ -257,10 +257,10 @@ export declare class ResolveEnd extends RouterEvent {
state: RouterStateSnapshot;
urlAfterRedirects: string;
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
toString(): string;
}
@ -269,10 +269,10 @@ export declare class ResolveStart extends RouterEvent {
state: RouterStateSnapshot;
urlAfterRedirects: string;
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
toString(): string;
}
@ -298,7 +298,7 @@ export interface Route {
export declare class RouteConfigLoadEnd {
route: Route;
constructor(
route: Route);
route: Route);
toString(): string;
}
@ -306,7 +306,7 @@ export declare class RouteConfigLoadEnd {
export declare class RouteConfigLoadStart {
route: Route;
constructor(
route: Route);
route: Route);
toString(): string;
}
@ -354,8 +354,8 @@ export declare class RouterEvent {
id: number;
url: string;
constructor(
id: number,
url: string);
id: number,
url: string);
}
export declare class RouterLink {
@ -417,9 +417,7 @@ export declare class RouterModule {
export declare class RouterOutlet implements OnDestroy, OnInit {
activateEvents: EventEmitter<any>;
readonly activatedRoute: ActivatedRoute;
readonly activatedRouteData: {
[name: string]: any;
};
readonly activatedRouteData: Data;
readonly component: Object;
deactivateEvents: EventEmitter<any>;
readonly isActivated: boolean;
@ -458,10 +456,10 @@ export declare class RoutesRecognized extends RouterEvent {
state: RouterStateSnapshot;
urlAfterRedirects: string;
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
toString(): string;
}
@ -473,9 +471,9 @@ export declare class Scroll {
readonly position: [number, number] | null;
readonly routerEvent: NavigationEnd;
constructor(
routerEvent: NavigationEnd,
position: [number, number] | null,
anchor: string | null);
routerEvent: NavigationEnd,
position: [number, number] | null,
anchor: string | null);
toString(): string;
}
@ -504,8 +502,8 @@ export declare class UrlSegment {
};
path: string;
constructor(
path: string,
parameters: {
path: string,
parameters: {
[name: string]: string;
});
toString(): string;
@ -519,8 +517,8 @@ export declare class UrlSegmentGroup {
parent: UrlSegmentGroup | null;
segments: UrlSegment[];
constructor(
segments: UrlSegment[],
children: {
segments: UrlSegment[],
children: {
[key: string]: UrlSegmentGroup;
});
hasChildren(): boolean;

View File

@ -38,8 +38,8 @@ export declare class UpgradeModule {
injector: Injector;
ngZone: NgZone;
constructor(
injector: Injector,
ngZone: NgZone);
injector: Injector,
ngZone: NgZone);
bootstrap(element: Element, modules?: string[], config?: any): void;
}

View File

@ -32,8 +32,11 @@ const runMode: string = process.argv.length >= 4 ? process.argv[3] : null;
const debugMode = process.argv.some(arg => arg === '--debug');
const BaseConfig = {
start: 'File change detected. Starting incremental compilation...',
error: 'error',
complete: 'Compilation complete. Watching for file changes.'
// This regex uses a negative lookbehind group (?<! 0 ), which causes it to not match a string
// containing " 0 error" but to match anything else containing "error". It requires the --harmony
// flag to run under node versions < 9.
error: /(?<! 0 )error/,
complete: 'Found 0 errors. Watching for file changes.',
};
if (platform == 'node') {

View File

@ -3264,6 +3264,12 @@ jasmine-core@~2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e"
jasmine-diff@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/jasmine-diff/-/jasmine-diff-0.1.3.tgz#93ccc2dcc41028c5ddd4606558074839f2deeaa8"
dependencies:
diff "^3.2.0"
jasmine@2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.4.1.tgz#9016dda453213d27ac6d43dc4ea97315a189085e"
@ -5907,10 +5913,11 @@ trim-off-newlines@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3"
tsickle@^0.29.0:
version "0.29.0"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.29.0.tgz#812806554bb46c1aa16eb0fe2a051da95ca8f5a4"
tsickle@0.32:
version "0.32.0"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.0.tgz#8027eecf5872b4451ffae821a5fdbd0b3206c139"
dependencies:
jasmine-diff "^0.1.3"
minimist "^1.2.0"
mkdirp "^0.5.1"
source-map "^0.6.0"
@ -6010,9 +6017,9 @@ typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
typescript@2.8.x:
version "2.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170"
typescript@2.9.x:
version "2.9.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
typescript@~2.6.2:
version "2.6.2"