# Copyright (c) Microsoft Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

SerializedValue:
  type: object
  # Exactly one of the properties must be present.
  properties:
    n: number?
    b: boolean?
    s: string?
    v:
      type: enum?
      literals:
      - null
      - undefined
      - NaN
      - Infinity
      - -Infinity
      - "-0"
    # String representation of the Date.
    d: string?
    # Regular expression pattern and flags.
    r:
      type: object?
      properties:
        p: string
        f: string
    a:
      type: array?
      items: SerializedValue
    # Object with keys and values.
    o:
      type: array?
      items:
        type: object
        properties:
          k: string
          v: SerializedValue
    # An index in the handles array from SerializedArgument.
    h: number?


# Represents a value with handle references.
SerializedArgument:
  type: object
  properties:
    value: SerializedValue
    handles:
      type: array
      items: Channel


AXNode:
  type: object
  properties:
    role: string
    name: string
    valueString: string?
    valueNumber: number?
    description: string?
    keyshortcuts: string?
    roledescription: string?
    valuetext: string?
    disabled: boolean?
    expanded: boolean?
    focused: boolean?
    modal: boolean?
    multiline: boolean?
    multiselectable: boolean?
    readonly: boolean?
    required: boolean?
    selected: boolean?
    checked:
      type: enum?
      literals:
      - checked
      - unchecked
      - mixed
    pressed:
      type: enum?
      literals:
      - pressed
      - released
      - mixed
    level: number?
    valuemin: number?
    valuemax: number?
    autocomplete: string?
    haspopup: string?
    invalid: string?
    orientation: string?
    children:
      type: array?
      items: AXNode


SerializedError:
  type: object
  properties:
    error:
      type: object?
      properties:
        message: string
        name: string
        stack: string?
    value: SerializedValue?


Playwright:
  type: interface

  initializer:
    chromium: BrowserType
    firefox: BrowserType
    webkit: BrowserType
    electron: Electron?
    deviceDescriptors:
      type: array
      items:
        type: object
        properties:
          name: string
          descriptor:
            type: object
            properties:
              userAgent: string
              viewport:
                type: object
                properties:
                  width: number
                  height: number
              deviceScaleFactor: number
              isMobile: boolean
              hasTouch: boolean
    selectors: Selectors



Selectors:
  type: interface

  commands:

    register:
      parameters:
        name: string
        source: string
        contentScript: boolean?

    createSelector:
      parameters:
        name: string
        handle: ElementHandle
      returns:
        value: string?



BrowserType:
  type: interface

  initializer:
    executablePath: string
    name: string

  commands:

    launch:
      parameters:
        executablePath: string?
        args:
          type: array?
          items: string
        ignoreAllDefaultArgs: boolean?
        ignoreDefaultArgs:
          type: array?
          items: string
        handleSIGINT: boolean?
        handleSIGTERM: boolean?
        handleSIGHUP: boolean?
        timeout: number?
        env:
          type: array?
          items:
            type: object
            properties:
              name: string
              value: string
        headless: boolean?
        devtools: boolean?
        proxy:
          type: object?
          properties:
            server: string
            bypass: string?
            username: string?
            password: string?
        downloadsPath: string?
        firefoxUserPrefs: json?
        chromiumSandbox: boolean?
        slowMo: number?
      returns:
        browser: Browser

    launchPersistentContext:
      parameters:
        userDataDir: string
        executablePath: string?
        args:
          type: array?
          items: string
        ignoreAllDefaultArgs: boolean?
        ignoreDefaultArgs:
          type: array?
          items: string
        handleSIGINT: boolean?
        handleSIGTERM: boolean?
        handleSIGHUP: boolean?
        timeout: number?
        env:
          type: array?
          items:
            type: object
            properties:
              name: string
              value: string
        headless: boolean?
        devtools: boolean?
        proxy:
          type: object?
          properties:
            server: string
            bypass: string?
            username: string?
            password: string?
        downloadsPath: string?
        chromiumSandbox: boolean?
        slowMo: number?
        noDefaultViewport: boolean?
        viewport:
          type: object?
          properties:
            width: number
            height: number
        ignoreHTTPSErrors: boolean?
        javaScriptEnabled: boolean?
        bypassCSP: boolean?
        userAgent: string?
        locale: string?
        timezoneId: string?
        geolocation:
          type: object?
          properties:
            longitude: number
            latitude: number
            accuracy: number?
        permissions:
          type: array?
          items: string
        extraHTTPHeaders:
          type: array?
          items:
            type: object
            properties:
              name: string
              value: string
        offline: boolean?
        httpCredentials:
          type: object?
          properties:
            username: string
            password: string
        deviceScaleFactor: number?
        isMobile: boolean?
        hasTouch: boolean?
        colorScheme:
          type: enum?
          literals:
          - light
          - dark
          - no-preference
        acceptDownloads: boolean?
      returns:
        context: BrowserContext


