Repository navigation
Expand file tree
/
Copy pathPerceptionMode.ts
More file actions
617 lines (527 loc) · 15 KB
/
Copy pathPerceptionMode.ts
File metadata and controls
617 lines (527 loc) · 15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
import { SchemaDefinition } from '@sozialhelden/simpl-schema';
import BooleanField from './BooleanField.js';
import htmlColorSchemaDefinition from './htmlColorSchemaDefinition.js';
import IETFLanguageCodeSchemaKeyDefinition, { IETFLanguageTag } from './ietfLanguageTags.js';
import { getPrefixedArraySchemaDefinition } from './lib/getPrefixedSchemaDefinition.js';
import { getLocalizedStringSchemaDefinition, LocalizedString } from './LocalizedString.js';
import { Necessity, NecessityField } from './Necessity.js';
import {
Acceleration, AccelerationSchema, Brightness, BrightnessSchema, Force, ForceSchema, getPrefixedQuantitySchemaDefinition, Hertz, HertzSchema, Length, LengthSchema, Temperature, TemperatureSchema, TimeInterval, TimeIntervalSchema, Volume, VolumeSchema
} from './Quantity.js';
import { getTechCombinationSchemaDefinition, TechCombination } from './TechCombination.js';
import { Urgencies, Urgency } from './Urgency.js';
/**
* Describes necessary abilities and modes for interpreting information output, signals, or
* content.
*/
export interface PerceptionMode {
/**
* Describes which output is meant. Helpful if there are multiple signals/outputs/content
* lements.
*/
name?: LocalizedString;
/**
* Describes the content/output/signal as human-readable text.
*/
description?: LocalizedString;
/**
* Content languages supported.
*/
languages?: IETFLanguageTag[];
/**
* `true` if the perception is optional, `false` if it is required.
*/
optional?: boolean;
/**
* `false` if the perception is required to make use of the main function of the described
* object, `true` if it is required.
*/
required?: boolean;
/**
* Urgency of the content when perceived.
*/
urgency?: Urgency;
/**
* The ability to understand speech is supported or needed.
*/
speech?: Necessity;
/**
* The output is an activation/engagement signal.
*/
activationSignal?: boolean;
/**
* The output is a light.
*/
light?: Necessity;
/**
* The output is rhythmic.
*/
rhythmic?: Necessity;
/**
* The ability to read is supported or needed.
*/
read?: Necessity;
/**
* The content/output/signal has active force feedback.
*/
forceFeedback?: Necessity;
/**
* The content/output/signal has active vibration feedback.
*/
vibration?: Necessity;
/**
* The content/output/signal affects your full body.
*/
fullBody?: Necessity;
/**
* The perceiving person uses a stethoscope.
*
* This is method for patient communication that is used by doctors to speak to patients with
* hearing impairments:
*
* > British doctors recommend using the stethoscope as a hearing aid for patients in such
* > situations (BMJ 2010; 341: c4672). If the patient has the buttons in his ear and the
* > physician speaks softly and clearly into the diaphragm as into a microphone, then sufficient
* > communication is often possible despite hearing problems. The intimacy of the conversation
* > can be preserved by this simple means.
*
* Sources:
*
* - [Ärztezeitung](https://www.aerztezeitung.de/Medizin/Das-Stethoskop-als-Hoerhilfe-213950.html)
* - [BMJ 2010;341:c4672](https://www.bmj.com/content/341/bmj.c4672?ijkey=66f0d96a9e9bca9e8d5b85b5f35ee0177d7e4239&keytype2=tf_ipsecsha)
*/
stethoscope?: Necessity;
/**
* The output is an LED.
*/
led?: Necessity;
/**
* The light looks like it is breathing.
*/
breathing?: Necessity;
/**
* The output has a haptic click feedback.
*/
hapticClick?: Necessity;
/**
* The output has an acoustic click feedback.
*/
audibleClick?: Necessity;
/**
* There is background music playing.
*/
backgroundMusic?: Necessity;
/**
* The output uses music.
*/
music?: Necessity;
/**
* The output uses one or more beeps as signal.
*/
beep?: Necessity;
/**
* The output uses one or more bing-like signals.
*/
bing?: Necessity;
/**
* The output uses a pitched tone as signal.
*/
pitchedTone?: Necessity;
/**
* The output is visual.
*/
visual?: Necessity;
/**
* The output is haptic.
*/
haptic?: Necessity;
/**
* The output is tactile.
*/
tactile?: Necessity;
/**
* The ability to smell is supported or needed.
*/
smell?: Necessity;
/**
* Tasting something is supported or needed.
*/
taste?: Necessity;
/**
* The output is acoustic.
*/
sound?: Necessity;
/**
* `true` if the output is usually static and does not change over time, `false` if it is dynamic
* and changes over time.
*/
static?: boolean;
/**
* The perceiving person uses a provisional hearing aid, e.g. a stethoscope, a smartphone, or a
* headset with a microphone that amplifies the sound or speech.
*/
provisionalHearingAid?: Necessity;
/**
* The output has a dedicated screen for subtitles.
*/
dedicatedScreenForSubtitles?: Necessity,
/**
* The output has subtitles.
*/
subtitles?: Necessity;
/**
* The output has audio description.
*/
audioDescription?: Necessity;
/**
* The output has realtime captioning.
*/
realTimeCaptioning?: Necessity;
/**
* The output has a plain language option.
*/
plainLanguageOption?: Necessity;
/**
* Education level needed to understand the output.
*
* http://www.ibe.unesco.org/en/glossary-curriculum-terminology/l/levels-education
*
* - early childhood education (level 0)
* - primary education (level 1)
* - lower secondary education (level 2)
* - upper secondary education (level 3)
* - postsecondary non-tertiary education (level 4)
* - short-cycle tertiary education (level 5)
* - bachelor’s or equivalent level (level 6)
* - master’s or equivalent level (level 7)
* - doctor or equivalent level (level 8).
*/
educationLevel?: Number;
/**
* The content is handwritten.
*/
handwritten?: Necessity;
/**
* The output is a flashing light.
*/
flash?: Necessity;
/**
* `true` if the output is a flashing hazard, `false` if there is explicitly no flashing hazard
* and someone / something ensures this. This can be relevant for people with epilepsy.
*/
flashingHazard?: boolean;
/**
* The output uses morse code.
*/
morse?: Necessity;
/**
* The output uses one or more pictograms.
*/
pictograms?: Necessity;
/**
* The output uses one or more numbers.
*/
numbers?: Necessity;
/**
* The output is animated.
*/
animation?: Necessity;
/**
* The ability to understand sign language is supported or needed.
*/
signLanguage?: Necessity;
/**
* The ability to read braille is supported or needed.
*/
braille?: Necessity;
/**
* The output has tactile guides, for example around buttons.
*/
tactileGuides?: Necessity;
/**
* The output is using a buzzer / paging device.
*/
buzzer?: Necessity;
/**
* The output is displayed on a screen.
*/
screen?: Necessity;
/**
* The output is displayed on a paper.
*/
paper?: Necessity;
/**
* The output is from a printer.
*/
printer?: Necessity;
/**
* Heat perception is supported or needed.
*/
heat?: Necessity;
/**
* The output uses one or more charts.
*/
chart?: Necessity;
/**
* The output is displayed in high contrast.
*/
highContrast?: boolean;
/**
* The height you need to grip to perceive the content/output/signal.
*/
necessaryGripHeight?: Length;
/**
* How tall do you have to be to perceive the content/output/signal.
*/
necessaryEyeHeight?: Length;
/**
* The frequency of the output, for tones or flashes.
*/
frequency?: Hertz;
/**
* Feedback force applied to the user.
*/
force?: Force;
/**
* Feedback force applied to the user.
*/
acceleration?: Acceleration;
/**
* The content/output/signal has active vibration feedback.
*/
soundVolume?: Volume;
/**
* The output's brightness.
*/
brightness?: Brightness;
/**
* Ambient noise level in dB(A) relative to a reference pressure of 0.00002 Pa. Median over a
* 10-second period at least.
*/
ambientNoiseLevel?: Volume;
/**
* Time interval in which the output is active.
*/
duration?: TimeInterval;
/**
* Attention time span needed to understand the output.
*/
attentionSpan?: TimeInterval;
/**
* The framerate of animations.
*/
framerate?: Hertz;
/**
* The temperature of the output.
*/
temperature?: Temperature;
/**
* The ambient temperature around the output.
*/
ambientTemperature?: Temperature;
/**
* Font size used in the output.
*/
fontSize?: Length;
/**
* The output uses black and white colors.
*/
blackAndWhite?: boolean;
/**
* The output uses a discrete color code.
*/
colorCode?: boolean;
/**
* The output uses a color gradient.
*/
colorGradient?: boolean;
/**
* Foreground output HTML colors (for example, the text or icon color).
*/
foregroundColors?: string[];
/**
* Background output HTML colors (for example, the background behind a text or icon).
*/
backgroundColors?: string[];
/**
* A QR code is supported or needed.
*/
qrCode?: Necessity;
/**
* Headphones are supported or needed.
*/
headphone?: Necessity;
/**
* A cable is supported or needed.
*/
cable?: Necessity;
/**
* A radio connection is supported or needed (e.g. WiFi, Bluetooth, NFC, etc.)
*/
radio?: Necessity;
/**
* `true` if you can or have to perceive the content with a device that you own.
*/
byod?: Necessity;
/**
* Technology combinations that are sufficient to make use of the content/output/signal.
*/
techSufficient?: TechCombination[];
/**
* Technologies that are sufficient to make use of the content/output/signal.
*/
techSupported?: TechCombination[];
/**
* URL where you can see or make use of the content/output/signal, e.g. on your phone.
*/
url?: LocalizedString;
/**
* URL describing how to make use of the content/output/signal.
*/
instructionsUrl?: LocalizedString;
/**
* The input API documentation URL.
*/
apiDocumentationUrl?: string;
/**
* `true` if the input is easy to understand, `false` if people might face difficulties trying to
* understand how the input works, or `undefined` if this is unknown or irrelevant.
*/
isEasyToUnderstand?: boolean;
/**
* `true` if the input is easy to find.
*/
isEasyToFind?: boolean;
/**
* The output needs high concentration to understand.
*/
needsHighConcentration?: Necessity;
/**
* `true` if the system’s audio quality is good enough for understanding speech, `false` if it is
* difficult.
*/
audioIsComprehensible?: boolean;
/**
* Lists potential content warnings you have to expect here. User interfaces should not show the
* content warning directly, but should instead show a button to show the content warning.
*/
contentWarning?: LocalizedString;
}
export const getPerceptionModeSchemaDefinition: () => SchemaDefinition = () => ({
languages: {
type: Array,
optional: true,
},
'languages.$': IETFLanguageCodeSchemaKeyDefinition,
backgroundColors: {
type: Array,
optional: true,
},
foregroundColors: {
type: Array,
optional: true,
},
'backgroundColors.$': htmlColorSchemaDefinition,
'foregroundColors.$': htmlColorSchemaDefinition,
educationLevel: {
type: Number,
optional: true,
allowedValues: [0, 1, 2, 3, 4, 5, 6, 7, 8],
},
...getLocalizedStringSchemaDefinition('contentWarning'),
needsHighConcentration: NecessityField,
...getPrefixedQuantitySchemaDefinition('attentionSpan', TimeIntervalSchema),
audioIsComprehensible: BooleanField,
optional: BooleanField,
required: BooleanField,
activationSignal: BooleanField,
alarm: BooleanField,
urgency: {
type: String,
optional: true,
allowedValues: (Urgencies as any) as string[],
},
light: NecessityField,
animation: NecessityField,
static: BooleanField,
byod: NecessityField,
blackAndWhite: BooleanField,
braille: NecessityField,
breathing: NecessityField,
button: NecessityField,
cable: NecessityField,
radio: NecessityField,
chart: NecessityField,
colorCode: BooleanField,
colorGradient: BooleanField,
flash: NecessityField,
flashingHazard: BooleanField,
fontSize: BooleanField,
forceFeedback: NecessityField,
handwritten: NecessityField,
hapticClick: NecessityField,
headphone: NecessityField,
highContrast: BooleanField,
isEasyToUnderstand: BooleanField,
isEasyToFind: BooleanField,
dedicatedScreenForSubtitles: NecessityField,
subtitles: NecessityField,
audioDescription: NecessityField,
realTimeCaptioning: NecessityField,
plainLanguageOption: NecessityField,
led: NecessityField,
morse: NecessityField,
heat: NecessityField,
music: NecessityField,
backgroundMusic: NecessityField,
numbers: NecessityField,
pictograms: NecessityField,
audibleClick: NecessityField,
beep: NecessityField,
bing: NecessityField,
pitchedTone: NecessityField,
rhythmic: NecessityField,
qrCode: NecessityField,
read: NecessityField,
screen: NecessityField,
buzzer: NecessityField,
printer: NecessityField,
paper: NecessityField,
signLanguage: NecessityField,
sound: NecessityField,
smell: NecessityField,
taste: NecessityField,
haptic: NecessityField,
tactile: NecessityField,
visual: NecessityField,
speech: NecessityField,
tactileGuides: NecessityField,
vibration: NecessityField,
fullBody: NecessityField,
stethoscope: NecessityField,
provisionalHearingAid: NecessityField,
apiDocumentationUrl: {
type: String,
optional: true,
},
...getLocalizedStringSchemaDefinition('description'),
...getLocalizedStringSchemaDefinition('instructionsUrl'),
...getLocalizedStringSchemaDefinition('name'),
...getLocalizedStringSchemaDefinition('url'),
...getPrefixedQuantitySchemaDefinition('ambientNoiseLevel', VolumeSchema),
...getPrefixedQuantitySchemaDefinition('brightness', BrightnessSchema),
...getPrefixedQuantitySchemaDefinition('fontSize', LengthSchema),
...getPrefixedQuantitySchemaDefinition('force', ForceSchema),
...getPrefixedQuantitySchemaDefinition('acceleration', AccelerationSchema),
...getPrefixedQuantitySchemaDefinition('framerate', HertzSchema),
...getPrefixedQuantitySchemaDefinition('frequency', HertzSchema),
...getPrefixedQuantitySchemaDefinition('soundVolume', VolumeSchema),
...getPrefixedQuantitySchemaDefinition('necessaryGripHeight', LengthSchema),
...getPrefixedQuantitySchemaDefinition('necessaryEyeHeight', LengthSchema),
...getPrefixedQuantitySchemaDefinition('antentionSpan', TimeIntervalSchema),
...getPrefixedQuantitySchemaDefinition('duration', TimeIntervalSchema),
...getPrefixedQuantitySchemaDefinition('temperature', TemperatureSchema),
...getPrefixedQuantitySchemaDefinition('ambientTemperature', TemperatureSchema),
...getPrefixedArraySchemaDefinition('techSufficient', getTechCombinationSchemaDefinition()),
...getPrefixedArraySchemaDefinition('techSupported', getTechCombinationSchemaDefinition()),
});