blob: 97237677a78d66329655cba32086e9f2eb2f2328 [file] [log] [blame]
[
{
"namespace": "enums",
"description": "The enums API.",
"types": [
{
"id": "Enumeration",
"type": "string",
"enum": ["one", "two", "three"]
},
{
"id": "OtherEnumeration",
"type": "string",
"enum": ["spam", "ham", "eggs"]
},
{
"id": "EnumType",
"type": "object",
"properties": {
"type": {
"$ref": "Enumeration"
}
}
},
{
"id": "HasEnumeration",
"type": "object",
"properties": {
"enumeration": {
"$ref": "Enumeration"
},
"optional_enumeration": {
"$ref": "Enumeration",
"optional": true
}
}
},
{
"id": "ReferenceEnum",
"type": "object",
"properties": {
"reference_enum": {
"$ref": "Enumeration"
}
}
},
{
"id": "OptionalEnumType",
"type": "object",
"properties": {
"type": {
"$ref": "Enumeration",
"optional": true
}
}
}
],
"functions": [
{
"name": "takesEnum",
"type": "function",
"description": "Takes an enum as its parameter.",
"parameters": [
{
"name": "state",
"$ref": "Enumeration"
},
{
"name": "callback",
"type": "function",
"parameters": []
}
]
},
{
"name": "takesEnumArray",
"type": "function",
"description": "Takes an enum array as its parameter.",
"parameters": [
{
"name": "values",
"type": "array",
"items": {
"$ref": "Enumeration"
}
},
{
"name": "callback",
"type": "function",
"parameters": []
}
]
},
{
"name": "takesEnumAsType",
"type": "function",
"description": "Takes an enum type as its parameter.",
"parameters": [
{
"name": "enumeration",
"$ref": "Enumeration"
},
{
"name": "callback",
"type": "function",
"parameters": []
}
]
},
{
"name": "takesEnumArrayAsType",
"type": "function",
"description": "Takes an enum type array as its parameter.",
"parameters": [
{
"name": "values",
"type": "array",
"items": {
"$ref": "Enumeration"
}
},
{
"name": "callback",
"type": "function",
"parameters": []
}
]
},
{
"name": "returnsEnum",
"type": "function",
"description": "Returns an enum through the callback",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "state",
"$ref": "Enumeration"
}
]
}
]
},
{
"name": "returnsEnumAsType",
"type": "function",
"description": "Returns an enum through the callback",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "enumeration",
"$ref": "Enumeration"
}
]
}
]
},
{
"name": "returnsTwoEnums",
"type": "function",
"description": "Returns two enums through the callback",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "firstState",
"$ref": "Enumeration"
},
{
"name": "secondState",
"$ref": "OtherEnumeration"
}
]
}
]
},
{
"name": "takesOptionalEnum",
"type": "function",
"description": "Takes an enum as its parameter.",
"parameters": [
{
"name": "state",
"$ref": "Enumeration",
"optional": true
},
{
"name": "callback",
"type": "function",
"parameters": []
}
]
},
{
"name": "takesMultipleOptionalEnums",
"type": "function",
"description": "Takes two enums as parameters.",
"parameters": [
{
"name": "state",
"$ref": "Enumeration",
"optional": true
},
{
"name": "type",
"$ref": "OtherEnumeration",
"optional": true
},
{
"name": "callback",
"type": "function",
"parameters": []
}
]
}
],
"events": [
{
"name": "onEnumFired",
"type": "function",
"description": "Fired when an enum is ready.",
"parameters": [
{
"name": "someEnum",
"$ref": "Enumeration"
}
]
},
{
"name": "onTwoEnumsFired",
"type": "function",
"description": "Fired when two enums are ready.",
"parameters": [
{
"name": "firstEnum",
"$ref": "Enumeration"
},
{
"name": "secondEnum",
"$ref": "OtherEnumeration"
}
]
}
]
}
]