Browser:
  type: interface

  initializer:
    version: string

  commands:

    close:

    newContext:
      parameters:
        noDefaultViewport: boolean?
        viewport:
          type: object?
          properties:
            width: number
            height: number
        ignoreHTTPSErrors: boolean?
        javaScriptEnabled: boolean?
        bypassCSP: boolean?
        userAgent: string?
        locale: string?
        timezoneId: string?
        geolocation:
          type: object?
          properties:
            longitude: number
            latitude: number
            accuracy: number?
        permissions:
          type: array?
          items: string
        extraHTTPHeaders:
          type: array?
          items:
            type: object
            properties:
              name: string
              value: string
        offline: boolean?
        httpCredentials:
          type: object?
          properties:
            username: string
            password: string
        deviceScaleFactor: number?
        isMobile: boolean?
        hasTouch: boolean?
        colorScheme:
          type: enum?
          literals:
          - dark
          - light
          - no-preference
        acceptDownloads: boolean?
      returns:
        context: BrowserContext

    crNewBrowserCDPSession:
      returns:
        session: CDPSession

    crStartTracing:
      parameters:
        page: Page?
        path: string?
        screenshots: boolean?
        categories:
          type: array?
          items: string

    crStopTracing:
      returns:
        binary: binary

  events:

    close:



BrowserContext:
  type: interface

  commands:

    addCookies:
      parameters:
        cookies:
          type: array
          items:
            type: object
            properties:
              name: string
              value: string
              url: string?
              domain: string?
              path: string?
              expires: number?
              httpOnly: boolean?
              secure: boolean?
              sameSite:
                type: enum?
                literals:
                - Strict
                - Lax
                - None

    addInitScript:
      parameters:
        source: string

    clearCookies:

    clearPermissions:

    close:

    cookies:
      parameters:
        urls:
          type: array
          items: string
      returns:
        cookies:
          type: array
          items:
            type: object
            properties:
              name: string
              value: string
              domain: string
              path: string
              expires: number
              httpOnly: boolean
              secure: boolean
              sameSite:
                type: enum
                literals:
                - Strict
                - Lax
                - None

    exposeBinding:
      parameters:
        name: string

    grantPermissions:
      parameters:
        permissions:
          type: array
          items: string
        origin: string?

    newPage:
      returns:
        page: Page

    setDefaultNavigationTimeoutNoReply:
      parameters:
        timeout: number

    setDefaultTimeoutNoReply:
      parameters:
        timeout: number

    setExtraHTTPHeaders:
      parameters:
        headers:
          type: array
          items:
            type: object
            properties:
              name: string
              value: string

    setGeolocation:
      parameters:
        geolocation:
          type: object?
          properties:
            longitude: number
            latitude: number
            accuracy: number?

    setHTTPCredentials:
      parameters:
        httpCredentials:
          type: object?
          properties:
            username: string
            password: string

    setNetworkInterceptionEnabled:
      parameters:
        enabled: boolean

    setOffline:
      parameters:
        offline: boolean

    crNewCDPSession:
      parameters:
        page: Page
      returns:
        session: CDPSession

  events:

    bindingCall:
      parameters:
        binding: BindingCall

    close:

    page:
      parameters:
        page: Page

    route:
      parameters:
        route: Route
        request: Request

    crBackgroundPage:
      parameters:
        page: Page

    crServiceWorker:
      parameters:
        worker: Worker



