Skip to content

Commit

Permalink
chore: Publish pr-feature-high-contrast-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 8, 2025
1 parent 9f37e8f commit 38ff3a2
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 5 deletions.
71 changes: 70 additions & 1 deletion apis/pr-feature-high-contrast-ui/core/Accessibility/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Version Accessibility 1.5.0-feature-high-contrast-ui.0
- [Events](#events)
- [audioDescriptionSettingsChanged](#audiodescriptionsettingschanged)
- [closedCaptionsSettingsChanged](#closedcaptionssettingschanged)
- [highContrastModeChanged](#highcontrastmodechanged)
- [voiceGuidanceSettingsChanged](#voiceguidancesettingschanged)
- [Types](#types)
- [AudioDescriptionSettings](#audiodescriptionsettings-1)
Expand Down Expand Up @@ -494,7 +495,9 @@ Response:

### highContrastMode

Get whether high-contrast UI mode is enabled on the device
The user's preference for a high-contrast UI

To get the value of `highContrastMode` call the method like this:

```typescript
function highContrastMode(): Promise<boolean>
Expand Down Expand Up @@ -554,6 +557,68 @@ Response:

---

To subscribe to notifications when the value changes, call the method like this:

```typescript
function highContrastMode(callback: (value) => boolean): Promise<number>
```

Promise resolution:

```
number
```
#### Examples
High-contrast mode is enabled
JavaScript:
```javascript
import { Accessibility } from '@firebolt-js/sdk'
let listenerId = await highContrastMode((value) => {
console.log(value)
})
console.log(listenerId)
```

Value of `highContrastMode`:

```javascript
true
```

<details markdown="1" >
<summary>JSON-RPC:</summary>
Request:

```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "Accessibility.onHighContrastModeChanged",
"params": {
"listen": true
}
}
```

Response:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
```

</details>

---

### listen

To listen to a specific event pass the event name as the first parameter:
Expand Down Expand Up @@ -886,6 +951,10 @@ See: [audioDescriptionSettings](#audiodescriptionsettings)

See: [closedCaptionsSettings](#closedcaptionssettings)

### highContrastModeChanged

See: [highContrastMode](#highcontrastmode)

### voiceGuidanceSettingsChanged

See: [voiceGuidanceSettings](#voiceguidancesettings)
Expand Down
2 changes: 1 addition & 1 deletion apis/pr-feature-high-contrast-ui/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The schemas are used to generate SDK and Documentation artifacts.

| Uses |
| ---- |
| [Accessibility.highContrastMode](./core/Accessibility/#highcontrastmode) |
| [Accessibility.highContrastMode](./core/Accessibility/#highcontrastmode)<br/>[Accessibility.onHighContrastModeChanged](./core/Accessibility/#highcontrastmodechanged) |


### `xrn:firebolt:capability:accessibility:voiceguidance`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@
},
{
"name": "Accessibility.highContrastMode",
"summary": "Get whether high-contrast UI mode is enabled on the device",
"summary": "The user's preference for a high-contrast UI",
"params": [],
"tags": [
{
"name": "property:readonly"
},
{
"name": "capabilities",
"x-uses": [
Expand Down Expand Up @@ -348,6 +351,64 @@
}
]
},
{
"name": "Accessibility.onHighContrastModeChanged",
"summary": "The user's preference for a high-contrast UI",
"params": [
{
"name": "listen",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"tags": [
{
"name": "subscriber",
"x-subscriber-for": "Accessibility.highContrastMode"
},
{
"name": "event",
"x-alternative": "highContrastMode"
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:highcontrastmode"
]
}
],
"result": {
"name": "highContrastMode",
"summary": "Whether high-contrast mode is enabled",
"schema": {
"anyOf": [
{
"$ref": "#/x-schemas/Types/ListenResponse"
},
{
"type": "boolean"
}
]
}
},
"examples": [
{
"name": "High-contrast mode is enabled",
"params": [
{
"name": "listen",
"value": true
}
],
"result": {
"name": "Default Result",
"value": true
}
}
]
},
{
"name": "Accessibility.onVoiceGuidanceSettingsChanged",
"summary": "Get the user's preferred voice guidance settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,12 @@
},
{
"name": "Accessibility.highContrastMode",
"summary": "Get whether high-contrast UI mode is enabled on the device",
"summary": "The user's preference for a high-contrast UI",
"params": [],
"tags": [
{
"name": "property:readonly"
},
{
"name": "capabilities",
"x-uses": [
Expand Down Expand Up @@ -446,6 +449,64 @@
}
]
},
{
"name": "Accessibility.onHighContrastModeChanged",
"summary": "The user's preference for a high-contrast UI",
"params": [
{
"name": "listen",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"tags": [
{
"name": "subscriber",
"x-subscriber-for": "Accessibility.highContrastMode"
},
{
"name": "event",
"x-alternative": "highContrastMode"
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:highcontrastmode"
]
}
],
"result": {
"name": "highContrastMode",
"summary": "Whether high-contrast mode is enabled",
"schema": {
"anyOf": [
{
"$ref": "#/x-schemas/Types/ListenResponse"
},
{
"type": "boolean"
}
]
}
},
"examples": [
{
"name": "High-contrast mode is enabled",
"params": [
{
"name": "listen",
"value": true
}
],
"result": {
"name": "Default Result",
"value": true
}
}
]
},
{
"name": "Accessibility.onVoiceGuidanceSettingsChanged",
"summary": "Get the user's preferred voice guidance settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1186,9 +1186,12 @@
},
{
"name": "Accessibility.highContrastMode",
"summary": "Get whether high-contrast UI mode is enabled on the device",
"summary": "The user's preference for a high-contrast UI",
"params": [],
"tags": [
{
"name": "property:readonly"
},
{
"name": "capabilities",
"x-uses": [
Expand Down Expand Up @@ -1401,6 +1404,64 @@
}
]
},
{
"name": "Accessibility.onHighContrastModeChanged",
"summary": "The user's preference for a high-contrast UI",
"params": [
{
"name": "listen",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"tags": [
{
"name": "subscriber",
"x-subscriber-for": "Accessibility.highContrastMode"
},
{
"name": "event",
"x-alternative": "highContrastMode"
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:highcontrastmode"
]
}
],
"result": {
"name": "highContrastMode",
"summary": "Whether high-contrast mode is enabled",
"schema": {
"anyOf": [
{
"$ref": "#/x-schemas/Types/ListenResponse"
},
{
"type": "boolean"
}
]
}
},
"examples": [
{
"name": "High-contrast mode is enabled",
"params": [
{
"name": "listen",
"value": true
}
],
"result": {
"name": "Default Result",
"value": true
}
}
]
},
{
"name": "Accessibility.onVoiceGuidanceSettingsChanged",
"summary": "Get the user's preferred voice guidance settings",
Expand Down

0 comments on commit 38ff3a2

Please sign in to comment.