{
  "namespace": "tabSignin",
  "types": [
    {
      "id": "tabSignin.NativeLoginState",
      "type": "string",
      "enum": [
        "loggedOut",
        "loggedIn",
        "sessionExpired"
      ]
    },
    {
      "id": "tabSignin.LoginState",
      "type": "object",
      "properties": {
        "isLoggedIn": {
          "type": "boolean"
        },
        "hasToken": {
          "type": "boolean"
        }
      }
    },
    {
      "id": "tabSignin.TokenInfo",
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "optional": true
        },
        "expirationTime": {
          "type": "number",
          "optional": true
        }
      }
    },
    {
      "id": "tabSignin.TokenResult",
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "tokenInfo": {
          "$ref": "tabSignin.TokenInfo",
          "optional": true
        }
      }
    },
    {
      "id": "tabSignin.UserInfo",
      "type": "object",
      "properties": {
        "userId": {
          "type": "string",
          "optional": true
        },
        "displayName": {
          "type": "string",
          "optional": true
        },
        "avatarUrl": {
          "type": "string",
          "optional": true
        }
      }
    },
    {
      "id": "tabSignin.UserInfoResult",
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "userInfo": {
          "$ref": "tabSignin.UserInfo",
          "optional": true
        },
        "errorMessage": {
          "type": "string",
          "optional": true
        }
      }
    },
    {
      "id": "tabSignin.PrimaryAccountInfo",
      "type": "object",
      "properties": {
        "hasPrimaryAccount": {
          "type": "boolean"
        },
        "userId": {
          "type": "string",
          "optional": true
        }
      }
    },
    {
      "id": "tabSignin.PrimaryAccountInfoResult",
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "accountInfo": {
          "$ref": "tabSignin.PrimaryAccountInfo",
          "optional": true
        },
        "errorMessage": {
          "type": "string",
          "optional": true
        }
      }
    }
  ],
  "functions": [
    {
      "name": "getToken",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabSignin.TokenResult"
          }
        ]
      }
    },
    {
      "name": "getLoginState",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "loginState",
            "$ref": "tabSignin.LoginState"
          }
        ]
      }
    },
    {
      "name": "getNativeLoginState",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "state",
            "$ref": "tabSignin.NativeLoginState"
          }
        ]
      }
    },
    {
      "name": "getUserInfo",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabSignin.UserInfoResult"
          }
        ]
      }
    },
    {
      "name": "getPrimaryAccountInfo",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "result",
            "$ref": "tabSignin.PrimaryAccountInfoResult"
          }
        ]
      }
    },
    {
      "name": "logout",
      "type": "function",
      "parameters": [],
      "returns_async": {
        "name": "callback",
        "parameters": [
          {
            "name": "success",
            "type": "boolean"
          }
        ]
      }
    }
  ],
  "events": [
    {
      "name": "onLoginStateChanged",
      "type": "function",
      "parameters": [
        {
          "name": "loginState",
          "$ref": "tabSignin.LoginState"
        }
      ]
    }
  ]
}