Page:
  type: interface

  initializer:
    mainFrame: Frame
    viewportSize:
      type: object?
      properties:
        width: number
        height: number
    isClosed: boolean

  commands:

    setDefaultNavigationTimeoutNoReply:
      parameters:
        timeout: number

    setDefaultTimeoutNoReply:
      parameters:
        timeout: number

    setFileChooserInterceptedNoReply:
      parameters:
        intercepted: boolean

    addInitScript:
      parameters:
        source: string

    close:
      parameters:
        runBeforeUnload: boolean?

    emulateMedia:
      parameters:
        media:
          type: enum?
          literals:
          - screen
          - print
          # Reset emulated value to the system default.
          - null
        colorScheme:
          type: enum?
          literals:
          - dark
          - light
          - no-preference
          # Reset emulated value to the system default.
          - null

    exposeBinding:
      parameters:
        name: string

    goBack:
      parameters:
        timeout: number?
        waitUntil:
          type: enum?
          literals:
          - load
          - domcontentloaded
          - networkidle
      returns:
        response: Response?

    goForward:
      parameters:
        timeout: number?
        waitUntil:
          type: enum?
          literals:
          - load
          - domcontentloaded
          - networkidle
      returns:
        response: Response?

    opener:
      returns:
        page: Page?

    reload:
      parameters:
        timeout: number?
        waitUntil:
          type: enum?
          literals:
          - load
          - domcontentloaded
          - networkidle
      returns:
        response: Response?

    screenshot:
      parameters:
        timeout: number?
        type:
          type: enum?
          literals:
          - png
          - jpeg
        quality: number?
        omitBackground: boolean?
        fullPage: boolean?
        clip:
          type: object?
          properties:
            width: number
            height: number
            x: number
            y: number
      returns:
        binary: binary

    setExtraHTTPHeaders:
      parameters:
        headers:
          type: array
          items:
            type: object
            properties:
              name: string
              value: string

    setNetworkInterceptionEnabled:
      parameters:
        enabled: boolean

    setViewportSize:
      parameters:
        viewportSize:
          type: object
          properties:
            width: number
            height: number

    keyboardDown:
      parameters:
        key: string

    keyboardUp:
      parameters:
        key: string

    keyboardInsertText:
      parameters:
        text: string

    keyboardType:
      parameters:
        text: string
        delay: number?

    keyboardPress:
      parameters:
        key: string
        delay: number?

    mouseMove:
      parameters:
        x: number
        y: number
        steps: number?

    mouseDown:
      parameters:
        button:
          type: enum?
          literals:
          - left
          - right
          - middle
        clickCount: number?

    mouseUp:
      parameters:
        button:
          type: enum?
          literals:
          - left
          - right
          - middle
        clickCount: number?

    mouseClick:
      parameters:
        x: number
        y: number
        delay: number?
        button:
          type: enum?
          literals:
          - left
          - right
          - middle
        clickCount: number?

    accessibilitySnapshot:
      parameters:
        interestingOnly: boolean?
        root: ElementHandle?
      returns:
        rootAXNode: AXNode?

    pdf:
      parameters:
        scale: number?
        displayHeaderFooter: boolean?
        headerTemplate: string?
        footerTemplate: string?
        printBackground: boolean?
        landscape: boolean?
        pageRanges: string?
        format: string?
        width: string?
        height: string?
        preferCSSPageSize: boolean?
        margin:
          type: object?
          properties:
            top: string?
            bottom: string?
            left: string?
            right: string?
      returns:
        pdf: binary

    crStartJSCoverage:
      parameters:
        resetOnNavigation: boolean?
        reportAnonymousScripts: boolean?

    crStopJSCoverage:
      returns:
        entries:
          type: array
          items:
            type: object
            properties:
              url: string
              scriptId: string
              source: string?
              functions:
                type: array
                items:
                  type: object
                  properties:
                    functionName: string
                    isBlockCoverage: boolean
                    ranges:
                      type: array
                      items:
                        type: object
                        properties:
                          startOffset: number
                          endOffset: number
                          count: number

    crStartCSSCoverage:
      parameters:
        resetOnNavigation: boolean?

    crStopCSSCoverage:
      returns:
        entries:
          type: array
          items:
            type: object
            properties:
              url: string
              text: string?
              ranges:
                type: array
                items:
                  type: object
                  properties:
                    start: number
                    end: number

    bringToFront:

  events:

    bindingCall:
      parameters:
        binding: BindingCall

    close:

    console:
      parameters:
        message: ConsoleMessage

    crash:

    dialog:
      parameters:
        dialog: Dialog

    download:
      parameters:
        download: Download

    domcontentloaded:

    fileChooser:
      parameters:
        element: ElementHandle
        isMultiple: boolean

    frameAttached:
      parameters:
        frame: Frame

    frameDetached:
      parameters:
        frame: Frame

    load:

    pageError:
      parameters:
        error: SerializedError

    popup:
      parameters:
        page: Page

    request:
      parameters:
        request: Request

    requestFailed:
      parameters:
        request: Request
        failureText: string?

    requestFinished:
      parameters:
        request: Request

    response:
      parameters:
        response: Response

    route:
      parameters:
        route: Route
        request: Request

    worker:
      parameters:
        worker: Worker



