diff --git a/.changeset/old-pigs-happen.md b/.changeset/old-pigs-happen.md new file mode 100644 index 0000000000..2af5969966 --- /dev/null +++ b/.changeset/old-pigs-happen.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-api': patch +--- + +Add a global type definition for `Symbol.observable`, fix type checking in projects that didn't already have it defined. diff --git a/packages/core-api/src/types.ts b/packages/core-api/src/types.ts index 8782280be0..ab0aa56a1b 100644 --- a/packages/core-api/src/types.ts +++ b/packages/core-api/src/types.ts @@ -42,6 +42,14 @@ export type Subscription = { readonly closed: boolean; }; +// Declares the global well-known Symbol.observable +// We get the actual runtime polyfill from zen-observable +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} + /** * Observable sequence of values and errors, see TC39. *