Skip to content

Commit f43c728

Browse files
authored
fix: VS code will now properly import operators, et al (#6276)
- Adds typesVersions, enforcing TypeScript >= 4.2. - Adds some superfluous references required for TS and VS Code to find proper import locations for our strange deep import sites. - Independantly tested by building the package and installing it locally in another project, then testing in VS code. Fixes #6067 Related microsoft/TypeScript#43034
1 parent e572d2e commit f43c728

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm5/index.js",
77
"es2015": "./dist/esm/index.js",
8-
"types": "./dist/types/index.d.ts",
8+
"types": "index.d.ts",
9+
"typesVersions": {
10+
">=4.2": {
11+
"*": ["dist/types/*"]
12+
}
13+
},
914
"sideEffects": false,
1015
"exports": {
1116
".": {

src/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
//////////////////////////////////////////////////////////
2+
// Here we need to reference our other deep imports
3+
// so VS code will figure out where they are
4+
// see conversation here:
5+
// https://github.com/microsoft/TypeScript/issues/43034
6+
//////////////////////////////////////////////////////////
7+
8+
// tslint:disable: no-reference
9+
/// <reference path="./ajax/index.ts" />
10+
/// <reference path="./fetch/index.ts" />
11+
/// <reference path="./operators/index.ts" />
12+
/// <reference path="./testing/index.ts" />
13+
/// <reference path="./webSocket/index.ts" />
14+
// tslint:enable: no-reference
15+
116
/* Observable */
217
export { Observable } from './internal/Observable';
318
export { ConnectableObservable } from './internal/observable/ConnectableObservable';

0 commit comments

Comments
 (0)