Frame:
  type: interface

  initializer:
    url: string
    name: string
    parentFrame: Frame?
    loadStates:
      type: array
      items:
        type: enum
        literals:
        - load
        - domcontentloaded
        - networkidle

  commands:

    evalOnSelector:
      parameters:
        selector: string
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    evalOnSelectorAll:
      parameters:
        selector: string
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    addScriptTag:
      parameters:
        url: string?
        content: string?
        type: string?
      returns:
        element: ElementHandle

    addStyleTag:
      parameters:
        url: string?
        content: string?
      returns:
        element: ElementHandle

    check:
      parameters:
        selector: string
        force: boolean?
        noWaitAfter: boolean?
        timeout: number?

    click:
      parameters:
        selector: string
        force: boolean?
        noWaitAfter: boolean?
        modifiers:
          type: array?
          items:
            type: enum
            literals:
            - Alt
            - Control
            - Meta
            - Shift
        position:
          type: object?
          properties:
            x: number
            y: number
        delay: number?
        button:
          type: enum?
          literals:
          - left
          - right
          - middle
        clickCount: number?
        timeout: number?

    content:
      returns:
        value: string

    dblclick:
      parameters:
        selector: string
        force: boolean?
        noWaitAfter: boolean?
        modifiers:
          type: array?
          items:
            type: enum
            literals:
            - Alt
            - Control
            - Meta
            - Shift
        position:
          type: object?
          properties:
            x: number
            y: number
        delay: number?
        button:
          type: enum?
          literals:
          - left
          - right
          - middle
        timeout: number?

    dispatchEvent:
      parameters:
        selector: string
        type: string
        eventInit: SerializedArgument
        timeout: number?

    evaluateExpression:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    evaluateExpressionHandle:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        handle: JSHandle

    fill:
      parameters:
        selector: string
        value: string
        timeout: number?
        noWaitAfter: boolean?

    focus:
      parameters:
        selector: string
        timeout: number?

    frameElement:
      returns:
        element: ElementHandle

    getAttribute:
      parameters:
        selector: string
        name: string
        timeout: number?
      returns:
        value: string?

    goto:
      parameters:
        url: string
        timeout: number?
        waitUntil:
          type: enum?
          literals:
          - load
          - domcontentloaded
          - networkidle
        referer: string?
      returns:
        response: Response?

    hover:
      parameters:
        selector: string
        force: boolean?
        modifiers:
          type: array?
          items:
            type: enum
            literals:
            - Alt
            - Control
            - Meta
            - Shift
        position:
          type: object?
          properties:
            x: number
            y: number
        timeout: number?

    innerHTML:
      parameters:
        selector: string
        timeout: number?
      returns:
        value: string

    innerText:
      parameters:
        selector: string
        timeout: number?
      returns:
        value: string

    press:
      parameters:
        selector: string
        key: string
        delay: number?
        noWaitAfter: boolean?
        timeout: number?

    querySelector:
      parameters:
        selector: string
      returns:
        element: ElementHandle?

    querySelectorAll:
      parameters:
        selector: string
      returns:
        elements:
          type: array
          items: ElementHandle

    selectOption:
      parameters:
        selector: string
        elements:
          type: array?
          items: ElementHandle
        options:
          type: array?
          items:
            type: object
            properties:
              value: string?
              label: string?
              index: number?
        timeout: number?
        noWaitAfter: boolean?
      returns:
        values:
          type: array
          items: string

    setContent:
      parameters:
        html: string
        timeout: number?
        waitUntil:
          type: enum?
          literals:
          - load
          - domcontentloaded
          - networkidle

    setInputFiles:
      parameters:
        selector: string
        files:
          type: array
          items:
            type: object
            properties:
              name: string
              mimeType: string
              buffer: string
        timeout: number?
        noWaitAfter: boolean?

    textContent:
      parameters:
        selector: string
        timeout: number?
      returns:
        value: string?

    title:
      returns:
        value: string

    type:
      parameters:
        selector: string
        text: string
        delay: number?
        noWaitAfter: boolean?
        timeout: number?

    uncheck:
      parameters:
        selector: string
        force: boolean?
        noWaitAfter: boolean?
        timeout: number?

    waitForFunction:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
        timeout: number?
        # When present, polls on interval. Otherwise, polls on raf.
        pollingInterval: number?
      returns:
        handle: JSHandle

    waitForSelector:
      parameters:
        selector: string
        timeout: number?
        state:
          type: enum?
          literals:
          - attached
          - detached
          - visible
          - hidden
      returns:
        element: ElementHandle?

  events:

    loadstate:
      parameters:
        add:
          type: enum?
          literals:
          - load
          - domcontentloaded
          - networkidle
        remove:
          type: enum?
          literals:
          - load
          - domcontentloaded
          - networkidle

    navigated:
      parameters:
        url: string
        name: string
        newDocument:
          type: object?
          properties:
            request: Request?
        error: string?



