diff --git a/package-lock.json b/package-lock.json index 684c3751ae..3cd84e87a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rxjs", - "version": "7.0.0-beta.3", + "version": "7.0.0-beta.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -8185,9 +8185,9 @@ } }, "typescript": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", - "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", + "version": "4.0.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.1-rc.tgz", + "integrity": "sha512-TCkspT3dSKOykbzS3/WSK7pqU2h1d/lEO6i45Afm5Y3XNAEAo8YXTG3kHOQk/wFq/5uPyO1+X8rb/Q+g7UsxJw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 4127ab9281..ec43086b75 100644 --- a/package.json +++ b/package.json @@ -148,7 +148,7 @@ "tslint-no-toplevel-property-access": "0.0.2", "tslint-no-unused-expression-chai": "0.0.3", "typedoc": "^0.17.8", - "typescript": "~3.9.2", + "typescript": "~4.0.1-rc", "validate-commit-msg": "2.14.0", "webpack": "^4.31.0" }, diff --git a/spec-dtslint/types-spec.ts b/spec-dtslint/types-spec.ts index 254be7abbc..ef7aab679c 100644 --- a/spec-dtslint/types-spec.ts +++ b/spec-dtslint/types-spec.ts @@ -1,87 +1,87 @@ -import { - Observable, - ObservedValueOf, - ObservedValueUnionFromArray, - ObservedValueTupleFromArray, - Cons, - Head, - Tail -} from 'rxjs'; -import { A, B, C } from './helpers'; - -describe('ObservedValueOf', () => { - it('should infer from an observable', () => { - let explicit: ObservedValueOf>; - let inferred = explicit!; // $ExpectType A - }); - - it('should infer from an array', () => { - let explicit: ObservedValueOf; - let inferred = explicit!; // $ExpectType A - }); - - it('should infer from a promise', () => { - let explicit: ObservedValueOf>; - let inferred = explicit!; // $ExpectType A - }); -}); - -describe('ObservedUnionFromArray', () => { - it('should infer from an array of observables', () => { - let explicit: ObservedValueUnionFromArray<[Observable, Observable]>; - let inferred = explicit!; // $ExpectType A | B - }); - - it('should infer from an array of arrays', () => { - let explicit: ObservedValueUnionFromArray<[A[], B[]]>; - let inferred = explicit!; // $ExpectType A | B - }); - - it('should infer from an array of promises', () => { - let explicit: ObservedValueUnionFromArray<[Promise, Promise]>; - let inferred = explicit!; // $ExpectType A | B - }); -}); - -describe('ObservedTupleFromArray', () => { - it('should infer from an array of observables', () => { - let explicit: ObservedValueTupleFromArray<[Observable, Observable]>; - let inferred = explicit!; // $ExpectType [A, B] - }); - - it('should infer from an array of arrays', () => { - let explicit: ObservedValueTupleFromArray<[A[], B[]]>; - let inferred = explicit!; // $ExpectType [A, B] - }); - - it('should infer from an array of promises', () => { - let explicit: ObservedValueTupleFromArray<[Promise, Promise]>; - let inferred = explicit!; // $ExpectType [A, B] - }); -}); - -describe('Cons', () => { - it('should construct a tuple with the specified type at the head', () => { - let explicit: Cons; - let inferred = explicit!; // $ExpectType [A, B, C] - }); - - it('should support rest tuples', () => { - let explicit: Cons; - let inferred = explicit!; // $ExpectType [A, ...B[]] - }); -}); - -describe('Head', () => { - it('should return the head of a tuple', () => { - let explicit: Head<[A, B, C]>; - let inferred = explicit!; // $ExpectType A - }); -}); - -describe('Tail', () => { - it('should return the tail of a tuple', () => { - let explicit: Tail<[A, B, C]>; - let inferred = explicit!; // $ExpectType [B, C] - }); +import { + Observable, + ObservedValueOf, + ObservedValueUnionFromArray, + ObservedValueTupleFromArray, + Cons, + Head, + Tail +} from 'rxjs'; +import { A, B, C } from './helpers'; + +describe('ObservedValueOf', () => { + it('should infer from an observable', () => { + let explicit: ObservedValueOf>; + let inferred = explicit!; // $ExpectType A + }); + + it('should infer from an array', () => { + let explicit: ObservedValueOf; + let inferred = explicit!; // $ExpectType A + }); + + it('should infer from a promise', () => { + let explicit: ObservedValueOf>; + let inferred = explicit!; // $ExpectType A + }); +}); + +describe('ObservedUnionFromArray', () => { + it('should infer from an array of observables', () => { + let explicit: ObservedValueUnionFromArray<[Observable, Observable]>; + let inferred = explicit!; // $ExpectType A | B + }); + + it('should infer from an array of arrays', () => { + let explicit: ObservedValueUnionFromArray<[A[], B[]]>; + let inferred = explicit!; // $ExpectType A | B + }); + + it('should infer from an array of promises', () => { + let explicit: ObservedValueUnionFromArray<[Promise, Promise]>; + let inferred = explicit!; // $ExpectType A | B + }); +}); + +describe('ObservedTupleFromArray', () => { + it('should infer from an array of observables', () => { + let explicit: ObservedValueTupleFromArray<[Observable, Observable]>; + let inferred = explicit!; // $ExpectType [A, B] + }); + + it('should infer from an array of arrays', () => { + let explicit: ObservedValueTupleFromArray<[A[], B[]]>; + let inferred = explicit!; // $ExpectType [A, B] + }); + + it('should infer from an array of promises', () => { + let explicit: ObservedValueTupleFromArray<[Promise, Promise]>; + let inferred = explicit!; // $ExpectType [A, B] + }); +}); + +describe('Cons', () => { + it('should construct a tuple with the specified type at the head', () => { + let explicit: Cons; + let inferred = explicit!; // $ExpectType [A, B, C] + }); + + it('should support rest tuples', () => { + let explicit: Cons; + let inferred = explicit!; // $ExpectType [arg: A, ...rest: B[]] + }); +}); + +describe('Head', () => { + it('should return the head of a tuple', () => { + let explicit: Head<[A, B, C]>; + let inferred = explicit!; // $ExpectType A + }); +}); + +describe('Tail', () => { + it('should return the tail of a tuple', () => { + let explicit: Tail<[A, B, C]>; + let inferred = explicit!; // $ExpectType [B, C] + }); }); \ No newline at end of file