• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "title": "JSON schema for shortcuts.json",
3  "$schema": "http://json-schema.org/draft-07/schema#",
4  "type": "object",
5  "additionalProperties": true,
6  "required": [
7    "shortcuts"
8  ],
9  "propertyNames": {
10    "enum": [
11      "shortcuts"
12    ]
13  },
14  "properties": {
15    "shortcuts": {
16      "description": "Indicates the shortcut information of the application. The value is an array, in which each element represents a shortcut object.",
17      "type": "array",
18      "items": {
19        "type": "object",
20        "propertyNames": {
21          "enum": [
22            "shortcutId",
23            "label",
24            "icon",
25            "visible",
26            "wants"
27          ]
28        },
29        "required": [
30          "shortcutId"
31        ],
32        "properties": {
33          "shortcutId": {
34            "description": "Identifies a shortcut. The value is a string with a maximum of 63 bytes.",
35            "type": "string",
36            "maxLength": 63
37          },
38          "label": {
39            "description": "Indicates the label of the shortcut, that is, the text description displayed by the shortcut. The value can be a string or a resource index to description. A string can contain a maximum of 63 bytes. If the value exceeds 63 bytes, use the resource index.",
40            "type": "string",
41            "maxLength": 255,
42            "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$"
43          },
44          "icon": {
45            "description": "Indicates the icon of the shortcut. The value is the index to the resource file.",
46            "type": "string",
47            "pattern": "^[$]media:"
48          },
49          "visible": {
50            "description": "Whether the shortcut is displayed, true indicates display, false indicates unreality, default indicates display.",
51            "type": "boolean",
52            "default": true
53          },
54          "wants": {
55            "description": "Indicates the wants to which the shortcut points. The attribute consists of the targetClass and targetBundle sub-attributes.",
56            "type": "array",
57            "items": {
58              "type": "object",
59              "propertyNames": {
60                "enum": [
61                  "bundleName",
62                  "moduleName",
63                  "abilityName",
64                  "parameters"
65                ]
66              },
67              "properties": {
68                "bundleName": {
69                  "description": "Indicates the application bundle name for the target ability of the shortcut.",
70                  "type": "string"
71                },
72                "moduleName": {
73                  "description": "Indicates the module name for the target ability of the shortcut.",
74                  "type": "string"
75                },
76                "abilityName": {
77                  "description": "Indicates the class name for the target ability of the shortcut.",
78                  "type": "string"
79                },
80                "parameters": {
81                  "description": "Indicates the parameters for the target ability of the shortcut.",
82                  "type": "object",
83                  "maxProperties": 1024,
84                  "propertyNames": {
85                    "pattern": "^[\\x00-\\x7F]+$",
86                    "maxLength": 1024
87                  },
88                  "additionalProperties": {
89                    "type": "string",
90                    "minLength": 0,
91                    "maxLength": 1024,
92                    "pattern": "^[\\x00-\\x7F]*$"
93                  }
94                }
95              }
96            }
97          }
98        }
99      }
100    }
101  }
102}