{
  "namespace": "tabGroupsExt",
  "types": [
    {
      "id": "tabGroupsExt.ThumbnailFormat",
      "type": "string",
      "enum": [
        {
          "name": "png"
        },
        {
          "name": "jpeg"
        }
      ]
    },
    {
      "id": "tabGroupsExt.ThumbnailErrorCode",
      "type": "string",
      "enum": [
        {
          "name": "TAB_NOT_FOUND"
        },
        {
          "name": "TAB_NOT_VISIBLE"
        },
        {
          "name": "CAPTURE_FAILED"
        },
        {
          "name": "ENCODING_FAILED"
        },
        {
          "name": "PERMISSION_DENIED"
        },
        {
          "name": "OPERATION_FAILED"
        }
      ]
    },
    {
      "id": "tabGroupsExt.ThumbnailOptions",
      "type": "object",
      "properties": {
        "format": {
          "$ref": "tabGroupsExt.ThumbnailFormat",
          "optional": true
        },
        "quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "optional": true
        },
        "maxWidth": {
          "type": "integer",
          "minimum": 16,
          "maximum": 4096,
          "optional": true
        },
        "maxHeight": {
          "type": "integer",
          "minimum": 16,
          "maximum": 4096,
          "optional": true
        }
      }
    },
    {
      "id": "tabGroupsExt.TabThumbnail",
      "type": "object",
      "properties": {
        "tabId": {
          "type": "integer"
        },
        "dataUrl": {
          "type": "string"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "timestamp": {
          "type": "number"
        }
      }
    },
    {
      "id": "tabGroupsExt.ThumbnailError",
      "type": "object",
      "properties": {
        "code": {
          "$ref": "tabGroupsExt.ThumbnailErrorCode"
        },
        "message": {
          "type": "string"
        }
      }
    },
    {
      "id": "tabGroupsExt.ThumbnailResult",
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "thumbnail": {
          "$ref": "tabGroupsExt.TabThumbnail",
          "optional": true
        },
        "error": {
          "$ref": "tabGroupsExt.ThumbnailError",
          "optional": true
        }
      }
    },
    {
      "id": "tabGroupsExt.TabGroupPinnedResult",
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "pinned": {
          "type": "boolean",
          "optional": true
        },
        "error": {
          "$ref": "tabGroupsExt.ThumbnailError",
          "optional": true
        }
      }
    },
    {
      "id": "tabGroupsExt.GroupIdConversionResult",
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "extensionGroupId": {
          "type": "integer",
          "optional": true
        },
        "error": {
          "$ref": "tabGroupsExt.ThumbnailError",
          "optional": true
        }
      }
    }
  ],
  "functions": [
    {
      "name": "getThumbnail",
      "type": "function",
      "parameters": [
        {
          "name": "tabId",
          "type": "integer",
          "minimum": 0
        },
        {
          "name": "options",
          "$ref": "tabGroupsExt.ThumbnailOptions",
          "optional": true
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabGroupsExt.ThumbnailResult"
          }
        ]
      }
    },
    {
      "name": "captureThumbnail",
      "type": "function",
      "parameters": [
        {
          "name": "tabId",
          "type": "integer",
          "minimum": 0
        },
        {
          "name": "options",
          "$ref": "tabGroupsExt.ThumbnailOptions",
          "optional": true
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabGroupsExt.ThumbnailResult"
          }
        ]
      }
    },
    {
      "name": "clearThumbnailCache",
      "type": "function",
      "parameters": [
        {
          "name": "tabId",
          "type": "integer",
          "minimum": 0,
          "optional": true
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "success",
            "type": "boolean"
          }
        ]
      }
    },
    {
      "name": "setTabGroupPinned",
      "type": "function",
      "parameters": [
        {
          "name": "nativeGroupId",
          "type": "string"
        },
        {
          "name": "pinned",
          "type": "boolean"
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabGroupsExt.TabGroupPinnedResult"
          }
        ]
      }
    },
    {
      "name": "isTabGroupPinned",
      "type": "function",
      "parameters": [
        {
          "name": "nativeGroupId",
          "type": "string"
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabGroupsExt.TabGroupPinnedResult"
          }
        ]
      }
    },
    {
      "name": "convertNativeGroupId",
      "type": "function",
      "parameters": [
        {
          "name": "nativeGroupId",
          "type": "string"
        }
      ],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabGroupsExt.GroupIdConversionResult"
          }
        ]
      }
    }
  ],
  "events": [
    {
      "name": "onThumbnailUpdated",
      "type": "function",
      "parameters": [
        {
          "name": "tabId",
          "type": "integer",
          "minimum": 0
        },
        {
          "name": "thumbnail",
          "$ref": "tabGroupsExt.TabThumbnail"
        }
      ]
    },
    {
      "name": "onSaveToFavorites",
      "type": "function",
      "parameters": [
        {
          "name": "request",
          "type": "object",
          "properties": {
            "groupName": {
              "type": "string"
            },
            "tabs": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      ]
    }
  ]
}