@m2c2kit/addons 0.1.10 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +409 -222
  2. package/dist/index.js +1234 -1
  3. package/package.json +11 -13
package/dist/index.d.ts CHANGED
@@ -1,232 +1,419 @@
1
1
  import { Canvas } from 'canvaskit-wasm';
2
- import { CompositeOptions, Size, RgbaColor, Composite, Entity, GlobalVariables, TextOptions, IText, StoryOptions, Transition, Story, Scene, LabelHorizontalAlignmentMode } from '@m2c2kit/core';
2
+ import { CompositeOptions, Size, RgbaColor, Composite, Entity, GlobalVariables, TextOptions, IText, EntityEvent, Shape, LabelHorizontalAlignmentMode, Transition, StoryOptions, Story, Scene } from '@m2c2kit/core';
3
3
 
4
- interface GridOptions extends CompositeOptions {
5
- /** Number of rows in the grid. Must be 1 or greater */
6
- rows: number;
7
- /** Number of columns in the grid. Must be 1 or greater */
8
- columns: number;
9
- /** Size of the grid in pixels */
10
- size: Size;
11
- /** Background color of the grid. Default is a transparent gray */
12
- backgroundColor?: RgbaColor;
13
- /** Width of the grid lines. Default is 1 */
14
- gridLineWidth?: number;
15
- /** Color of the grid lines. Default is red */
16
- gridLineColor?: RgbaColor;
17
- }
18
- interface GridChild {
19
- entity: Entity;
20
- row: number;
21
- column: number;
22
- }
23
- declare class Grid extends Composite {
24
- compositeType: string;
25
- rows: number;
26
- columns: number;
27
- gridBackgroundColor: RgbaColor;
28
- gridLineColor: RgbaColor;
29
- gridLineWidth: number;
30
- cellWidth: number;
31
- cellHeight: number;
32
- gridChildren: GridChild[];
33
- private gridBackground?;
34
- /**
35
- * A rectangular grid that supports placement of entities within the grid's cells.
36
- *
37
- * @remarks This composite entity is composed of rectangles and lines. It has convenience functions for placing and clearing entities on the grid by row and column position (zero-based indexing)
38
- *
39
- * @param options - {@link GridOptions}
40
- */
41
- constructor(options: GridOptions);
42
- initialize(): void;
43
- /**
44
- * Duplicates an entity using deep copy.
45
- *
46
- * @remarks This is a deep recursive clone (entity and children).
47
- * The uuid property of all duplicated entities will be newly created,
48
- * because uuid must be unique.
49
- *
50
- * @param newName - optional name of the new, duplicated entity. If not
51
- * provided, name will be the new uuid
52
- */
53
- duplicate(newName?: string): Grid;
54
- update(): void;
55
- draw(canvas: Canvas): void;
56
- /**
57
- * Removes all children from the grid, but retains grid lines.
58
- *
59
- */
60
- removeAllChildren(): void;
61
- /**
62
- * Adds an entity to the grid at the specified row and column position.
63
- *
64
- * @param entity - entity to add to the grid
65
- * @param row - row position within grid to add entity; zero-based indexing
66
- * @param column - column position within grid to add entity; zero-based indexing
67
- */
68
- addAtCell(entity: Entity, row: number, column: number): void;
69
- /**
70
- * Removes all child entities at the specified row and column position.
71
- *
72
- * @param row - row position within grid at which to remove children; zero-based indexing
73
- * @param column - column position within grid at which to remove children; zero-based indexing
74
- */
75
- removeAllAtCell(row: number, column: number): void;
76
- /**
77
- * Removes the child entity from the grid.
78
- *
79
- * @param entity - entity to remove
80
- */
81
- removeChild(entity: Entity): void;
4
+ interface GridOptions extends CompositeOptions {
5
+ /** Number of rows in the grid. Must be 1 or greater */
6
+ rows: number;
7
+ /** Number of columns in the grid. Must be 1 or greater */
8
+ columns: number;
9
+ /** Size of the grid in pixels */
10
+ size: Size;
11
+ /** Background color of the grid. Default is a transparent gray */
12
+ backgroundColor?: RgbaColor;
13
+ /** Width of the grid lines. Default is 1 */
14
+ gridLineWidth?: number;
15
+ /** Color of the grid lines. Default is red */
16
+ gridLineColor?: RgbaColor;
17
+ }
18
+ interface GridChild {
19
+ entity: Entity;
20
+ row: number;
21
+ column: number;
22
+ }
23
+ declare class Grid extends Composite {
24
+ compositeType: string;
25
+ rows: number;
26
+ columns: number;
27
+ gridBackgroundColor: RgbaColor;
28
+ gridLineColor: RgbaColor;
29
+ gridLineWidth: number;
30
+ cellWidth: number;
31
+ cellHeight: number;
32
+ gridChildren: GridChild[];
33
+ private gridBackground?;
34
+ /**
35
+ * A rectangular grid that supports placement of entities within the grid's
36
+ * cells.
37
+ *
38
+ * @remarks This composite entity is composed of rectangles and lines. It
39
+ * has convenience functions for placing and clearing entities on the grid
40
+ * by row and column position (zero-based indexing)
41
+ *
42
+ * @param options - {@link GridOptions}
43
+ */
44
+ constructor(options: GridOptions);
45
+ initialize(): void;
46
+ dispose(): void;
47
+ /**
48
+ * Duplicates an entity using deep copy.
49
+ *
50
+ * @remarks This is a deep recursive clone (entity and children).
51
+ * The uuid property of all duplicated entities will be newly created,
52
+ * because uuid must be unique.
53
+ *
54
+ * @param newName - optional name of the new, duplicated entity. If not
55
+ * provided, name will be the new uuid
56
+ */
57
+ duplicate(newName?: string): Grid;
58
+ update(): void;
59
+ draw(canvas: Canvas): void;
60
+ warmup(canvas: Canvas): void;
61
+ /**
62
+ * Removes all children from the grid, but retains grid lines.
63
+ *
64
+ */
65
+ removeAllChildren(): void;
66
+ /**
67
+ * Adds an entity to the grid at the specified row and column position.
68
+ *
69
+ * @param entity - entity to add to the grid
70
+ * @param row - row position within grid to add entity; zero-based indexing
71
+ * @param column - column position within grid to add entity; zero-based indexing
72
+ */
73
+ addAtCell(entity: Entity, row: number, column: number): void;
74
+ /**
75
+ * Removes all child entities at the specified row and column position.
76
+ *
77
+ * @param row - row position within grid at which to remove children; zero-based indexing
78
+ * @param column - column position within grid at which to remove children; zero-based indexing
79
+ */
80
+ removeAllAtCell(row: number, column: number): void;
81
+ /**
82
+ * Removes the child entity from the grid.
83
+ *
84
+ * @param entity - entity to remove
85
+ */
86
+ removeChild(entity: Entity): void;
82
87
  }
83
88
 
84
- declare global {
85
- var Globals: GlobalVariables;
86
- }
89
+ declare global {
90
+ var Globals: GlobalVariables;
91
+ }
87
92
  //# sourceMappingURL=Globals.d.ts.map
88
93
 
89
- interface ButtonOptions extends CompositeOptions, TextOptions {
90
- /** Size of button */
91
- size?: Size;
92
- /** Corner radius of button; can be used to make rounded corners */
93
- cornerRadius?: number;
94
- /** Background color of button. Default is WebColors.RoyalBlue */
95
- backgroundColor?: RgbaColor;
96
- /** Color of button text. Default is WebColors.White */
97
- fontColor?: RgbaColor;
98
- }
99
- declare class Button extends Composite implements IText {
100
- compositeType: string;
101
- private _backgroundColor;
102
- size: {
103
- width: number;
104
- height: number;
105
- };
106
- cornerRadius: number;
107
- fontSize: number;
108
- text: string;
109
- private _fontColor;
110
- private backgroundPaint?;
111
- constructor(options: ButtonOptions);
112
- initialize(): void;
113
- get backgroundColor(): RgbaColor;
114
- set backgroundColor(backgroundColor: RgbaColor);
115
- get fontColor(): RgbaColor;
116
- set fontColor(fontColor: RgbaColor);
117
- /**
118
- * Duplicates an entity using deep copy.
119
- *
120
- * @remarks This is a deep recursive clone (entity and children).
121
- * The uuid property of all duplicated entities will be newly created,
122
- * because uuid must be unique.
123
- *
124
- * @param newName - optional name of the new, duplicated entity. If not
125
- * provided, name will be the new uuid
126
- */
127
- duplicate(newName?: string): Button;
128
- update(): void;
129
- draw(canvas: Canvas): void;
94
+ interface ButtonOptions extends CompositeOptions, TextOptions {
95
+ /** Size of button */
96
+ size?: Size;
97
+ /** Corner radius of button; can be used to make rounded corners */
98
+ cornerRadius?: number;
99
+ /** Background color of button. Default is WebColors.RoyalBlue */
100
+ backgroundColor?: RgbaColor;
101
+ /** Color of button text. Default is WebColors.White */
102
+ fontColor?: RgbaColor;
103
+ }
104
+ declare class Button extends Composite implements IText {
105
+ compositeType: string;
106
+ private _backgroundColor;
107
+ size: {
108
+ width: number;
109
+ height: number;
110
+ };
111
+ cornerRadius: number;
112
+ fontSize: number;
113
+ text: string;
114
+ private _fontColor;
115
+ private backgroundPaint?;
116
+ /**
117
+ * A simple button of rectangle with text centered inside.
118
+ *
119
+ * @remarks This composite entity is composed of a rectangle and text. To
120
+ * respond to user taps, the isUserInteractionEnabled property must be set
121
+ * to true and an appropriate callback must be set to handle the tap event.
122
+ *
123
+ * @param options - {@link ButtonOptions}
124
+ */
125
+ constructor(options: ButtonOptions);
126
+ initialize(): void;
127
+ dispose(): void;
128
+ get backgroundColor(): RgbaColor;
129
+ set backgroundColor(backgroundColor: RgbaColor);
130
+ get fontColor(): RgbaColor;
131
+ set fontColor(fontColor: RgbaColor);
132
+ /**
133
+ * Duplicates an entity using deep copy.
134
+ *
135
+ * @remarks This is a deep recursive clone (entity and children).
136
+ * The uuid property of all duplicated entities will be newly created,
137
+ * because uuid must be unique.
138
+ *
139
+ * @param newName - optional name of the new, duplicated entity. If not
140
+ * provided, name will be the new uuid
141
+ */
142
+ duplicate(newName?: string): Button;
143
+ update(): void;
144
+ draw(canvas: Canvas): void;
145
+ warmup(canvas: Canvas): void;
146
+ }
147
+
148
+ interface DialogOptions extends CompositeOptions {
149
+ /** Size of dialog box */
150
+ size?: Size;
151
+ /** Corner radius of dialog box; can be used to make rounded corners */
152
+ cornerRadius?: number;
153
+ /** Background color of dialog box. Default is WebColors.White */
154
+ backgroundColor?: RgbaColor;
155
+ /** Color of button text. Default is WebColors.White */
156
+ fontColor?: RgbaColor;
157
+ overlayAlpha?: number;
158
+ positiveButtonText?: string;
159
+ negativeButtonText?: string;
160
+ positiveButtonColor?: RgbaColor;
161
+ negativeButtonColor?: RgbaColor;
162
+ messageText?: string;
163
+ }
164
+ declare enum DialogResult {
165
+ Dismiss = "Dismiss",
166
+ Positive = "Positive",
167
+ Negative = "Negative"
168
+ }
169
+ interface DialogEvent extends EntityEvent {
170
+ dialogResult: DialogResult;
171
+ }
172
+ declare class Dialog extends Composite {
173
+ compositeType: string;
174
+ private _backgroundColor;
175
+ cornerRadius: number;
176
+ overlayAlpha: number;
177
+ contentText: string;
178
+ positiveButtonText: string;
179
+ negativeButtonText: string;
180
+ zPosition: number;
181
+ hidden: boolean;
182
+ private _fontColor;
183
+ private backgroundPaint?;
184
+ constructor(options?: DialogOptions);
185
+ show(): void;
186
+ onDialolgResult(callback: (dailogResultEvent: DialogEvent) => void, replaceExistingCallback?: boolean): void;
187
+ initialize(): void;
188
+ get backgroundColor(): RgbaColor;
189
+ set backgroundColor(backgroundColor: RgbaColor);
190
+ get fontColor(): RgbaColor;
191
+ set fontColor(fontColor: RgbaColor);
192
+ /**
193
+ * Duplicates an entity using deep copy.
194
+ *
195
+ * @remarks This is a deep recursive clone (entity and children).
196
+ * The uuid property of all duplicated entities will be newly created,
197
+ * because uuid must be unique.
198
+ *
199
+ * @param newName - optional name of the new, duplicated entity. If not
200
+ * provided, name will be the new uuid
201
+ */
202
+ duplicate(newName?: string): Dialog;
203
+ update(): void;
204
+ draw(canvas: Canvas): void;
205
+ warmup(canvas: Canvas): void;
206
+ }
207
+
208
+ interface KeyConfiguration {
209
+ /** Width of the key in units of a regular key width. Default is 1. */
210
+ widthRatio?: number;
211
+ /** Width of the key in units of a regular key height. Default is 1. */
212
+ heightRatio?: number;
213
+ /** Identifier for the key. */
214
+ code: string;
215
+ /** Label to be shown on the key. */
216
+ labelText?: string;
217
+ /** Label to be shown on the key when shift is activated. */
218
+ labelTextShifted?: string;
219
+ /** True is the key should be hidden. */
220
+ blank?: boolean;
221
+ /** True is the key is a shift key. */
222
+ isShift?: boolean;
223
+ /** Icon to show on the key. */
224
+ keyIcon?: Shape;
225
+ }
226
+ type VirtualKeyboardRow = Array<KeyConfiguration | string | Array<string>>;
227
+ interface VirtualKeyboardOptions extends CompositeOptions {
228
+ size: Size;
229
+ /** Percent of the keyboard width that should be used for padding on the left and right sides. Default is .02 */
230
+ keyboardHorizontalPaddingPercent?: number;
231
+ /** Percent of the keyboard height that should be used for padding on the top and bottom sides. Default is .025 */
232
+ keyboardVerticalPaddingPercent?: number;
233
+ /** Percent of each key's width that should be used for padding on the left and right sides. Default is .10 */
234
+ keyHorizontalPaddingPercent?: number;
235
+ /** Percent of each key's height that should be used for padding on the top and bottom sides. Default is .10 */
236
+ keyVerticalPaddingPercent?: number;
237
+ /** Configuration of keyboard rows. Order is from top to bottom rows. */
238
+ rows?: Array<VirtualKeyboardRow>;
239
+ /** How many regular-sized keys should fit in a row? This is used for scaling purposes. If not provided, it will be inferred from the row configuration. */
240
+ keysPerRow?: number;
241
+ /** Size of font for keys. */
242
+ fontSize?: number;
243
+ /** Comma-separated list of keys to hide. */
244
+ hiddenKeys?: string;
245
+ /** If true, only capital letters will be shown. */
246
+ captialLettersOnly?: boolean;
247
+ /** Color of keys. */
248
+ keyColor?: RgbaColor;
249
+ /** Color of keys when pressed. */
250
+ keyDownColor?: RgbaColor;
251
+ /** Color of special keys when pressed. */
252
+ specialKeyDownColor?: RgbaColor;
253
+ /** Background color of keyboard. */
254
+ backgroundColor?: RgbaColor;
255
+ /** If true, a preview of the key that will be pressed will be shown. */
256
+ showKeyDownPreview?: boolean;
257
+ }
258
+ interface VirtualKeyboardEvent extends EntityEvent {
259
+ /** String that is generated when key is pressed, with any modifiers (e.g., Shift) applied. */
260
+ key: string;
261
+ /** Code for the key, not taking into account any modifiers. */
262
+ code: string;
263
+ /** True if the Shift key is pressed. */
264
+ shiftKey: boolean;
265
+ }
266
+ declare class VirtualKeyboard extends Composite {
267
+ private keyboardHorizontalPaddingPercent;
268
+ private keyboardVerticalPaddingPercent;
269
+ private keyHorizontalPaddingPercent;
270
+ private keyVerticalPaddingPercent;
271
+ private rowsConfiguration;
272
+ private keysPerRow;
273
+ private fontSize;
274
+ private hiddenKeys;
275
+ private captialLettersOnly;
276
+ private keyColor;
277
+ private keyDownColor;
278
+ private specialKeyDownColor;
279
+ private backgroundColor;
280
+ private showKeyDownPreview;
281
+ private shiftActivated;
282
+ private shiftKeyShape;
283
+ /**
284
+ * An on-screen keyboard that can be used to enter text.
285
+ *
286
+ * @param options - {@link VirtualKeyboardOptions}
287
+ */
288
+ constructor(options: VirtualKeyboardOptions);
289
+ initialize(): void;
290
+ /**
291
+ * Executes a callback when the user presses down on a key.
292
+ *
293
+ * @param callback - function to execute
294
+ * @param replaceExistingCallback - should the provided callback replace
295
+ * any existing callbacks of the same event type on this entity? Usually
296
+ * there should be only one callback defined, instead of chaining multiple
297
+ * ones. It is strongly recommended not to change this, unless you have a
298
+ * special use case. Default is true.
299
+ */
300
+ onKeyDown(callback: (virtualKeyboardEvent: VirtualKeyboardEvent) => void, replaceExistingCallback?: boolean): void;
301
+ /**
302
+ * Executes a callback when the user releases a key.
303
+ *
304
+ * @param callback - function to execute
305
+ * @param replaceExistingCallback - should the provided callback replace
306
+ * any existing callbacks of the same event type on this entity? Usually
307
+ * there should be only one callback defined, instead of chaining multiple
308
+ * ones. It is strongly recommended not to change this, unless you have a
309
+ * special use case. Default is true.
310
+ */
311
+ onKeyUp(callback: (virtualKeyboardEvent: VirtualKeyboardEvent) => void, replaceExistingCallback?: boolean): void;
312
+ private addVirtualKeyboardEventListener;
313
+ update(): void;
314
+ draw(canvas: Canvas): void;
315
+ warmup(canvas: Canvas): void;
316
+ duplicate(newName?: string | undefined): Entity;
130
317
  }
131
318
 
132
- interface InstructionScene {
133
- /** Primary instruction text */
134
- text?: string;
135
- /** Margin from left screen edge to primary instruction text. Default is 48 */
136
- textMarginStart?: number;
137
- /** Margin from right to primary instruction text. Default is 48 */
138
- textMarginEnd?: number;
139
- /** Horizontal alignment of primary instruction text. see {@link LabelHorizontalAlignmentMode}. Default is LabelHorizontalAlignmentMode.left. */
140
- textAlignmentMode?: LabelHorizontalAlignmentMode;
141
- /** Default is to center primary instructions vertically within the scene (textVerticalBias = .5). Setting textVerticalBias less than .5 will pull the text towards the top. Setting textVerticalBias greater than .5 will pull the text towards the bottom */
142
- textVerticalBias?: number;
143
- /** Font size of primary instruction text. Default is 16 */
144
- textFontSize?: number;
145
- /** A text heading to appear at the top of the scene */
146
- title?: string;
147
- /** Margin from top of screen edge to title text. Default is 48 */
148
- titleMarginTop?: number;
149
- /** Font size of title text. Default is 16 */
150
- titleFontSize?: number;
151
- /** Optional image to show */
152
- image?: string;
153
- /** Default is to center image vertically within the scene (imageVerticalBias = .5). Setting imageVerticalBias less than .5 will pull the image towards the top. Setting imageVerticalBias greater than .5 will pull the image towards the bottom */
154
- imageVerticalBias?: number;
155
- /** If the image appears below the primary instruction text (imageAboveText = false), this is the margin from the bottom of the primary instruction text to the top of the image */
156
- imageMarginTop?: number;
157
- /** If the image appears above the primary instruction text (imageAboveText = true), this is the margin from the bottom of the image to the top of the primary instruction text */
158
- imageMarginBottom?: number;
159
- /** If an image is provided, should it appear above the primary text? Default is true */
160
- imageAboveText?: boolean;
161
- /** Background color for instruction scene. Will override what is set in InstructionsOptions */
162
- backgroundColor?: RgbaColor;
163
- /** Button text for the back button. Will override what is set in InstructionsOptions */
164
- backButtonText?: string;
165
- /** Button text for the next button. Will override what is set in InstructionsOptions */
166
- nextButtonText?: string;
167
- /** Width of back button. Will override what is set in InstructionsOptions */
168
- backButtonWidth?: number;
169
- /** Width of next button. Will override what is set in InstructionsOptions */
170
- nextButtonWidth?: number;
171
- /** Height of back button. Will override what is set in InstructionsOptions */
172
- backButtonHeight?: number;
173
- /** Height of next button. Will override what is set in InstructionsOptions */
174
- nextButtonHeight?: number;
175
- /** Color of back button. Will override what is set in InstructionsOptions */
176
- backButtonBackgroundColor?: RgbaColor;
177
- /** Color of back button text. Will override what is set in InstructionsOptions */
178
- backButtonFontColor?: RgbaColor;
179
- /** Color of next button. Will override what is set in InstructionsOptions */
180
- nextButtonBackgroundColor?: RgbaColor;
181
- /** Color of next button text. Will override what is set in InstructionsOptions */
182
- nextButtonFontColor?: RgbaColor;
183
- /** Scene transition when advancing to the next instruction scene. Will override what is set in InstructionsOptions */
184
- nextSceneTransition?: Transition;
185
- /** Scene transition when returning to the previous instruction scene. Will override what is set in InstructionsOptions */
186
- backSceneTransition?: Transition;
187
- }
188
- interface InstructionsOptions extends StoryOptions {
189
- /** Name to prefix to each instruction scene name. For example, if screenNamePrefix is "instructions", instruction scenes will be named "instructions-01", "instructions-02", etc. */
190
- sceneNamePrefix: string;
191
- /** Name of scene that follows the last instruction scene. Clicking the "next" button on the last instruction screen will advance to this screen */
192
- postInstructionsScene?: string;
193
- /** Array of instruction scenes that form the instructions */
194
- instructionScenes: Array<InstructionScene>;
195
- /** Background color for instruction scenes. Can be overriden within a single instruction scene */
196
- backgroundColor?: RgbaColor;
197
- /** Scene transition when advancing to the next instruction scene. Default is push transition, to the left, 500 milliseconds duration. Can be overriden within a single instruction scene */
198
- nextSceneTransition?: Transition;
199
- /** Scene transition when returning to the previous instruction scene. Default is push transition, to the right, 500 milliseconds duration. Can be overriden within a single instruction scene */
200
- backSceneTransition?: Transition;
201
- /** Button text for the back button. Default is "Back". Can be overriden within a single instruction scene */
202
- backButtonText?: string;
203
- /** Button text for the next button. Default is "Next". Can be overriden within a single instruction scene */
204
- nextButtonText?: string;
205
- /** Width of back button. Default is 125. Can be overriden within a single instruction scene */
206
- backButtonWidth?: number;
207
- /** Width of next button. Default is 125. Can be overriden within a single instruction scene */
208
- nextButtonWidth?: number;
209
- /** Height of back button. Default is 50. Can be overriden within a single instruction scene */
210
- backButtonHeight?: number;
211
- /** Height of next button. Default is 50. Can be overriden within a single instruction scene */
212
- nextButtonHeight?: number;
213
- /** Color of back button. Default is WebColors.RoyalBlue. Can be overriden within a single instruction scene */
214
- backButtonBackgroundColor?: RgbaColor;
215
- /** Color of back button text. Default is WebColors.White. Can be overriden within a single instruction scene */
216
- backButtonFontColor?: RgbaColor;
217
- /** Color of next button. Default is WebColors.RoyalBlue. Can be overriden within a single instruction scene */
218
- nextButtonBackgroundColor?: RgbaColor;
219
- /** Color of next button text. Default is WebColors.White. Can be overriden within a single instruction scene */
220
- nextButtonFontColor?: RgbaColor;
221
- }
222
- declare class Instructions extends Story {
223
- /**
224
- * Create an array of scenes containing instructions on how to complete the task
225
- *
226
- * @param options - {@link InstructionsOptions}
227
- * @returns
228
- */
229
- static Create(options: InstructionsOptions): Array<Scene>;
319
+ interface InstructionScene {
320
+ /** Primary instruction text */
321
+ text?: string;
322
+ /** Margin from left screen edge to primary instruction text. Default is 48 */
323
+ textMarginStart?: number;
324
+ /** Margin from right to primary instruction text. Default is 48 */
325
+ textMarginEnd?: number;
326
+ /** Horizontal alignment of primary instruction text. see {@link LabelHorizontalAlignmentMode}. Default is LabelHorizontalAlignmentMode.left. */
327
+ textAlignmentMode?: LabelHorizontalAlignmentMode;
328
+ /** Default is to center primary instructions vertically within the scene (textVerticalBias = .5). Setting textVerticalBias less than .5 will pull the text towards the top. Setting textVerticalBias greater than .5 will pull the text towards the bottom */
329
+ textVerticalBias?: number;
330
+ /** Font size of primary instruction text. Default is 16 */
331
+ textFontSize?: number;
332
+ /** A text heading to appear at the top of the scene */
333
+ title?: string;
334
+ /** Margin from top of screen edge to title text. Default is 48 */
335
+ titleMarginTop?: number;
336
+ /** Font size of title text. Default is 16 */
337
+ titleFontSize?: number;
338
+ /** Name of optional image to show */
339
+ imageName?: string;
340
+ /** Default is to center image vertically within the scene (imageVerticalBias = .5). Setting imageVerticalBias less than .5 will pull the image towards the top. Setting imageVerticalBias greater than .5 will pull the image towards the bottom */
341
+ imageVerticalBias?: number;
342
+ /** If the image appears below the primary instruction text (imageAboveText = false), this is the margin from the bottom of the primary instruction text to the top of the image */
343
+ imageMarginTop?: number;
344
+ /** If the image appears above the primary instruction text (imageAboveText = true), this is the margin from the bottom of the image to the top of the primary instruction text */
345
+ imageMarginBottom?: number;
346
+ /** If an image is provided, should it appear above the primary text? Default is true */
347
+ imageAboveText?: boolean;
348
+ /** Background color for instruction scene. Will override what is set in InstructionsOptions */
349
+ backgroundColor?: RgbaColor;
350
+ /** Button text for the back button. Will override what is set in InstructionsOptions */
351
+ backButtonText?: string;
352
+ /** Button text for the next button. Will override what is set in InstructionsOptions */
353
+ nextButtonText?: string;
354
+ /** Width of back button. Will override what is set in InstructionsOptions */
355
+ backButtonWidth?: number;
356
+ /** Width of next button. Will override what is set in InstructionsOptions */
357
+ nextButtonWidth?: number;
358
+ /** Height of back button. Will override what is set in InstructionsOptions */
359
+ backButtonHeight?: number;
360
+ /** Height of next button. Will override what is set in InstructionsOptions */
361
+ nextButtonHeight?: number;
362
+ /** Color of back button. Will override what is set in InstructionsOptions */
363
+ backButtonBackgroundColor?: RgbaColor;
364
+ /** Color of back button text. Will override what is set in InstructionsOptions */
365
+ backButtonFontColor?: RgbaColor;
366
+ /** Color of next button. Will override what is set in InstructionsOptions */
367
+ nextButtonBackgroundColor?: RgbaColor;
368
+ /** Color of next button text. Will override what is set in InstructionsOptions */
369
+ nextButtonFontColor?: RgbaColor;
370
+ /** Scene transition when advancing to the next instruction scene. Will override what is set in InstructionsOptions */
371
+ nextSceneTransition?: Transition;
372
+ /** Scene transition when returning to the previous instruction scene. Will override what is set in InstructionsOptions */
373
+ backSceneTransition?: Transition;
374
+ }
375
+ interface InstructionsOptions extends StoryOptions {
376
+ /** Name to prefix to each instruction scene name. Default is "instructions." For example, if screenNamePrefix is "instructions", instruction scenes will be named "instructions-01", "instructions-02", etc. */
377
+ sceneNamePrefix?: string;
378
+ /** Name of scene that follows the last instruction scene. Clicking the "next" button on the last instruction screen will advance to this screen */
379
+ postInstructionsScene?: string;
380
+ /** Array of instruction scenes that form the instructions */
381
+ instructionScenes: Array<InstructionScene>;
382
+ /** Background color for instruction scenes. Can be overriden within a single instruction scene */
383
+ backgroundColor?: RgbaColor;
384
+ /** Scene transition when advancing to the next instruction scene. Default is push transition, to the left, 500 milliseconds duration. Can be overriden within a single instruction scene */
385
+ nextSceneTransition?: Transition;
386
+ /** Scene transition when returning to the previous instruction scene. Default is push transition, to the right, 500 milliseconds duration. Can be overriden within a single instruction scene */
387
+ backSceneTransition?: Transition;
388
+ /** Button text for the back button. Default is "Back". Can be overriden within a single instruction scene */
389
+ backButtonText?: string;
390
+ /** Button text for the next button. Default is "Next". Can be overriden within a single instruction scene */
391
+ nextButtonText?: string;
392
+ /** Width of back button. Default is 125. Can be overriden within a single instruction scene */
393
+ backButtonWidth?: number;
394
+ /** Width of next button. Default is 125. Can be overriden within a single instruction scene */
395
+ nextButtonWidth?: number;
396
+ /** Height of back button. Default is 50. Can be overriden within a single instruction scene */
397
+ backButtonHeight?: number;
398
+ /** Height of next button. Default is 50. Can be overriden within a single instruction scene */
399
+ nextButtonHeight?: number;
400
+ /** Color of back button. Default is WebColors.Black. Can be overriden within a single instruction scene */
401
+ backButtonBackgroundColor?: RgbaColor;
402
+ /** Color of back button text. Default is WebColors.White. Can be overriden within a single instruction scene */
403
+ backButtonFontColor?: RgbaColor;
404
+ /** Color of next button. Default is WebColors.Black. Can be overriden within a single instruction scene */
405
+ nextButtonBackgroundColor?: RgbaColor;
406
+ /** Color of next button text. Default is WebColors.White. Can be overriden within a single instruction scene */
407
+ nextButtonFontColor?: RgbaColor;
408
+ }
409
+ declare class Instructions extends Story {
410
+ /**
411
+ * Create an array of scenes containing instructions on how to complete the task
412
+ *
413
+ * @param options - {@link InstructionsOptions}
414
+ * @returns
415
+ */
416
+ static Create(options: InstructionsOptions): Array<Scene>;
230
417
  }
231
418
 
232
- export { Button, ButtonOptions, Grid, GridOptions, Instructions, InstructionsOptions };
419
+ export { Button, ButtonOptions, Dialog, DialogEvent, DialogOptions, DialogResult, Grid, GridOptions, InstructionScene, Instructions, InstructionsOptions, KeyConfiguration, VirtualKeyboard, VirtualKeyboardEvent, VirtualKeyboardOptions, VirtualKeyboardRow };