Files
gitbook/types/gitbook-integrations-global.d.ts
Samy Pessé 56143277b7 Expose window.GitBook to integrations (#185)
* Expose window.GitBook to integrations

* Simplify

* Oups

* Use basic script to load integrations

* Preload the scripts
2024-02-23 13:32:09 +01:00

17 lines
479 B
TypeScript

declare global {
type GitBookIntegrationEvent = 'load' | 'unload';
interface Window {
/**
* Global `window.GitBook` object accessible by integrations.
*/
GitBook?: {
events: Map<GitBookIntegrationEvent, Function[]>;
addEventListener: (type: GitBookIntegrationEvent, func: Function) => void;
removeEventListener: (type: GitBookIntegrationEvent, func: Function) => void;
};
}
}
export {};