build: TypeScript 3.5 upgrade (#31615)

https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#typescript-35

PR Close #31615
This commit is contained in:
Igor Minar
2019-07-17 17:49:16 -07:00
committed by Miško Hevery
parent 3a2b195a58
commit 6ece7db37a
34 changed files with 196 additions and 65 deletions

View File

@ -16,7 +16,7 @@ import {of } from 'rxjs';
function asyncValidator(expected: string, timeouts = {}) {
return (c: AbstractControl) => {
let resolve: (result: any) => void = undefined !;
const promise = new Promise(res => { resolve = res; });
const promise = new Promise<ValidationErrors|null>(res => { resolve = res; });
const t = (timeouts as any)[c.value] != null ? (timeouts as any)[c.value] : 0;
const res = c.value != expected ? {'async': true} : null;

View File

@ -9,7 +9,7 @@
import {EventEmitter} from '@angular/core';
import {fakeAsync, tick} from '@angular/core/testing';
import {AsyncTestCompleter, beforeEach, describe, inject, it} from '@angular/core/testing/src/testing_internal';
import {AbstractControl, AsyncValidatorFn, FormControl, FormGroup, Validators} from '@angular/forms';
import {AbstractControl, AsyncValidatorFn, FormControl, FormGroup, ValidationErrors, Validators} from '@angular/forms';
import {FormArray} from '@angular/forms/src/model';
@ -17,7 +17,7 @@ import {FormArray} from '@angular/forms/src/model';
function asyncValidator(expected: string, timeouts = {}): AsyncValidatorFn {
return (c: AbstractControl) => {
let resolve: (result: any) => void = undefined !;
const promise = new Promise(res => { resolve = res; });
const promise = new Promise<ValidationErrors|null>(res => { resolve = res; });
const t = (timeouts as any)[c.value] != null ? (timeouts as any)[c.value] : 0;
const res = c.value != expected ? {'async': true} : null;

View File

@ -21,7 +21,7 @@ import {of } from 'rxjs';
function asyncValidator(expected: string, timeouts = {}) {
return (c: AbstractControl) => {
let resolve: (result: any) => void = undefined !;
const promise = new Promise(res => { resolve = res; });
const promise = new Promise<ValidationErrors|null>(res => { resolve = res; });
const t = (timeouts as any)[c.value] != null ? (timeouts as any)[c.value] : 0;
const res = c.value != expected ? {'async': true} : null;

View File

@ -2426,7 +2426,7 @@ import {MyInput, MyInputForm} from './value_accessor_integration_spec';
function uniqLoginAsyncValidator(expectedValue: string, timeout: number = 0) {
return (c: AbstractControl) => {
let resolve: (result: any) => void;
const promise = new Promise(res => { resolve = res; });
const promise = new Promise<any>(res => { resolve = res; });
const res = (c.value == expectedValue) ? null : {'uniqLogin': true};
setTimeout(() => resolve(res), timeout);
return promise;