// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // File is generated by scripts/build/code_generator_frontend.py export interface CommandParameter { name: string; type: string; optional: boolean; description: string; typeRef: string|null; } export interface InspectorBackendAPI { registerCommand(command: string, parameters: CommandParameter[], replayArgs: string[], description: string): void; registerEnum(type: string, values: Record): void; registerEvent(event: string, params: string[]): void; registerType(type: string, parameters: CommandParameter[]): void; } export function registerCommands(inspectorBackend: InspectorBackendAPI): void { // Accessibility. inspectorBackend.registerEnum("Accessibility.AXValueType", {Boolean: "boolean", Tristate: "tristate", BooleanOrUndefined: "booleanOrUndefined", Idref: "idref", IdrefList: "idrefList", Integer: "integer", Node: "node", NodeList: "nodeList", Number: "number", String: "string", ComputedString: "computedString", Token: "token", TokenList: "tokenList", DomRelation: "domRelation", Role: "role", InternalRole: "internalRole", ValueUndefined: "valueUndefined"}); inspectorBackend.registerEnum("Accessibility.AXValueSourceType", {Attribute: "attribute", Implicit: "implicit", Style: "style", Contents: "contents", Placeholder: "placeholder", RelatedElement: "relatedElement"}); inspectorBackend.registerEnum("Accessibility.AXValueNativeSourceType", {Description: "description", Figcaption: "figcaption", Label: "label", Labelfor: "labelfor", Labelwrapped: "labelwrapped", Legend: "legend", Rubyannotation: "rubyannotation", Tablecaption: "tablecaption", Title: "title", Other: "other"}); inspectorBackend.registerEnum("Accessibility.AXPropertyName", {Actions: "actions", Busy: "busy", Disabled: "disabled", Editable: "editable", Focusable: "focusable", Focused: "focused", Hidden: "hidden", HiddenRoot: "hiddenRoot", Invalid: "invalid", Keyshortcuts: "keyshortcuts", Settable: "settable", Roledescription: "roledescription", Live: "live", Atomic: "atomic", Relevant: "relevant", Root: "root", Autocomplete: "autocomplete", HasPopup: "hasPopup", Level: "level", Multiselectable: "multiselectable", Orientation: "orientation", Multiline: "multiline", Readonly: "readonly", Required: "required", Valuemin: "valuemin", Valuemax: "valuemax", Valuetext: "valuetext", Checked: "checked", Expanded: "expanded", Modal: "modal", Pressed: "pressed", Selected: "selected", Activedescendant: "activedescendant", Controls: "controls", Describedby: "describedby", Details: "details", Errormessage: "errormessage", Flowto: "flowto", Labelledby: "labelledby", Owns: "owns", Url: "url", ActiveFullscreenElement: "activeFullscreenElement", ActiveModalDialog: "activeModalDialog", ActiveAriaModalDialog: "activeAriaModalDialog", AriaHiddenElement: "ariaHiddenElement", AriaHiddenSubtree: "ariaHiddenSubtree", EmptyAlt: "emptyAlt", EmptyText: "emptyText", InertElement: "inertElement", InertSubtree: "inertSubtree", LabelContainer: "labelContainer", LabelFor: "labelFor", NotRendered: "notRendered", NotVisible: "notVisible", PresentationalRole: "presentationalRole", ProbablyPresentational: "probablyPresentational", InactiveCarouselTabContent: "inactiveCarouselTabContent", Uninteresting: "uninteresting"}); inspectorBackend.registerEvent("Accessibility.loadComplete", ["root"]); inspectorBackend.registerEvent("Accessibility.nodesUpdated", ["nodes"]); inspectorBackend.registerCommand("Accessibility.disable", [], [], "Disables the accessibility domain."); inspectorBackend.registerCommand("Accessibility.enable", [], [], "Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls. This turns on accessibility for the page, which can impact performance until accessibility is disabled."); inspectorBackend.registerCommand("Accessibility.getPartialAXTree", [{"name": "nodeId", "type": "number", "optional": true, "description": "Identifier of the node to get the partial accessibility tree for.", "typeRef": "DOM.NodeId"}, {"name": "backendNodeId", "type": "number", "optional": true, "description": "Identifier of the backend node to get the partial accessibility tree for.", "typeRef": "DOM.BackendNodeId"}, {"name": "objectId", "type": "string", "optional": true, "description": "JavaScript object id of the node wrapper to get the partial accessibility tree for.", "typeRef": "Runtime.RemoteObjectId"}, {"name": "fetchRelatives", "type": "boolean", "optional": true, "description": "Whether to fetch this node's ancestors, siblings and children. Defaults to true.", "typeRef": null}], ["nodes"], "Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists."); inspectorBackend.registerCommand("Accessibility.getFullAXTree", [{"name": "depth", "type": "number", "optional": true, "description": "The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.", "typeRef": null}, {"name": "frameId", "type": "string", "optional": true, "description": "The frame for whose document the AX tree should be retrieved. If omitted, the root frame is used.", "typeRef": "Page.FrameId"}], ["nodes"], "Fetches the entire accessibility tree for the root Document"); inspectorBackend.registerCommand("Accessibility.getRootAXNode", [{"name": "frameId", "type": "string", "optional": true, "description": "The frame in whose document the node resides. If omitted, the root frame is used.", "typeRef": "Page.FrameId"}], ["node"], "Fetches the root node. Requires `enable()` to have been called previously."); inspectorBackend.registerCommand("Accessibility.getAXNodeAndAncestors", [{"name": "nodeId", "type": "number", "optional": true, "description": "Identifier of the node to get.", "typeRef": "DOM.NodeId"}, {"name": "backendNodeId", "type": "number", "optional": true, "description": "Identifier of the backend node to get.", "typeRef": "DOM.BackendNodeId"}, {"name": "objectId", "type": "string", "optional": true, "description": "JavaScript object id of the node wrapper to get.", "typeRef": "Runtime.RemoteObjectId"}], ["nodes"], "Fetches a node and all ancestors up to and including the root. Requires `enable()` to have been called previously."); inspectorBackend.registerCommand("Accessibility.getChildAXNodes", [{"name": "id", "type": "string", "optional": false, "description": "", "typeRef": "Accessibility.AXNodeId"}, {"name": "frameId", "type": "string", "optional": true, "description": "The frame in whose document the node resides. If omitted, the root frame is used.", "typeRef": "Page.FrameId"}], ["nodes"], "Fetches a particular accessibility node by AXNodeId. Requires `enable()` to have been called previously."); inspectorBackend.registerCommand("Accessibility.queryAXTree", [{"name": "nodeId", "type": "number", "optional": true, "description": "Identifier of the node for the root to query.", "typeRef": "DOM.NodeId"}, {"name": "backendNodeId", "type": "number", "optional": true, "description": "Identifier of the backend node for the root to query.", "typeRef": "DOM.BackendNodeId"}, {"name": "objectId", "type": "string", "optional": true, "description": "JavaScript object id of the node wrapper for the root to query.", "typeRef": "Runtime.RemoteObjectId"}, {"name": "accessibleName", "type": "string", "optional": true, "description": "Find nodes with this computed name.", "typeRef": null}, {"name": "role", "type": "string", "optional": true, "description": "Find nodes with this computed role.", "typeRef": null}], ["nodes"], "Query a DOM node's accessibility subtree for accessible name and role. This command computes the name and role for all nodes in the subtree, including those that are ignored for accessibility, and returns those that match the specified name and role. If no DOM node is specified, or the DOM node does not exist, the command returns an error. If neither `accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree."); inspectorBackend.registerType("Accessibility.AXValueSource", [{"name": "type", "type": "string", "optional": false, "description": "What type of source this is.", "typeRef": "Accessibility.AXValueSourceType"}, {"name": "value", "type": "object", "optional": true, "description": "The value of this property source.", "typeRef": "Accessibility.AXValue"}, {"name": "attribute", "type": "string", "optional": true, "description": "The name of the relevant attribute, if any.", "typeRef": null}, {"name": "attributeValue", "type": "object", "optional": true, "description": "The value of the relevant attribute, if any.", "typeRef": "Accessibility.AXValue"}, {"name": "superseded", "type": "boolean", "optional": true, "description": "Whether this source is superseded by a higher priority source.", "typeRef": null}, {"name": "nativeSource", "type": "string", "optional": true, "description": "The native markup source for this value, e.g. a `