-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathAccessibility.ts
More file actions
351 lines (317 loc) · 12.4 KB
/
Copy pathAccessibility.ts
File metadata and controls
351 lines (317 loc) · 12.4 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
import { SchemaDefinition } from '@sozialhelden/simpl-schema';
import { AnimalPolicy, getAnimalPolicySchemaDefinition } from './AnimalPolicy.js';
import { AppointmentPolicy, getAppointmentPolicySchemaDefinition } from './AppointmentPolicy.js';
import BooleanField from './BooleanField.js';
import { Desk, getDeskSchemaDefinition } from './Desk.js';
import { Entrance, getEntranceSchemaDefinition } from './Entrance.js';
import { EquipmentProperties, getEquipmentPropertiesSchemaDefinition } from './EquipmentProperties.js';
import { getInteractableSchemaDefinition, Interactable } from './Interactable.js';
import getPrefixedSchemaDefinition, { getPrefixedArraySchemaDefinition } from './lib/getPrefixedSchemaDefinition.js';
import { getLocalizedStringSchemaDefinition, LocalizedString } from './LocalizedString.js';
import { getMediaSchemaDefinition, Media } from './Media.js';
import { getParkingSchemaDefinition, Parking } from './Parking.js';
import { getPathwaysSchemaDefinition, Pathways } from './Pathways.js';
import { getPaymentSchemaDefinition, Payment } from './Payment.js';
import { getPersonalProfileSchemaDefinition, PersonalProfile } from './PersonalProfile.js';
import { getPrefixedQuantitySchemaDefinition, Volume, VolumeSchema } from './Quantity.js';
import { getQueueSystemSchemaDefinition, QueueSystem } from './QueueSystem.js';
import { getRestroomSchemaDefinition, Restroom } from './Restroom.js';
import { getRoomSchemaDefinition, Room } from './Room.js';
import { getSignageSchemaDefinition, Signage } from './Signage.js';
import { smokingPolicies, SmokingPolicy } from './SmokingPolicy.js';
import { getStaffSchemaDefinition, Staff } from './Staff.js';
import { getSurfaceSchemaDefinition, Surface } from './Surface.js';
import { getWheelchairPlacesSchemaDefinition, WheelchairPlaces } from './WheelchairPlaces.js';
import { getWifiAccessibilitySchemaDefinition, WifiAccessibility } from './WifiAccessibility.js';
/**
* Describes the general wheelchair accessibility of the place. This is a human-rated value.
* It SHOULD conform to the traffic light system found in OpenStreetMap and Wheelmap.org.
*/
export const WheelchairAccessibilityGrades = [
/**
* Entrance (if applicable) has no steps, and all rooms are accessible without steps. If there
* are no rooms, the main functionality of the place must be accessible with a wheelchair.
*/
'fully',
/**
* `"partially"`: Entrance has one step with max. 3 inches height (or a mobile ramp is
* available), most rooms are without steps. After passing the entrance, the main functionality
* of the place must be accessible with a wheelchair.
*/
'partially',
/**
* Entrance has a high step or several steps, or none of the rooms are accessible. You can't
* enter / use the place with a wheelchair.
*/
'not',
] as const;
export type WheelchairAccessibilityGrade = typeof WheelchairAccessibilityGrades[number];
export const GenericInteractions = [
'main',
'watchMovies',
'watchPlays',
'explore',
'visit',
'roam',
'read',
'rent',
'watch',
'see',
'listen',
'getFood',
'getDrinks',
'getTreatment',
'getService',
'eat',
'order',
'orderAnnouncement',
'pickUpOrder',
'pay',
'buy',
'sell',
'workHere',
'arrive',
'checkIn',
'checkOut',
'useLockers',
'useService',
'change',
'use',
'book',
'play',
] as const;
export type GenericInteraction = typeof GenericInteractions[number];
export const GenericInteractionsSet = new Set(GenericInteractions);
/**
* Describes the physical (and sometimes human rated) accessibility of a place.
*/
export interface Accessibility extends Interactable<GenericInteraction> {
/// @deprecated Use `wheelchairAccessibilityGrade`, `media`, and other properties instead.
accessibleWith?: PersonalProfile;
/// @deprecated Use `wheelchairAccessibilityGrade`, `media`, and other properties instead.
partiallyAccessibleWith?: PersonalProfile;
/// @deprecated Use `wheelchairAccessibilityGrade`, `media`, and other properties instead.
offersActivitiesForPeopleWith?: PersonalProfile;
/**
* Describes the general wheelchair accessibility of the place. This is a human-rated value.
*/
wheelchairAccessibilityGrade?: WheelchairAccessibilityGrade;
/**
* Information about the service staff.
* `null` indicates there is no staff, `undefined` or missing property indicates unknown.
*/
staff?: Staff | null;
/**
* Information about parking facilities at/around the venue.
* `null` indicates there is no parking, `undefined` or missing property indicates unknown.
*/
parking?: Parking | null;
/**
* Determines if the venue is well lit (subjectively, by the assessor). Will be replaced by a
* measurable lumen value in the future.
*/
isWellLit?: boolean;
/**
* Determines if the venue is quiet (subjectively, by the assessor). If possible, use the
* `ambientNoiseLevel` property instead.
*/
isQuiet?: boolean;
/**
* Determines if there is sound absorption installed.
*/
hasSoundAbsorption?: boolean;
/**
* Determines if there is background music playing.
*/
hasBackgroundMusic?: boolean;
/**
* Determines if there is air conditioning installed and actively used.
*/
hasAirConditioning?: boolean;
/**
* 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;
/**
* Object describing the owner's smoking policy.
*/
smokingPolicy?: SmokingPolicy;
/**
* Object describing the owner's policy regarding visitors bringing animals with them.
*/
animalPolicy?: AnimalPolicy;
/**
* Describes how you can get an appointment for this place, or if you need one.
*/
appointmentPolicies?: AppointmentPolicy[];
/**
* `true` if the venue has tactile guide strips on the floor or at the walls, `false` if not.
* `undefined` or missing property indicates unknown.
*
* @deprecated Use `signageSystems` instead.
*/
hasTactileGuideStrips?: boolean;
/**
* `true` if there is tactile navigation for/to this place, `false` if not.
*
* @deprecated Use `signageSystems` instead.
*/
hasTactileSignage?: boolean;
/**
* `true` if there is braille navigation for/to this place, `false` if not.
*
* @deprecated Use `signageSystems` instead.
*/
hasBrailleSignage?: boolean;
/**
* Describes local signage systems. If multiple different systems are used, describe them all.
*/
signageSystems?: Signage[];
/**
* `true` if the venue has induction loops installed in its functional units where this is
* relevant.
*/
hasInductionLoop?: boolean;
/**
* `true` if the venue has a patient lifter (MedTech) installed, `false` if not..
*/
hasPatientLifter?: boolean;
/**
* `true` for healthcare providers that offer that wheelchair users do not have to leave their
* wheelchair for treatment, `false` if this is not possible.
*/
offersTreatmentWithoutLeavingWheelchair?: boolean;
/**
* `true` if the venue has a designated low-stimulus room or environment, `false` if not.
* Can help with hypersensitivity to sensory input.
*/
hasLowStimulusEnvironment?: boolean;
/**
* Describes the Wifi availability and accessibility at the place.
*/
wifi?: WifiAccessibility;
/**
* Object describing the place's ground condition. If there are very different ground conditions,
* you can create multiple places and nest them.
*/
surface?: Surface | null;
/**
* Describes the accessibility of pathways to the place or inside the place’s boundaries (mixed)
*/
pathways?: Pathways | null;
/**
* For places inside other places (e.g. a room inside a building).
*
* Describes the accessibility of pathways to the place. If an extra accessible entrance exists,
* describe pathways from there to this place.
*/
pathwaysFromEntrance?: Pathways | null;
/**
* Describes the accessibility of pathways to the place or inside the place’s boundaries (mixed)
*/
pathwaysInside?: Pathways | null;
/**
* Describes the accessibility of entrances to the place.
*/
entrances?: Entrance[] | null;
/**
* Describes the accessibility of desks in the place.
* `null` indicates there are no desks, `undefined` or missing property indicates unknown.
*/
desks?: Desk[] | null;
/**
* Describes the accessibility of restrooms that belong to the place.
*/
restrooms?: Restroom[] | null;
/**
* Describes the accessibility of rooms that belong to the place.
*/
rooms?: Room[] | null;
/**
* Information about payment at the place.
* `null` indicates there is no payment possible/required,
* `undefined` or missing property indicates unknown.
*/
payment?: Payment | null;
/**
* Information about wheelchair places.
* `null` indicates there are no places, `undefined` or missing property indicates unknown.
*/
wheelchairPlaces?: WheelchairPlaces | null;
/**
* Information about tables (for example in a restaurant).
* `null` indicates there are no tables, `undefined` or missing property indicates unknown.
*/
tables?: Desk[] | null;
/**
* Information about the place's equipment.
*
* Use this property for equipment that does not need to be locatable in a specific geolocation,
* but belongs to a place.
*/
availableEquipment?: EquipmentProperties[] | null;
/**
* Information about the place's queue system.
*/
queueSystem?: QueueSystem | null;
serviceContact?: LocalizedString;
/**
* Information about media.
* `null` indicates there is no media, `undefined` or missing property indicates unknown.
*/
media?: Media[] | null;
}
export const getAccessibilitySchemaDefinition: () => SchemaDefinition = () => ({
...getPrefixedSchemaDefinition('accessibleWith', getPersonalProfileSchemaDefinition()),
...getPrefixedSchemaDefinition('partiallyAccessibleWith', getPersonalProfileSchemaDefinition()),
...getPrefixedSchemaDefinition(
'offersActivitiesForPeopleWith',
getPersonalProfileSchemaDefinition(),
),
wheelchairAccessibilityGrade: {
type: 'string',
optional: true,
allowedValues: (WheelchairAccessibilityGrades as any) as any[],
},
smokingPolicy: {
type: String,
optional: true,
allowedValues: ((smokingPolicies as any) as any[]),
},
isWellLit: BooleanField,
isQuiet: BooleanField,
hasSoundAbsorption: BooleanField,
hasAirConditioning: BooleanField,
hasInductionLoop: BooleanField,
hasBrailleSignage: BooleanField,
hasTactileSignage: BooleanField,
hasTactileGuideStrips: BooleanField,
hasPatientLifter: BooleanField,
offersTreatmentWithoutLeavingWheelchair: BooleanField,
hasLowStimulusEnvironment: BooleanField,
hasBackgroundMusic: BooleanField,
...getPrefixedSchemaDefinition('staff', getStaffSchemaDefinition()),
...getPrefixedArraySchemaDefinition('availableEquipment', getEquipmentPropertiesSchemaDefinition()),
...getPrefixedSchemaDefinition('wheelchairPlaces', getWheelchairPlacesSchemaDefinition()),
...getPrefixedSchemaDefinition('payment', getPaymentSchemaDefinition()),
...getPrefixedSchemaDefinition('parking', getParkingSchemaDefinition()),
...getPrefixedSchemaDefinition('surface', getSurfaceSchemaDefinition()),
...getPrefixedSchemaDefinition('wifi', getWifiAccessibilitySchemaDefinition()),
...getPrefixedSchemaDefinition('queueSystem', getQueueSystemSchemaDefinition()),
...getPrefixedSchemaDefinition('animalPolicy', getAnimalPolicySchemaDefinition()),
...getPrefixedSchemaDefinition('pathways', getPathwaysSchemaDefinition()),
...getPrefixedSchemaDefinition('pathwaysInside', getPathwaysSchemaDefinition()),
...getPrefixedSchemaDefinition('pathwaysFromEntrance', getPathwaysSchemaDefinition()),
...getPrefixedArraySchemaDefinition('media', getMediaSchemaDefinition()),
...getPrefixedArraySchemaDefinition('desks', getDeskSchemaDefinition()),
...getPrefixedArraySchemaDefinition('tables', getDeskSchemaDefinition()),
...getPrefixedArraySchemaDefinition('signageSystems', getSignageSchemaDefinition()),
...getPrefixedArraySchemaDefinition('entrances', getEntranceSchemaDefinition()),
...getPrefixedArraySchemaDefinition('restrooms', getRestroomSchemaDefinition()),
...getPrefixedArraySchemaDefinition('rooms', getRoomSchemaDefinition()),
...getPrefixedQuantitySchemaDefinition('ambientNoiseLevel', VolumeSchema),
...getLocalizedStringSchemaDefinition('serviceContact'),
...getInteractableSchemaDefinition(GenericInteractionsSet),
...getPrefixedArraySchemaDefinition('appointmentPolicies', getAppointmentPolicySchemaDefinition()),
});