Some parameters contain properties that have choices. Meaning they can be multiple object types or objects of multiple types.
{
"name": "setIcon",
"type": "function",
"description": "Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"imageData": {
"choices": [
{ "\$ref": "ImageDataType" },
{
"type": "object",
"properties": {
"19": {"\$ref": "ImageDataType", "optional": true},
"38": {"\$ref": "ImageDataType", "optional": true}
}
}
],
"optional": true,
"description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
},
"path": {
"choices": [
{ "type": "string" },
{
"type": "object",
"properties": {
"19": {"type": "string", "optional": true},
"38": {"type": "string", "optional": true}
}
}
],
"optional": true,
"description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
},
"tabId": {
"type": "integer",
"optional": true,
"description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
}
Other json idl also contain this structure.
bookmarks.json: "choices": [
browser_action.json: "choices": [
browser_action.json: "choices": [
browser_action.json: "choices": [
context_menus.json: "choices": [
context_menus.json: "choices": [
context_menus.json: "choices": [
context_menus.json: "choices": [
context_menus.json: "choices": [
context_menus.json: "choices": [
context_menus.json: "choices": [
declarative_web_request.json: "choices": [
declarative_web_request.json: "choices": [
grep: devtools: Is a directory
events.json: "choices": [
experimental_accessibility.json: "choices": [
idltest.idl: // we might be able to do is have a 'choices' list including all the
page_action.json: "choices": [
page_action.json: "choices": [
processes.json: "choices": [
storage.json: "choices": [
storage.json: "choices": [
storage.json: "choices": [
tabs.json: "choices": [
tabs.json: "choices": [
tabs.json: "choices": [
tabs.json: "choices": [
test.json: "choices": [
test.json: "choices": [
test.json: "choices": [
test.json: {"choices": [ {"type": "string"}, {"type": "object", "isInstanceOf": "RegExp"} ], "name": "message", "optional": true}
windows.json: "choices": [
Solution for handling this is still in discussion.