Mirror: 🎩 A tiny but capable push & pull stream library for TypeScript and Flow
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: Add Symbol.observable typings and isolate const enums (#141)

authored by

Phil Pluckthun and committed by
GitHub
299cd0d1 ddbe75cb

+62 -37
+5
.changeset/new-feet-sell.md
··· 1 + --- 2 + 'wonka': patch 3 + --- 4 + 5 + Fix missing `Symbol.observable` typings and remove `const enum` exports, which aren't usable in isolated modules.
+1 -1
package.json
··· 99 99 "rollup-plugin-cjs-check": "^1.0.1", 100 100 "rollup-plugin-dts": "^5.1.1", 101 101 "tslib": "^2.4.1", 102 - "typescript": "^4.9.3", 102 + "typescript": "^4.9.5", 103 103 "vitest": "^0.25.3", 104 104 "zen-observable": "^0.10.0" 105 105 }
+33 -33
pnpm-lock.yaml
··· 30 30 rollup-plugin-cjs-check: ^1.0.1 31 31 rollup-plugin-dts: ^5.1.1 32 32 tslib: ^2.4.1 33 - typescript: ^4.9.3 33 + typescript: ^4.9.5 34 34 vitest: ^0.25.3 35 35 zen-observable: ^0.10.0 36 36 ··· 41 41 '@rollup/plugin-commonjs': 23.0.3_rollup@3.5.1 42 42 '@rollup/plugin-node-resolve': 15.0.1_rollup@3.5.1 43 43 '@rollup/plugin-terser': 0.1.0_rollup@3.5.1 44 - '@rollup/plugin-typescript': 10.0.1_3d7bvrhnnvjmhphi3zgbz54owe 44 + '@rollup/plugin-typescript': 10.0.1_i353se4wjqegof6rzgogenttmu 45 45 '@rollup/pluginutils': 5.0.2_rollup@3.5.1 46 46 '@types/zen-observable': 0.8.3 47 - '@typescript-eslint/eslint-plugin': 5.45.0_yjegg5cyoezm3fzsmuszzhetym 48 - '@typescript-eslint/parser': 5.45.0_s5ps7njkmjlaqajutnox5ntcla 47 + '@typescript-eslint/eslint-plugin': 5.45.0_kmw7swegqdzhqtxnpydwp4nxvm 48 + '@typescript-eslint/parser': 5.45.0_zbm6mgjew7sm4ssghrxdqoiad4 49 49 callbag-from-iter: 1.3.0 50 50 callbag-iterate: 1.0.0 51 51 callbag-take: 1.5.0 ··· 62 62 rimraf: 3.0.2 63 63 rollup: 3.5.1 64 64 rollup-plugin-cjs-check: 1.0.1_rollup@3.5.1 65 - rollup-plugin-dts: 5.1.1_rt6svyh24sgpogwv5hms77uhpq 65 + rollup-plugin-dts: 5.1.1_7qkzlat3umsxdjhtme2mo4o6km 66 66 tslib: 2.4.1 67 - typescript: 4.9.3 67 + typescript: 4.9.5 68 68 vitest: 0.25.3 69 69 zen-observable: 0.10.0 70 70 ··· 500 500 terser: 5.16.1 501 501 dev: true 502 502 503 - /@rollup/plugin-typescript/10.0.1_3d7bvrhnnvjmhphi3zgbz54owe: 503 + /@rollup/plugin-typescript/10.0.1_i353se4wjqegof6rzgogenttmu: 504 504 resolution: {integrity: sha512-wBykxRLlX7EzL8BmUqMqk5zpx2onnmRMSw/l9M1sVfkJvdwfxogZQVNUM9gVMJbjRLDR5H6U0OMOrlDGmIV45A==} 505 505 engines: {node: '>=14.0.0'} 506 506 peerDependencies: ··· 517 517 resolve: 1.22.1 518 518 rollup: 3.5.1 519 519 tslib: 2.4.1 520 - typescript: 4.9.3 520 + typescript: 4.9.5 521 521 dev: true 522 522 523 523 /@rollup/pluginutils/5.0.2_rollup@3.5.1: ··· 601 601 resolution: {integrity: sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==} 602 602 dev: true 603 603 604 - /@typescript-eslint/eslint-plugin/5.45.0_yjegg5cyoezm3fzsmuszzhetym: 604 + /@typescript-eslint/eslint-plugin/5.45.0_kmw7swegqdzhqtxnpydwp4nxvm: 605 605 resolution: {integrity: sha512-CXXHNlf0oL+Yg021cxgOdMHNTXD17rHkq7iW6RFHoybdFgQBjU3yIXhhcPpGwr1CjZlo6ET8C6tzX5juQoXeGA==} 606 606 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 607 607 peerDependencies: ··· 612 612 typescript: 613 613 optional: true 614 614 dependencies: 615 - '@typescript-eslint/parser': 5.45.0_s5ps7njkmjlaqajutnox5ntcla 615 + '@typescript-eslint/parser': 5.45.0_zbm6mgjew7sm4ssghrxdqoiad4 616 616 '@typescript-eslint/scope-manager': 5.45.0 617 - '@typescript-eslint/type-utils': 5.45.0_s5ps7njkmjlaqajutnox5ntcla 618 - '@typescript-eslint/utils': 5.45.0_s5ps7njkmjlaqajutnox5ntcla 617 + '@typescript-eslint/type-utils': 5.45.0_zbm6mgjew7sm4ssghrxdqoiad4 618 + '@typescript-eslint/utils': 5.45.0_zbm6mgjew7sm4ssghrxdqoiad4 619 619 debug: 4.3.4 620 620 eslint: 8.29.0 621 621 ignore: 5.2.1 622 622 natural-compare-lite: 1.4.0 623 623 regexpp: 3.2.0 624 624 semver: 7.3.8 625 - tsutils: 3.21.0_typescript@4.9.3 626 - typescript: 4.9.3 625 + tsutils: 3.21.0_typescript@4.9.5 626 + typescript: 4.9.5 627 627 transitivePeerDependencies: 628 628 - supports-color 629 629 dev: true 630 630 631 - /@typescript-eslint/parser/5.45.0_s5ps7njkmjlaqajutnox5ntcla: 631 + /@typescript-eslint/parser/5.45.0_zbm6mgjew7sm4ssghrxdqoiad4: 632 632 resolution: {integrity: sha512-brvs/WSM4fKUmF5Ot/gEve6qYiCMjm6w4HkHPfS6ZNmxTS0m0iNN4yOChImaCkqc1hRwFGqUyanMXuGal6oyyQ==} 633 633 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 634 634 peerDependencies: ··· 640 640 dependencies: 641 641 '@typescript-eslint/scope-manager': 5.45.0 642 642 '@typescript-eslint/types': 5.45.0 643 - '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.9.3 643 + '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.9.5 644 644 debug: 4.3.4 645 645 eslint: 8.29.0 646 - typescript: 4.9.3 646 + typescript: 4.9.5 647 647 transitivePeerDependencies: 648 648 - supports-color 649 649 dev: true ··· 656 656 '@typescript-eslint/visitor-keys': 5.45.0 657 657 dev: true 658 658 659 - /@typescript-eslint/type-utils/5.45.0_s5ps7njkmjlaqajutnox5ntcla: 659 + /@typescript-eslint/type-utils/5.45.0_zbm6mgjew7sm4ssghrxdqoiad4: 660 660 resolution: {integrity: sha512-DY7BXVFSIGRGFZ574hTEyLPRiQIvI/9oGcN8t1A7f6zIs6ftbrU0nhyV26ZW//6f85avkwrLag424n+fkuoJ1Q==} 661 661 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 662 662 peerDependencies: ··· 666 666 typescript: 667 667 optional: true 668 668 dependencies: 669 - '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.9.3 670 - '@typescript-eslint/utils': 5.45.0_s5ps7njkmjlaqajutnox5ntcla 669 + '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.9.5 670 + '@typescript-eslint/utils': 5.45.0_zbm6mgjew7sm4ssghrxdqoiad4 671 671 debug: 4.3.4 672 672 eslint: 8.29.0 673 - tsutils: 3.21.0_typescript@4.9.3 674 - typescript: 4.9.3 673 + tsutils: 3.21.0_typescript@4.9.5 674 + typescript: 4.9.5 675 675 transitivePeerDependencies: 676 676 - supports-color 677 677 dev: true ··· 681 681 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 682 682 dev: true 683 683 684 - /@typescript-eslint/typescript-estree/5.45.0_typescript@4.9.3: 684 + /@typescript-eslint/typescript-estree/5.45.0_typescript@4.9.5: 685 685 resolution: {integrity: sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==} 686 686 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 687 687 peerDependencies: ··· 696 696 globby: 11.1.0 697 697 is-glob: 4.0.3 698 698 semver: 7.3.8 699 - tsutils: 3.21.0_typescript@4.9.3 700 - typescript: 4.9.3 699 + tsutils: 3.21.0_typescript@4.9.5 700 + typescript: 4.9.5 701 701 transitivePeerDependencies: 702 702 - supports-color 703 703 dev: true 704 704 705 - /@typescript-eslint/utils/5.45.0_s5ps7njkmjlaqajutnox5ntcla: 705 + /@typescript-eslint/utils/5.45.0_zbm6mgjew7sm4ssghrxdqoiad4: 706 706 resolution: {integrity: sha512-OUg2JvsVI1oIee/SwiejTot2OxwU8a7UfTFMOdlhD2y+Hl6memUSL4s98bpUTo8EpVEr0lmwlU7JSu/p2QpSvA==} 707 707 engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 708 708 peerDependencies: ··· 712 712 '@types/semver': 7.3.13 713 713 '@typescript-eslint/scope-manager': 5.45.0 714 714 '@typescript-eslint/types': 5.45.0 715 - '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.9.3 715 + '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.9.5 716 716 eslint: 8.29.0 717 717 eslint-scope: 5.1.1 718 718 eslint-utils: 3.0.0_eslint@8.29.0 ··· 3149 3149 rollup: 3.5.1 3150 3150 dev: true 3151 3151 3152 - /rollup-plugin-dts/5.1.1_rt6svyh24sgpogwv5hms77uhpq: 3152 + /rollup-plugin-dts/5.1.1_7qkzlat3umsxdjhtme2mo4o6km: 3153 3153 resolution: {integrity: sha512-zpgo52XmnLg8w4k3MScinFHZK1+ro6r7uVe34fJ0Ee8AM45FvgvTuvfWWaRgIpA4pQ1BHJuu2ospncZhkcJVeA==} 3154 3154 engines: {node: '>=v14'} 3155 3155 peerDependencies: ··· 3158 3158 dependencies: 3159 3159 magic-string: 0.27.0 3160 3160 rollup: 3.5.1 3161 - typescript: 4.9.3 3161 + typescript: 4.9.5 3162 3162 optionalDependencies: 3163 3163 '@babel/code-frame': 7.18.6 3164 3164 dev: true ··· 3562 3562 resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} 3563 3563 dev: true 3564 3564 3565 - /tsutils/3.21.0_typescript@4.9.3: 3565 + /tsutils/3.21.0_typescript@4.9.5: 3566 3566 resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} 3567 3567 engines: {node: '>= 6'} 3568 3568 peerDependencies: 3569 3569 typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' 3570 3570 dependencies: 3571 3571 tslib: 1.14.1 3572 - typescript: 4.9.3 3572 + typescript: 4.9.5 3573 3573 dev: true 3574 3574 3575 3575 /tty-table/4.1.6: ··· 3633 3633 hasBin: true 3634 3634 dev: true 3635 3635 3636 - /typescript/4.9.3: 3637 - resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} 3636 + /typescript/4.9.5: 3637 + resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} 3638 3638 engines: {node: '>=4.2.0'} 3639 3639 hasBin: true 3640 3640 dev: true
+12 -1
src/index.ts
··· 10 10 * @packageDocumentation 11 11 */ 12 12 13 - export * from './types'; 13 + export type { 14 + TeardownFn, 15 + Signal, 16 + Sink, 17 + Source, 18 + Operator, 19 + TypeOfSource, 20 + Subscription, 21 + Observer, 22 + Subject, 23 + } from './types'; 24 + 14 25 export * from './sources'; 15 26 export * from './operators'; 16 27 export * from './sinks';
+8 -1
src/observable.ts
··· 1 1 import { Source, SignalKind, TalkbackKind } from './types'; 2 2 import { push, start, talkbackPlaceholder } from './helpers'; 3 3 4 + declare global { 5 + interface SymbolConstructor { 6 + readonly observable: symbol; 7 + } 8 + } 9 + 4 10 /** A definition of the ES Observable Subscription type that is returned by 5 11 * {@link Observable.subscribe} 6 12 * ··· 124 130 * 125 131 * @internal 126 132 */ 127 - const observableSymbol = (): typeof Symbol.observable => Symbol.observable || '@@observable'; 133 + const observableSymbol = (): typeof Symbol.observable => 134 + Symbol.observable || ('@@observable' as any); 128 135 129 136 /** Converts an ES Observable to a {@link Source}. 130 137 * @param input - The {@link ObservableLike} object that will be converted.
+3 -1
tsconfig.json
··· 1 1 { 2 2 "compilerOptions": { 3 3 "forceConsistentCasingInFileNames": true, 4 + "importsNotUsedAsValues": "remove", 4 5 "noEmit": true, 5 6 "esModuleInterop": true, 6 7 "noUnusedLocals": true, ··· 16 17 "strict": true, 17 18 "noImplicitAny": false, 18 19 "noUnusedParameters": true, 19 - "skipLibCheck": true 20 + "skipLibCheck": true, 21 + "isolatedModules": true 20 22 }, 21 23 "include": ["src"] 22 24 }