@types/dom-chromium-installation-events
TypeScript icon, indicating that this package has built-in type declarations

101.0.4 • Public • Published

Installation

npm install --save @types/dom-chromium-installation-events

Summary

This package contains type definitions for dom-chromium-installation-events (https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent).

Details

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;
}

Additional Details

  • Last updated: Thu, 15 Feb 2024 14:35:32 GMT
  • Dependencies: none

Credits

These definitions were written by Sergey Kozlov.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/dom-chromium-installation-events

Weekly Downloads

4,585

Version

101.0.4

License

MIT

Unpacked Size

4.65 kB

Total Files

5

Last publish

Collaborators

  • types