Worker:
  type: interface

  initializer:
    url: string

  commands:

    evaluateExpression:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    evaluateExpressionHandle:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        handle: JSHandle

  events:

    close:


JSHandle:
  type: interface

  initializer:
    preview: string

  commands:

    dispose:

    evaluateExpression:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    evaluateExpressionHandle:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        handle: JSHandle

    getPropertyList:
      returns:
        properties:
          type: array
          items:
            type: object
            properties:
              name: string
              value: JSHandle

    getProperty:
      parameters:
        name: string
      returns:
        handle: JSHandle

    jsonValue:
      returns:
        value: SerializedValue

  events:

    previewUpdated:
      parameters:
        preview: string



ElementHandle:
  type: interface

  extends: JSHandle

  commands:

    evalOnSelector:
      parameters:
        selector: string
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    evalOnSelectorAll:
      parameters:
        selector: string
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    boundingBox:
      returns:
        value:
          type: object?
          properties:
            width: number
            height: number
            x: number
            y: number

    check:
      parameters:
        force: boolean?
        noWaitAfter: boolean?
        timeout: number?

    click:
      parameters:
        force: boolean?
        noWaitAfter: boolean?
        modifiers:
          type: array?
          items:
            type: enum
            literals:
            - Alt
            - Control
            - Meta
            - Shift
        position:
          type: object?
          properties:
            x: number
            y: number
        delay: number?
        button:
          type: enum?
          literals:
          - left
          - right
          - middle
        clickCount: number?
        timeout: number?

    contentFrame:
      returns:
        frame: Frame?

    dblclick:
      parameters:
        force: boolean?
        noWaitAfter: boolean?
        modifiers:
          type: array?
          items:
            type: enum
            literals:
            - Alt
            - Control
            - Meta
            - Shift
        position:
          type: object?
          properties:
            x: number
            y: number
        delay: number?
        button:
          type: enum?
          literals:
          - left
          - right
          - middle
        timeout: number?

    dispatchEvent:
      parameters:
        type: string
        eventInit: SerializedArgument

    fill:
      parameters:
        value: string
        timeout: number?
        noWaitAfter: boolean?

    focus:

    getAttribute:
      parameters:
        name: string
      returns:
        value: string?

    hover:
      parameters:
        force: boolean?
        modifiers:
          type: array?
          items:
            type: enum
            literals:
            - Alt
            - Control
            - Meta
            - Shift
        position:
          type: object?
          properties:
            x: number
            y: number
        timeout: number?

    innerHTML:
      returns:
        value: string

    innerText:
      returns:
        value: string

    ownerFrame:
      returns:
        frame: Frame?

    press:
      parameters:
        key: string
        delay: number?
        timeout: number?
        noWaitAfter: boolean?

    querySelector:
      parameters:
        selector: string
      returns:
        element: ElementHandle?

    querySelectorAll:
      parameters:
        selector: string
      returns:
        elements:
          type: array
          items: ElementHandle

    screenshot:
      parameters:
        timeout: number?
        type:
          type: enum?
          literals:
          - png
          - jpeg
        path: string?
        quality: number?
        omitBackground: boolean?
      returns:
        binary: binary

    scrollIntoViewIfNeeded:
      parameters:
        timeout: number?

    selectOption:
      parameters:
        elements:
          type: array?
          items: ElementHandle
        options:
          type: array?
          items:
            type: object
            properties:
              value: string?
              label: string?
              index: number?
        timeout: number?
        noWaitAfter: boolean?
      returns:
        values:
          type: array
          items: string

    selectText:
      parameters:
        timeout: number?

    setInputFiles:
      parameters:
        files:
          type: array
          items:
            type: object
            properties:
              name: string
              mimeType: string
              buffer: string
        timeout: number?
        noWaitAfter: boolean?

    textContent:
      returns:
        value: string?

    type:
      parameters:
        text: string
        delay: number?
        noWaitAfter: boolean?
        timeout: number?

    uncheck:
      parameters:
        force: boolean?
        noWaitAfter: boolean?
        timeout: number?

    waitForSelector:
      parameters:
        selector: string
        timeout: number?
        state:
          type: enum?
          literals:
          - attached
          - detached
          - visible
          - hidden
      returns:
        element: ElementHandle?


