Improved typings of window.Cal (#7178)
This commit is contained in:
1 parent
2f2f6006e6
commit
94f239bc42
7 files changed
+17
-18
No files matched your search
@@ -1,12 +1,12 @@
|
||||
import type { CalWindow } from "@calcom/embed-core";
|
||||
import type { GlobalCal } from "@calcom/embed-core";
|
||||
import EmbedSnippet from "@calcom/embed-snippet";
|
||||
|
||||
import Cal from "./Cal";
|
||||
|
||||
export const getCalApi = (): Promise<CalWindow["Cal"]> =>
|
||||
export const getCalApi = (): Promise<GlobalCal> =>
|
||||
new Promise(function tryReadingFromWindow(resolve) {
|
||||
EmbedSnippet();
|
||||
const api = (window as CalWindow).Cal;
|
||||
const api = window.Cal;
|
||||
if (!api) {
|
||||
setTimeout(() => {
|
||||
tryReadingFromWindow(resolve);
|
||||
|
||||
Reference in new issue
Block a user