# This file is auto-generated by the CDP protocol generator.
# Do not edit this file manually as your changes will be overwritten.
# Generated from Chrome DevTools Protocol specifications.

"""CDP PWA Domain Commands"""

from typing import List
from typing_extensions import NotRequired, TypedDict

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from ..target.types import TargetID
    from .types import DisplayMode
    from .types import FileHandler


class GetOsAppStateParameters(TypedDict):
    manifestId: "str"
    """The id from the webapp's manifest file, commonly it's the url of the
site installing the webapp. See
https://web.dev/learn/pwa/web-app-manifest."""


class GetOsAppStateReturns(TypedDict):
    badgeCount: "int"
    fileHandlers: "List[FileHandler]"


class InstallParameters(TypedDict):
    manifestId: "str"
    installUrlOrBundleUrl: "NotRequired[str]"
    """The location of the app or bundle overriding the one derived from the
manifestId."""


class UninstallParameters(TypedDict):
    manifestId: "str"


class LaunchParameters(TypedDict):
    manifestId: "str"
    url: "NotRequired[str]"


class LaunchReturns(TypedDict):
    targetId: "TargetID"
    """ID of the tab target created as a result."""


class LaunchFilesInAppParameters(TypedDict):
    manifestId: "str"
    files: "List[str]"


class LaunchFilesInAppReturns(TypedDict):
    targetIds: "List[TargetID]"
    """IDs of the tab targets created as the result."""


class OpenCurrentPageInAppParameters(TypedDict):
    manifestId: "str"


class ChangeAppUserSettingsParameters(TypedDict):
    manifestId: "str"
    linkCapturing: "NotRequired[bool]"
    """If user allows the links clicked on by the user in the app's scope, or
extended scope if the manifest has scope extensions and the flags
`DesktopPWAsLinkCapturingWithScopeExtensions` and
`WebAppEnableScopeExtensions` are enabled.

Note, the API does not support resetting the linkCapturing to the
initial value, uninstalling and installing the web app again will reset
it.

TODO(crbug.com/339453269): Setting this value on ChromeOS is not
supported yet."""
    displayMode: "NotRequired[DisplayMode]"
