From 73c768e13ee16286f52be8a17154593a838e143b Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Thu, 3 Aug 2023 11:55:43 +0100 Subject: [PATCH 1/2] Move Symbol.observable back to src/observable and add note --- src/helpers.ts | 6 ------ src/observable.ts | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/helpers.ts b/src/helpers.ts index c237eb7..f195aef 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,11 +1,5 @@ import { TalkbackFn, TeardownFn, Start, Push, SignalKind } from './types'; -declare global { - interface SymbolConstructor { - readonly observable: symbol; - } -} - /** Placeholder {@link TeardownFn | teardown functions} that's a no-op. * @see {@link TeardownFn} for the definition and usage of teardowns. * @internal diff --git a/src/observable.ts b/src/observable.ts index b80c079..6593a32 100644 --- a/src/observable.ts +++ b/src/observable.ts @@ -1,6 +1,14 @@ import { Source, SignalKind, TalkbackKind } from './types'; import { push, start, talkbackPlaceholder, observableSymbol } from './helpers'; +// NOTE: This must be placed in an exported file for `rollup-plugin-dts` +// to include it in output typings files +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} + /** A definition of the ES Observable Subscription type that is returned by * {@link Observable.subscribe} * From 49127a0dbd3f92449e2c783db2367f28c216af38 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Thu, 3 Aug 2023 11:56:14 +0100 Subject: [PATCH 2/2] Add changeset --- .changeset/fresh-tips-yell.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fresh-tips-yell.md diff --git a/.changeset/fresh-tips-yell.md b/.changeset/fresh-tips-yell.md new file mode 100644 index 0000000..2ad706d --- /dev/null +++ b/.changeset/fresh-tips-yell.md @@ -0,0 +1,5 @@ +--- +'wonka': patch +--- + +Add missing `Symbol.observable` global declaration back to typings.