babylonjs-accessibility 7.15.2 → 7.16.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,28 +1,64 @@
|
|
1
1
|
|
2
2
|
declare module BABYLON.Accessibility {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
/**
|
8
|
+
* The scene tree of the HTML twin. It contain all the top level nodes
|
9
|
+
* @param props
|
10
|
+
* @returns
|
11
|
+
*/
|
12
|
+
export function HTMLTwinSceneTree(props: {
|
13
|
+
scene: BABYLON.Scene;
|
14
|
+
options: IHTMLTwinRendererOptions;
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
16
|
+
|
17
|
+
|
18
|
+
/// <reference types="react" />
|
19
|
+
/**
|
20
|
+
* Context used to update a scene when an entity is added or removed from the accessibility tree.
|
21
|
+
*/
|
22
|
+
export interface ISceneContext {
|
23
|
+
updateScene: () => void;
|
7
24
|
}
|
8
|
-
export
|
25
|
+
export var SceneContext: import("react").Context<ISceneContext>;
|
9
26
|
|
10
27
|
|
11
28
|
/**
|
12
|
-
*
|
29
|
+
* Options for the HTMLTwinRenderer.
|
13
30
|
*/
|
14
|
-
export
|
31
|
+
export interface IHTMLTwinRendererOptions {
|
15
32
|
/**
|
16
|
-
*
|
33
|
+
* If this is true, all GUI controls will be added to the twin tree, regardless if they have
|
34
|
+
* a defined accessibility tag or not. If it's false, only controls with an accessibility tag
|
35
|
+
* will be added. True by default.
|
17
36
|
*/
|
18
|
-
|
19
|
-
|
37
|
+
addAllControls: boolean;
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* This class is the main entry point for the HTML twin renderer. To render a twin for a scene,
|
41
|
+
* simply call HTMLTwinRenderer.Render(scene).
|
42
|
+
*/
|
43
|
+
export class HTMLTwinRenderer {
|
20
44
|
/**
|
21
|
-
*
|
22
|
-
* @param
|
23
|
-
* @
|
45
|
+
* Render the HTML twin for the given scene.
|
46
|
+
* @param scene the scene to render the twin for
|
47
|
+
* @param options options for the renderer
|
24
48
|
*/
|
25
|
-
|
49
|
+
static Render(scene: BABYLON.Scene, options?: IHTMLTwinRendererOptions): void;
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
/**
|
54
|
+
* A abstract layer to store the html twin tree structure. It is constructed from the BabylonJS scene entities that need to be accessible. It informs the parent-children relationship of html twin tree, and informs how to render: description, isActionable, onclick/onrightclick/onfocus/onblur.
|
55
|
+
*/
|
56
|
+
export class HTMLTwinNodeItem extends HTMLTwinItem {
|
57
|
+
/**
|
58
|
+
* The corresponding BabylonJS entity. Can be a BABYLON.Node or a Control.
|
59
|
+
*/
|
60
|
+
entity: BABYLON.Node;
|
61
|
+
constructor(entity: BABYLON.Node, scene: BABYLON.Scene);
|
26
62
|
/**
|
27
63
|
* If this entity is actionable (can be clicked).
|
28
64
|
*/
|
@@ -45,21 +81,21 @@ declare module BABYLON.Accessibility {
|
|
45
81
|
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
46
82
|
*/
|
47
83
|
triggerEvent(eventType: string): void;
|
84
|
+
private _getTriggerActions;
|
48
85
|
}
|
49
86
|
|
50
87
|
|
51
|
-
|
88
|
+
/**
|
89
|
+
* An adapter that transforms a Accessible entity in a React element. Contains observables for the events that can
|
90
|
+
* change the state of the entity or the accesible tree.
|
91
|
+
* @param props the props of the adapter
|
92
|
+
* @returns
|
93
|
+
*/
|
94
|
+
export function HTMLTwinItemAdapter(props: {
|
95
|
+
node: AccessibilityEntity;
|
52
96
|
scene: BABYLON.Scene;
|
53
|
-
options
|
54
|
-
}
|
55
|
-
interface IHTMLTwinHostComponentState {
|
56
|
-
a11yTreeItems: HTMLTwinItem[];
|
57
|
-
}
|
58
|
-
export class HTMLTwinHostComponent extends React.Component<IHTMLTwinHostComponentProps, IHTMLTwinHostComponentState> {
|
59
|
-
private _options;
|
60
|
-
constructor(props: IHTMLTwinHostComponentProps);
|
61
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
62
|
-
}
|
97
|
+
options: IHTMLTwinRendererOptions;
|
98
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
63
99
|
|
64
100
|
|
65
101
|
/**
|
@@ -140,28 +176,35 @@ declare module BABYLON.Accessibility {
|
|
140
176
|
}
|
141
177
|
|
142
178
|
|
143
|
-
|
144
|
-
* An adapter that transforms a Accessible entity in a React element. Contains observables for the events that can
|
145
|
-
* change the state of the entity or the accesible tree.
|
146
|
-
* @param props the props of the adapter
|
147
|
-
* @returns
|
148
|
-
*/
|
149
|
-
export function HTMLTwinItemAdapter(props: {
|
150
|
-
node: AccessibilityEntity;
|
179
|
+
interface IHTMLTwinHostComponentProps {
|
151
180
|
scene: BABYLON.Scene;
|
152
|
-
options
|
153
|
-
}
|
181
|
+
options?: IHTMLTwinRendererOptions;
|
182
|
+
}
|
183
|
+
interface IHTMLTwinHostComponentState {
|
184
|
+
a11yTreeItems: HTMLTwinItem[];
|
185
|
+
}
|
186
|
+
export class HTMLTwinHostComponent extends React.Component<IHTMLTwinHostComponentProps, IHTMLTwinHostComponentState> {
|
187
|
+
private _options;
|
188
|
+
constructor(props: IHTMLTwinHostComponentProps);
|
189
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
190
|
+
}
|
154
191
|
|
155
192
|
|
156
193
|
/**
|
157
194
|
* A abstract layer to store the html twin tree structure. It is constructed from the BabylonJS scene entities that need to be accessible. It informs the parent-children relationship of html twin tree, and informs how to render: description, isActionable, onclick/onrightclick/onfocus/onblur.
|
158
195
|
*/
|
159
|
-
export class
|
196
|
+
export class HTMLTwinGUIItem extends HTMLTwinItem {
|
160
197
|
/**
|
161
|
-
* The corresponding BabylonJS entity. Can be a
|
198
|
+
* The corresponding BabylonJS entity. Can be a Node or a BABYLON.GUI.Control.
|
162
199
|
*/
|
163
|
-
entity: BABYLON.
|
164
|
-
constructor(entity: BABYLON.
|
200
|
+
entity: BABYLON.GUI.Control;
|
201
|
+
constructor(entity: BABYLON.GUI.Control, scene: BABYLON.Scene);
|
202
|
+
/**
|
203
|
+
* The text content displayed in HTML element.
|
204
|
+
* @param options - Options to render HTML twin tree where this element is contained.
|
205
|
+
* @returns The text content displayed in HTML element.
|
206
|
+
*/
|
207
|
+
getDescription(options: IHTMLTwinRendererOptions): string;
|
165
208
|
/**
|
166
209
|
* If this entity is actionable (can be clicked).
|
167
210
|
*/
|
@@ -184,58 +227,15 @@ declare module BABYLON.Accessibility {
|
|
184
227
|
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
185
228
|
*/
|
186
229
|
triggerEvent(eventType: string): void;
|
187
|
-
private _getTriggerActions;
|
188
230
|
}
|
189
231
|
|
190
232
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
/**
|
196
|
-
* If this is true, all GUI controls will be added to the twin tree, regardless if they have
|
197
|
-
* a defined accessibility tag or not. If it's false, only controls with an accessibility tag
|
198
|
-
* will be added. True by default.
|
199
|
-
*/
|
200
|
-
addAllControls: boolean;
|
201
|
-
}
|
202
|
-
/**
|
203
|
-
* This class is the main entry point for the HTML twin renderer. To render a twin for a scene,
|
204
|
-
* simply call HTMLTwinRenderer.Render(scene).
|
205
|
-
*/
|
206
|
-
export class HTMLTwinRenderer {
|
207
|
-
/**
|
208
|
-
* Render the HTML twin for the given scene.
|
209
|
-
* @param scene the scene to render the twin for
|
210
|
-
* @param options options for the renderer
|
211
|
-
*/
|
212
|
-
static Render(scene: BABYLON.Scene, options?: IHTMLTwinRendererOptions): void;
|
213
|
-
}
|
214
|
-
|
215
|
-
|
216
|
-
/// <reference types="react" />
|
217
|
-
/**
|
218
|
-
* Context used to update a scene when an entity is added or removed from the accessibility tree.
|
219
|
-
*/
|
220
|
-
export interface ISceneContext {
|
221
|
-
updateScene: () => void;
|
233
|
+
export interface IHTMLTwinItemComponentProps {
|
234
|
+
description: string | undefined;
|
235
|
+
children: React.ReactElement[];
|
236
|
+
a11yItem: HTMLTwinItem;
|
222
237
|
}
|
223
|
-
export
|
224
|
-
|
225
|
-
|
226
|
-
/**
|
227
|
-
* The scene tree of the HTML twin. It contain all the top level nodes
|
228
|
-
* @param props
|
229
|
-
* @returns
|
230
|
-
*/
|
231
|
-
export function HTMLTwinSceneTree(props: {
|
232
|
-
scene: BABYLON.Scene;
|
233
|
-
options: IHTMLTwinRendererOptions;
|
234
|
-
}): import("react/jsx-runtime").JSX.Element;
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
238
|
+
export function HTMLTwinAccessibilityItem(props: IHTMLTwinItemComponentProps): import("react/jsx-runtime").JSX.Element;
|
239
239
|
|
240
240
|
|
241
241
|
|