docs: add docs for `android.features`/`android.permissions` (#2077)
This commit is contained in:
Родитель
69ba7be013
Коммит
60c4e92e4b
|
@ -0,0 +1,38 @@
|
|||
Declares hardware or software features that is used by the application.
|
||||
|
||||
Equivalent to
|
||||
[`<uses-feature>`](https://developer.android.com/guide/topics/manifest/uses-feature-element).
|
||||
|
||||
Example:
|
||||
|
||||
```xml
|
||||
<uses-feature android:name="android.hardware.camera.any" />
|
||||
<uses-feature android:glEsVersion="0x00030002"
|
||||
android:required="true" />
|
||||
```
|
||||
|
||||
becomes
|
||||
|
||||
```json
|
||||
{
|
||||
"android": {
|
||||
"features": [
|
||||
{
|
||||
"android:name": "android.hardware.camera.any"
|
||||
},
|
||||
{
|
||||
"android:glEsVersion": "0x00030002",
|
||||
"android:required": "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>History</summary>
|
||||
|
||||
- [[3.8.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.8.0)]
|
||||
Added
|
||||
|
||||
</details>
|
|
@ -0,0 +1,36 @@
|
|||
Specifies system permissions that the user must grant for the app to operate
|
||||
correctly.
|
||||
|
||||
Equivalent to
|
||||
[`<uses-permission>`](https://developer.android.com/guide/topics/manifest/uses-permission-element).
|
||||
|
||||
Example:
|
||||
|
||||
```xml
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="18" />
|
||||
```
|
||||
|
||||
becomes
|
||||
|
||||
```json
|
||||
{
|
||||
"android": {
|
||||
"permissions": [
|
||||
{
|
||||
"android:name": "android.permission.WRITE_EXTERNAL_STORAGE",
|
||||
"android:maxSdkVersion": "18"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>History</summary>
|
||||
|
||||
- [[3.8.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.8.0)]
|
||||
Added
|
||||
|
||||
</details>
|
38
schema.json
38
schema.json
|
@ -283,6 +283,44 @@
|
|||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"description": "Declares hardware or software features that is used by the application.",
|
||||
"markdownDescription": "Declares hardware or software features that is used by the application.\n\nEquivalent to\n[`<uses-feature>`](https://developer.android.com/guide/topics/manifest/uses-feature-element).\n\nExample:\n\n```xml\n<uses-feature android:name=\"android.hardware.camera.any\" />\n<uses-feature android:glEsVersion=\"0x00030002\"\n android:required=\"true\" />\n```\n\nbecomes\n\n```json\n{\n \"android\": {\n \"features\": [\n {\n \"android:name\": \"android.hardware.camera.any\"\n },\n {\n \"android:glEsVersion\": \"0x00030002\",\n \"android:required\": \"true\"\n }\n ]\n }\n}\n```\n\n<details>\n<summary>History</summary>\n\n- [[3.8.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.8.0)]\n Added\n\n</details>",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"android:name": {
|
||||
"type": "string"
|
||||
},
|
||||
"android:glEsVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"android:required": {
|
||||
"enum": [
|
||||
"true",
|
||||
"false"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"permissions": {
|
||||
"description": "Specifies system permissions that the user must grant for the app to operate correctly.",
|
||||
"markdownDescription": "Specifies system permissions that the user must grant for the app to operate\ncorrectly.\n\nEquivalent to\n[`<uses-permission>`](https://developer.android.com/guide/topics/manifest/uses-permission-element).\n\nExample:\n\n```xml\n<uses-permission\n android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"\n android:maxSdkVersion=\"18\" />\n```\n\nbecomes\n\n```json\n{\n \"android\": {\n \"permissions\": [\n {\n \"android:name\": \"android.permission.WRITE_EXTERNAL_STORAGE\",\n \"android:maxSdkVersion\": \"18\"\n }\n ]\n }\n}\n```\n\n<details>\n<summary>History</summary>\n\n- [[3.8.0](https://github.com/microsoft/react-native-test-app/releases/tag/3.8.0)]\n Added\n\n</details>",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"android:name": {
|
||||
"type": "string"
|
||||
},
|
||||
"android:maxSdkVersion": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@ const stripCarriageReturn =
|
|||
export async function readDocumentation() {
|
||||
/** @type {Partial<Docs>} */
|
||||
const docs = {};
|
||||
const docsDir = fileURLToPath(new URL("docs", import.meta.url));
|
||||
const docsDir = fileURLToPath(new URL("../docs", import.meta.url));
|
||||
|
||||
/** @type {(keyof Docs)[]} */
|
||||
const keys = [
|
||||
|
@ -28,8 +28,10 @@ export async function readDocumentation() {
|
|||
"resources",
|
||||
"singleApp",
|
||||
"version",
|
||||
"android.features",
|
||||
"android.icons",
|
||||
"android.package",
|
||||
"android.permissions",
|
||||
"android.signingConfigs",
|
||||
"android.versionCode",
|
||||
"ios.buildNumber",
|
||||
|
|
|
@ -269,6 +269,31 @@ export function generateSchema(docs = {}) {
|
|||
},
|
||||
},
|
||||
},
|
||||
features: {
|
||||
description: extractBrief(docs["android.features"]),
|
||||
markdownDescription: docs["android.features"],
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
"android:name": { type: "string" },
|
||||
"android:glEsVersion": { type: "string" },
|
||||
"android:required": { enum: ["true", "false"] },
|
||||
},
|
||||
},
|
||||
},
|
||||
permissions: {
|
||||
description: extractBrief(docs["android.permissions"]),
|
||||
markdownDescription: docs["android.permissions"],
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
"android:name": { type: "string" },
|
||||
"android:maxSdkVersion": { type: "string" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ios: {
|
||||
|
|
|
@ -234,8 +234,10 @@ export type Docs = {
|
|||
resources: string;
|
||||
singleApp: string;
|
||||
version: string;
|
||||
"android.features": string;
|
||||
"android.icons": string;
|
||||
"android.package": string;
|
||||
"android.permissions": string;
|
||||
"android.signingConfigs": string;
|
||||
"android.versionCode": string;
|
||||
"ios.buildNumber": string;
|
||||
|
|
Загрузка…
Ссылка в новой задаче