npm install --save @types/dom-chromium-installation-events
This package contains type definitions for dom-chromium-installation-events (https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dom-chromium-installation-events.
type AppBannerPromptOutcome = "accepted" | "dismissed";
interface PromptResponseObject {
readonly outcome: AppBannerPromptOutcome;
readonly platform: string;
}
// https://github.com/w3c/manifest/wiki/Platforms
type BeforeInstallPromptEventPlatform =
| "chrome_web_store"
| "play"
| "itunes"
| "webapp"
| "windows"
| "f-droid"
| "amazon";
interface BeforeInstallPromptEvent extends Event {
// https://wicg.github.io/manifest-incubations/#prompt-method
prompt(): Promise<PromptResponseObject>;
readonly platforms: BeforeInstallPromptEventPlatform[];
readonly userChoice: Promise<PromptResponseObject>;
}
interface WindowEventMap {
beforeinstallprompt: BeforeInstallPromptEvent;
appinstalled: Event;
}
interface Window {
onappinstalled?: ((this: Window, ev: Event) => any) | null;
onbeforeinstallprompt?: ((this: Window, ev: BeforeInstallPromptEvent) => any) | null;
}
- Last updated: Thu, 15 Feb 2024 14:35:32 GMT
- Dependencies: none
These definitions were written by Sergey Kozlov.