Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Move the SDK bundle window declaration next to its exports type (#79799)

Romeo Van Snick1f6a8476dc81
diff --git a/frontend/src/embedding-sdk-bundle/types/globals.d.ts b/frontend/src/embedding-sdk-bundle/types/globals.d.ts
new file mode 100644
index 00000000000..c32034b18e8
--- /dev/null
+++ b/frontend/src/embedding-sdk-bundle/types/globals.d.ts
@@ -0,0 +1,6 @@
+interface Window {
+ // The bundle writes this global (see embedding-sdk-bundle/index.ts) and the
+ // npm package reads it. The declaration lives here, next to the exports
+ // type, so that embedding-sdk-shared does not depend on bundle types.
+ METABASE_EMBEDDING_SDK_BUNDLE?: import("embedding-sdk-bundle/types/sdk-bundle").MetabaseEmbeddingSdkBundleExports;
+}
diff --git a/frontend/src/embedding-sdk-shared/types/globals.d.ts b/frontend/src/embedding-sdk-shared/types/globals.d.ts
index e1f510865e4..227cfd72617 100644
--- a/frontend/src/embedding-sdk-shared/types/globals.d.ts
+++ b/frontend/src/embedding-sdk-shared/types/globals.d.ts
@@ -6,7 +6,6 @@ interface Window {
ReactDOMClient?: unknown;
ReactDOMServer?: unknown;
- METABASE_EMBEDDING_SDK_BUNDLE?: import("embedding-sdk-bundle/types/sdk-bundle").MetabaseEmbeddingSdkBundleExports;
METABASE_EMBEDDING_SDK_ASSET_BASE_URL?: string; // Base URL for on-demand SDK chunks; set by the bootstrap
METABASE_PROVIDER_PROPS_STORE?: import("embedding-sdk-shared/lib/ensure-metabase-provider-props-store").MetabaseProviderPropsStore;