{
  "namespace": "tabInstance",
  "types": [
    {
      "id": "tabInstance.Platform",
      "type": "string",
      "enum": [
        "win",
        "mac",
        "linux",
        "cros",
        "android",
        "ios"
      ]
    },
    {
      "id": "tabInstance.DeviceInfo",
      "type": "object",
      "properties": {
        "deviceId": {
          "type": "string"
        },
        "deviceName": {
          "type": "string"
        },
        "platform": {
          "$ref": "tabInstance.Platform"
        },
        "osVersion": {
          "type": "string"
        },
        "browserVersion": {
          "type": "string"
        },
        "tabbitVersion": {
          "type": "string"
        },
        "userAgent": {
          "type": "string"
        },
        "screenResolution": {
          "type": "object",
          "optional": true,
          "properties": {
            "width": {
              "type": "integer"
            },
            "height": {
              "type": "integer"
            }
          }
        },
        "timezone": {
          "type": "string",
          "optional": true
        },
        "language": {
          "type": "string",
          "optional": true
        },
        "cpuCores": {
          "type": "integer",
          "optional": true
        },
        "ramMb": {
          "type": "integer",
          "optional": true
        },
        "isSoftwareRendering": {
          "type": "boolean",
          "optional": true
        },
        "deviceTier": {
          "type": "string",
          "optional": true
        }
      }
    },
    {
      "id": "tabInstance.SwitchConfigWithState",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "currentState": {
          "type": "boolean"
        }
      }
    },
    {
      "id": "tabInstance.DesktopPetDirection",
      "type": "string",
      "enum": [
        "up",
        "down",
        "left",
        "right"
      ]
    },
    {
      "id": "tabInstance.DesktopPetPlayerSize",
      "type": "object",
      "properties": {
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        }
      }
    }
  ],
  "functions": [
    {
      "name": "getDeviceInfo",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "deviceInfo",
            "$ref": "tabInstance.DeviceInfo"
          }
        ]
      }
    },
    {
      "name": "getSwitchConfigsWithState",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "switchConfigs",
            "type": "array",
            "items": {
              "$ref": "tabInstance.SwitchConfigWithState"
            }
          }
        ]
      }
    },
    {
      "name": "isTabTestMode",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "isTestMode",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "getTabHost",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "tabHost",
            "type": "string"
          }
        ]
      }
    },
    {
      "name": "getTabScheme",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "tabScheme",
            "type": "string"
          }
        ]
      }
    },
    {
      "name": "isDefaultBrowser",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "isDefault",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "setAsDefaultBrowser",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "success",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "getAiChatLinkOpenBehavior",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "behavior",
            "type": "integer"
          }
        ]
      }
    },
    {
      "name": "getNewTabShortcutsVisible",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "visible",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "setNewTabShortcutsVisible",
      "type": "function",
      "parameters": [
        {
          "name": "visible",
          "type": "boolean"
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "success",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "getDesktopPetEnabled",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "enabled",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "getDesktopPetPlayerSize",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "size",
            "$ref": "tabInstance.DesktopPetPlayerSize"
          }
        ]
      }
    },
    {
      "name": "setDesktopPetEnabled",
      "type": "function",
      "parameters": [
        {
          "name": "enabled",
          "type": "boolean"
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "success",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "desktopPetGoOut",
      "type": "function",
      "parameters": [
        {
          "name": "request",
          "type": "object",
          "properties": {
            "direction": {
              "$ref": "tabInstance.DesktopPetDirection",
              "optional": true
            },
            "reason": {
              "type": "string",
              "optional": true
            }
          }
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "response",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              }
            }
          }
        ]
      }
    },
    {
      "name": "desktopPetGoHome",
      "type": "function",
      "parameters": [
        {
          "name": "request",
          "type": "object",
          "properties": {
            "direction": {
              "$ref": "tabInstance.DesktopPetDirection",
              "optional": true
            },
            "reason": {
              "type": "string",
              "optional": true
            }
          }
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "response",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              }
            }
          }
        ]
      }
    },
    {
      "name": "createTabAndFocus",
      "type": "function",
      "parameters": [
        {
          "name": "request",
          "type": "object",
          "properties": {
            "url": {
              "type": "string"
            }
          }
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "response",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "tabId": {
                "type": "integer",
                "optional": true
              },
              "windowId": {
                "type": "integer",
                "optional": true
              },
              "errorMessage": {
                "type": "string",
                "optional": true
              }
            }
          }
        ]
      }
    },
    {
      "name": "postMessageToPet",
      "type": "function",
      "parameters": [
        {
          "name": "message",
          "type": "any"
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "response",
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "errorMessage": {
                "type": "string",
                "optional": true
              }
            }
          }
        ]
      }
    }
  ],
  "events": [
    {
      "name": "onSwitchStateChanged",
      "type": "function",
      "parameters": [
        {
          "name": "switchName",
          "type": "string"
        },
        {
          "name": "newState",
          "type": "boolean"
        }
      ]
    },
    {
      "name": "onAiChatLinkOpenBehaviorChanged",
      "type": "function",
      "parameters": [
        {
          "name": "behavior",
          "type": "integer"
        }
      ]
    },
    {
      "name": "onNewTabShortcutsVisibleChanged",
      "type": "function",
      "parameters": [
        {
          "name": "visible",
          "type": "boolean"
        }
      ]
    }
  ]
}