Request:
  type: interface

  initializer:
    frame: Frame
    url: string
    resourceType: string
    method: string
    postData: binary?
    headers:
      type: array
      items:
        type: object
        properties:
          name: string
          value: string
    isNavigationRequest: boolean
    redirectedFrom: Request?

  commands:

    response:
      returns:
        response: Response?



Route:
  type: interface

  initializer:
    request: Request

  commands:

    abort:
      parameters:
        errorCode: string?

    continue:
      parameters:
        method: string?
        headers:
          type: array?
          items:
            type: object
            properties:
              name: string
              value: string
        postData: binary?

    fulfill:
      parameters:
        # default is 200
        status: number?
        headers:
          type: array?
          items:
            type: object
            properties:
              name: string
              value: string
        body: string?
        isBase64: boolean?



Response:
  type: interface

  initializer:
    request: Request
    url: string
    status: number
    statusText: string
    headers:
      type: array
      items:
        type: object
        properties:
          name: string
          value: string

  commands:

    body:
      returns:
        binary: binary

    finished:
      returns:
        error: string?



ConsoleMessage:
  type: interface

  initializer:
    type: string
    text: string
    args:
      type: array
      items: JSHandle
    location:
      type: object
      properties:
        url: string
        lineNumber: number
        columnNumber: number



BindingCall:
  type: interface

  initializer:
    frame: Frame
    name: string
    args:
      type: array
      items: SerializedValue

  commands:

    reject:
      parameters:
        error: SerializedError

    resolve:
      parameters:
        result: SerializedArgument



Dialog:
  type: interface

  initializer:
    type: string
    message: string
    defaultValue: string

  commands:

    accept:
      parameters:
        promptText: string?

    dismiss:



Download:
  type: interface

  initializer:
    url: string
    suggestedFilename: string

  commands:

    path:
      returns:
        value: string?

    saveAs:
      parameters:
        path: string

    failure:
      returns:
        error: string?

    stream:
      returns:
        stream: Stream?

    delete:



Stream:
  type: interface

  commands:

    read:
      parameters:
        size: number?
      returns:
        binary: binary



CDPSession:
  type: interface

  commands:

    send:
      parameters:
        method: string
        params: json?
      returns:
        result: json

    detach:

  events:

    event:
      parameters:
        method: string
        params: json?



Electron:
  type: interface

  commands:

    launch:
      parameters:
        executablePath: string
        args:
          type: array?
          items: string
        cwd: string?
        env:
          type: array?
          items:
            type: object
            properties:
              name: string
              value: string
        handleSIGINT: boolean?
        handleSIGTERM: boolean?
        handleSIGHUP: boolean?
        timeout: number?
      returns:
        electronApplication: ElectronApplication



ElectronApplication:
  type: interface

  commands:

    newBrowserWindow:
      parameters:
        arg: SerializedArgument
      returns:
        page: Page

    evaluateExpression:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        value: SerializedValue

    evaluateExpressionHandle:
      parameters:
        expression: string
        isFunction: boolean
        arg: SerializedArgument
      returns:
        handle: JSHandle

    close:

  events:

    # This event happens once immediately after creation.
    context:
      parameters:
        context: BrowserContext

    close:

    window:
      parameters:
        page: Page
        browserWindow: JSHandle


