@tileflow/interactions 0.0.0-bootstrap.0

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.
@@ -0,0 +1,506 @@
1
+ import { z } from 'zod/mini';
2
+
3
+ declare const tileflowInteractionSchemaVersion = 1;
4
+ /** Closed POI category vocabulary shared with Tileflow World v1. */
5
+ declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
6
+ type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
7
+ type TileflowPoiFilterRank = 0 | 1 | 2 | 3 | 4 | 5;
8
+ type TileflowPoiSizeRank = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
9
+ type TileflowPoiProperties = Readonly<Record<string, TileflowInteractionJsonValue>> & Readonly<{
10
+ category?: TileflowPoiCategory;
11
+ filter_rank?: TileflowPoiFilterRank;
12
+ icon?: string;
13
+ name?: string;
14
+ size_rank?: TileflowPoiSizeRank;
15
+ type?: string;
16
+ }>;
17
+ declare const tileflowInteractionLimits: {
18
+ readonly maxAnnotations: 1000;
19
+ readonly maxAriaLabelLength: 256;
20
+ readonly maxBindings: 100;
21
+ readonly maxCategories: 32;
22
+ readonly maxColorLength: 64;
23
+ readonly maxContentTextLength: 4096;
24
+ readonly maxDocumentBytes: 256000;
25
+ readonly maxDocumentDepth: 64;
26
+ readonly maxDocumentNodes: 20000;
27
+ readonly maxDocumentProperties: 50000;
28
+ readonly maxFeatureIdLength: 128;
29
+ readonly maxFieldSelectorLength: 128;
30
+ readonly maxIdLength: 64;
31
+ readonly maxTargetNameLength: 128;
32
+ readonly maxViewNameLength: 64;
33
+ };
34
+ type TileflowInteractionJsonPrimitive = boolean | null | number | string;
35
+ type TileflowInteractionJsonValue = TileflowInteractionJsonPrimitive | readonly TileflowInteractionJsonValue[] | {
36
+ readonly [key: string]: TileflowInteractionJsonValue;
37
+ };
38
+ type TileflowInteractionCoordinate = readonly [longitude: number, latitude: number];
39
+ type TileflowInteractionTextContent = {
40
+ kind: 'text';
41
+ text: string;
42
+ };
43
+ type TileflowInteractionFieldContent = {
44
+ fallback?: string;
45
+ field: string;
46
+ kind: 'field';
47
+ };
48
+ type TileflowInteractionViewContent = {
49
+ kind: 'view';
50
+ name: string;
51
+ };
52
+ type TileflowInteractionContent = TileflowInteractionTextContent | TileflowInteractionFieldContent | TileflowInteractionViewContent;
53
+ type TileflowAnnotationMarker = {
54
+ color?: string;
55
+ content?: TileflowInteractionContent;
56
+ };
57
+ type TileflowAnnotationSurface = {
58
+ content: TileflowInteractionContent;
59
+ };
60
+ type TileflowAnnotation<TData extends TileflowInteractionJsonValue = TileflowInteractionJsonValue> = {
61
+ ariaLabel: string;
62
+ coordinate: TileflowInteractionCoordinate;
63
+ data?: TData;
64
+ id: string;
65
+ kind: 'marker';
66
+ marker?: TileflowAnnotationMarker;
67
+ popup?: TileflowAnnotationSurface;
68
+ tooltip?: TileflowAnnotationSurface;
69
+ };
70
+ type TileflowInteractionTarget = {
71
+ id: string;
72
+ kind: 'annotation';
73
+ } | {
74
+ categories?: readonly TileflowPoiCategory[];
75
+ domain: string;
76
+ kind: 'semantic-feature';
77
+ } | {
78
+ kind: 'style-layer';
79
+ layerId: string;
80
+ } | {
81
+ kind: 'map';
82
+ };
83
+ type TileflowInteractionBinding = {
84
+ id: string;
85
+ popup?: TileflowAnnotationSurface;
86
+ target: TileflowInteractionTarget;
87
+ tooltip?: TileflowAnnotationSurface;
88
+ };
89
+ type TileflowInteractionTargetRef = {
90
+ id: string;
91
+ kind: 'annotation';
92
+ } | {
93
+ domain: string;
94
+ featureId: number | string;
95
+ kind: 'semantic-feature';
96
+ } | {
97
+ featureId: number | string;
98
+ kind: 'style-feature';
99
+ layerId: string;
100
+ } | {
101
+ coordinate: TileflowInteractionCoordinate;
102
+ kind: 'map';
103
+ };
104
+ type TileflowInteractionState = {
105
+ popup: TileflowInteractionTargetRef | null;
106
+ };
107
+ type TileflowInteractionAction = {
108
+ target: TileflowInteractionTargetRef;
109
+ type: 'open-popup';
110
+ } | {
111
+ type: 'close-popup';
112
+ };
113
+ type TileflowInteractionInputModality = 'keyboard' | 'pointer' | 'programmatic' | 'touch';
114
+ type TileflowResolvedAnnotationTarget<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = {
115
+ annotation: TAnnotation;
116
+ bindingId?: string;
117
+ coordinate: TAnnotation['coordinate'];
118
+ kind: 'annotation';
119
+ };
120
+ type TileflowResolvedSemanticFeature = {
121
+ category?: string;
122
+ id?: number | string;
123
+ properties: Readonly<Record<string, TileflowInteractionJsonValue>>;
124
+ };
125
+ type TileflowResolvedPoiFeature = Omit<TileflowResolvedSemanticFeature, 'category' | 'properties'> & {
126
+ category: TileflowPoiCategory;
127
+ properties: TileflowPoiProperties;
128
+ };
129
+ type TileflowResolvedSemanticFeatureTarget = {
130
+ bindingId?: string;
131
+ coordinate: TileflowInteractionCoordinate;
132
+ domain: string;
133
+ feature: TileflowResolvedSemanticFeature;
134
+ kind: 'semantic-feature';
135
+ };
136
+ type TileflowResolvedPoiFeatureTarget = Omit<TileflowResolvedSemanticFeatureTarget, 'domain' | 'feature'> & {
137
+ domain: 'poi';
138
+ feature: TileflowResolvedPoiFeature;
139
+ };
140
+ type TileflowResolvedStyleFeatureTarget = {
141
+ bindingId?: string;
142
+ coordinate: TileflowInteractionCoordinate;
143
+ feature: {
144
+ id?: number | string;
145
+ properties: Readonly<Record<string, TileflowInteractionJsonValue>>;
146
+ };
147
+ kind: 'style-feature';
148
+ layerId: string;
149
+ };
150
+ type TileflowResolvedMapTarget = {
151
+ bindingId?: string;
152
+ coordinate: TileflowInteractionCoordinate;
153
+ kind: 'map';
154
+ };
155
+ type TileflowResolvedInteractionTarget<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = TileflowResolvedAnnotationTarget<TAnnotation> | TileflowResolvedSemanticFeatureTarget | TileflowResolvedStyleFeatureTarget | TileflowResolvedMapTarget;
156
+ type TileflowAnnotationViewContext<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = {
157
+ annotation: TAnnotation;
158
+ close: () => void;
159
+ content?: TileflowInteractionContent;
160
+ target: TileflowResolvedAnnotationTarget<TAnnotation>;
161
+ viewName?: string;
162
+ };
163
+ type TileflowInteractionViewContext<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = TileflowAnnotationViewContext<TAnnotation> | {
164
+ close: () => void;
165
+ content?: TileflowInteractionContent;
166
+ target: Exclude<TileflowResolvedInteractionTarget<TAnnotation>, TileflowResolvedAnnotationTarget<TAnnotation>>;
167
+ viewName?: string;
168
+ };
169
+ type TileflowInteractionEventType = 'popup:close' | 'popup:open' | 'target:activate' | 'target:blur' | 'target:enter' | 'target:focus' | 'target:leave';
170
+ type TileflowInteractionEvent<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = {
171
+ bindingId?: string;
172
+ coordinate: TileflowInteractionCoordinate;
173
+ inputModality?: TileflowInteractionInputModality;
174
+ target: TileflowResolvedInteractionTarget<TAnnotation>;
175
+ type: TileflowInteractionEventType;
176
+ };
177
+ type TileflowAnnotationInteractionEvent<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = Omit<TileflowInteractionEvent<TAnnotation>, 'target'> & {
178
+ target: TileflowResolvedAnnotationTarget<TAnnotation>;
179
+ };
180
+ declare const tileflowInteractionJsonValueSchema: z.ZodMiniType<TileflowInteractionJsonValue>;
181
+ declare const tileflowInteractionContentSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
182
+ kind: z.ZodMiniLiteral<"text">;
183
+ text: z.ZodMiniString<string>;
184
+ }, z.core.$strict>, z.ZodMiniObject<{
185
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
186
+ field: z.ZodMiniString<string>;
187
+ kind: z.ZodMiniLiteral<"field">;
188
+ }, z.core.$strict>, z.ZodMiniObject<{
189
+ kind: z.ZodMiniLiteral<"view">;
190
+ name: z.ZodMiniString<string>;
191
+ }, z.core.$strict>], "kind">;
192
+ declare const tileflowAnnotationSchema: z.ZodMiniObject<{
193
+ ariaLabel: z.ZodMiniString<string>;
194
+ coordinate: z.ZodMiniTuple<readonly [z.ZodMiniNumber<number>, z.ZodMiniNumber<number>], null>;
195
+ data: z.ZodMiniOptional<z.ZodMiniType<TileflowInteractionJsonValue, unknown, z.core.$ZodTypeInternals<TileflowInteractionJsonValue, unknown>>>;
196
+ id: z.ZodMiniString<string>;
197
+ kind: z.ZodMiniLiteral<"marker">;
198
+ marker: z.ZodMiniOptional<z.ZodMiniObject<{
199
+ color: z.ZodMiniOptional<z.ZodMiniString<string>>;
200
+ content: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
201
+ kind: z.ZodMiniLiteral<"text">;
202
+ text: z.ZodMiniString<string>;
203
+ }, z.core.$strict>, z.ZodMiniObject<{
204
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
205
+ field: z.ZodMiniString<string>;
206
+ kind: z.ZodMiniLiteral<"field">;
207
+ }, z.core.$strict>, z.ZodMiniObject<{
208
+ kind: z.ZodMiniLiteral<"view">;
209
+ name: z.ZodMiniString<string>;
210
+ }, z.core.$strict>], "kind">>;
211
+ }, z.core.$strict>>;
212
+ popup: z.ZodMiniOptional<z.ZodMiniObject<{
213
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
214
+ kind: z.ZodMiniLiteral<"text">;
215
+ text: z.ZodMiniString<string>;
216
+ }, z.core.$strict>, z.ZodMiniObject<{
217
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
218
+ field: z.ZodMiniString<string>;
219
+ kind: z.ZodMiniLiteral<"field">;
220
+ }, z.core.$strict>, z.ZodMiniObject<{
221
+ kind: z.ZodMiniLiteral<"view">;
222
+ name: z.ZodMiniString<string>;
223
+ }, z.core.$strict>], "kind">;
224
+ }, z.core.$strict>>;
225
+ tooltip: z.ZodMiniOptional<z.ZodMiniObject<{
226
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
227
+ kind: z.ZodMiniLiteral<"text">;
228
+ text: z.ZodMiniString<string>;
229
+ }, z.core.$strict>, z.ZodMiniObject<{
230
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
231
+ field: z.ZodMiniString<string>;
232
+ kind: z.ZodMiniLiteral<"field">;
233
+ }, z.core.$strict>, z.ZodMiniObject<{
234
+ kind: z.ZodMiniLiteral<"view">;
235
+ name: z.ZodMiniString<string>;
236
+ }, z.core.$strict>], "kind">;
237
+ }, z.core.$strict>>;
238
+ }, z.core.$strict>;
239
+ declare const tileflowAnnotationsSchema: z.ZodMiniArray<z.ZodMiniObject<{
240
+ ariaLabel: z.ZodMiniString<string>;
241
+ coordinate: z.ZodMiniTuple<readonly [z.ZodMiniNumber<number>, z.ZodMiniNumber<number>], null>;
242
+ data: z.ZodMiniOptional<z.ZodMiniType<TileflowInteractionJsonValue, unknown, z.core.$ZodTypeInternals<TileflowInteractionJsonValue, unknown>>>;
243
+ id: z.ZodMiniString<string>;
244
+ kind: z.ZodMiniLiteral<"marker">;
245
+ marker: z.ZodMiniOptional<z.ZodMiniObject<{
246
+ color: z.ZodMiniOptional<z.ZodMiniString<string>>;
247
+ content: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
248
+ kind: z.ZodMiniLiteral<"text">;
249
+ text: z.ZodMiniString<string>;
250
+ }, z.core.$strict>, z.ZodMiniObject<{
251
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
252
+ field: z.ZodMiniString<string>;
253
+ kind: z.ZodMiniLiteral<"field">;
254
+ }, z.core.$strict>, z.ZodMiniObject<{
255
+ kind: z.ZodMiniLiteral<"view">;
256
+ name: z.ZodMiniString<string>;
257
+ }, z.core.$strict>], "kind">>;
258
+ }, z.core.$strict>>;
259
+ popup: z.ZodMiniOptional<z.ZodMiniObject<{
260
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
261
+ kind: z.ZodMiniLiteral<"text">;
262
+ text: z.ZodMiniString<string>;
263
+ }, z.core.$strict>, z.ZodMiniObject<{
264
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
265
+ field: z.ZodMiniString<string>;
266
+ kind: z.ZodMiniLiteral<"field">;
267
+ }, z.core.$strict>, z.ZodMiniObject<{
268
+ kind: z.ZodMiniLiteral<"view">;
269
+ name: z.ZodMiniString<string>;
270
+ }, z.core.$strict>], "kind">;
271
+ }, z.core.$strict>>;
272
+ tooltip: z.ZodMiniOptional<z.ZodMiniObject<{
273
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
274
+ kind: z.ZodMiniLiteral<"text">;
275
+ text: z.ZodMiniString<string>;
276
+ }, z.core.$strict>, z.ZodMiniObject<{
277
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
278
+ field: z.ZodMiniString<string>;
279
+ kind: z.ZodMiniLiteral<"field">;
280
+ }, z.core.$strict>, z.ZodMiniObject<{
281
+ kind: z.ZodMiniLiteral<"view">;
282
+ name: z.ZodMiniString<string>;
283
+ }, z.core.$strict>], "kind">;
284
+ }, z.core.$strict>>;
285
+ }, z.core.$strict>>;
286
+ declare const tileflowInteractionTargetSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
287
+ id: z.ZodMiniString<string>;
288
+ kind: z.ZodMiniLiteral<"annotation">;
289
+ }, z.core.$strict>, z.ZodMiniObject<{
290
+ categories: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
291
+ "arts-entertainment": "arts-entertainment";
292
+ education: "education";
293
+ "food-drink": "food-drink";
294
+ landmark: "landmark";
295
+ lodging: "lodging";
296
+ medical: "medical";
297
+ "park-nature": "park-nature";
298
+ "public-services": "public-services";
299
+ religion: "religion";
300
+ retail: "retail";
301
+ "sport-leisure": "sport-leisure";
302
+ transport: "transport";
303
+ "visitor-amenity": "visitor-amenity";
304
+ }>>>;
305
+ domain: z.ZodMiniString<string>;
306
+ kind: z.ZodMiniLiteral<"semantic-feature">;
307
+ }, z.core.$strict>, z.ZodMiniObject<{
308
+ kind: z.ZodMiniLiteral<"style-layer">;
309
+ layerId: z.ZodMiniString<string>;
310
+ }, z.core.$strict>, z.ZodMiniObject<{
311
+ kind: z.ZodMiniLiteral<"map">;
312
+ }, z.core.$strict>], "kind">;
313
+ declare const tileflowInteractionBindingSchema: z.ZodMiniObject<{
314
+ id: z.ZodMiniString<string>;
315
+ popup: z.ZodMiniOptional<z.ZodMiniObject<{
316
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
317
+ kind: z.ZodMiniLiteral<"text">;
318
+ text: z.ZodMiniString<string>;
319
+ }, z.core.$strict>, z.ZodMiniObject<{
320
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
321
+ field: z.ZodMiniString<string>;
322
+ kind: z.ZodMiniLiteral<"field">;
323
+ }, z.core.$strict>, z.ZodMiniObject<{
324
+ kind: z.ZodMiniLiteral<"view">;
325
+ name: z.ZodMiniString<string>;
326
+ }, z.core.$strict>], "kind">;
327
+ }, z.core.$strict>>;
328
+ target: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
329
+ id: z.ZodMiniString<string>;
330
+ kind: z.ZodMiniLiteral<"annotation">;
331
+ }, z.core.$strict>, z.ZodMiniObject<{
332
+ categories: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
333
+ "arts-entertainment": "arts-entertainment";
334
+ education: "education";
335
+ "food-drink": "food-drink";
336
+ landmark: "landmark";
337
+ lodging: "lodging";
338
+ medical: "medical";
339
+ "park-nature": "park-nature";
340
+ "public-services": "public-services";
341
+ religion: "religion";
342
+ retail: "retail";
343
+ "sport-leisure": "sport-leisure";
344
+ transport: "transport";
345
+ "visitor-amenity": "visitor-amenity";
346
+ }>>>;
347
+ domain: z.ZodMiniString<string>;
348
+ kind: z.ZodMiniLiteral<"semantic-feature">;
349
+ }, z.core.$strict>, z.ZodMiniObject<{
350
+ kind: z.ZodMiniLiteral<"style-layer">;
351
+ layerId: z.ZodMiniString<string>;
352
+ }, z.core.$strict>, z.ZodMiniObject<{
353
+ kind: z.ZodMiniLiteral<"map">;
354
+ }, z.core.$strict>], "kind">;
355
+ tooltip: z.ZodMiniOptional<z.ZodMiniObject<{
356
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
357
+ kind: z.ZodMiniLiteral<"text">;
358
+ text: z.ZodMiniString<string>;
359
+ }, z.core.$strict>, z.ZodMiniObject<{
360
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
361
+ field: z.ZodMiniString<string>;
362
+ kind: z.ZodMiniLiteral<"field">;
363
+ }, z.core.$strict>, z.ZodMiniObject<{
364
+ kind: z.ZodMiniLiteral<"view">;
365
+ name: z.ZodMiniString<string>;
366
+ }, z.core.$strict>], "kind">;
367
+ }, z.core.$strict>>;
368
+ }, z.core.$strict>;
369
+ declare const tileflowInteractionBindingsSchema: z.ZodMiniArray<z.ZodMiniObject<{
370
+ id: z.ZodMiniString<string>;
371
+ popup: z.ZodMiniOptional<z.ZodMiniObject<{
372
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
373
+ kind: z.ZodMiniLiteral<"text">;
374
+ text: z.ZodMiniString<string>;
375
+ }, z.core.$strict>, z.ZodMiniObject<{
376
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
377
+ field: z.ZodMiniString<string>;
378
+ kind: z.ZodMiniLiteral<"field">;
379
+ }, z.core.$strict>, z.ZodMiniObject<{
380
+ kind: z.ZodMiniLiteral<"view">;
381
+ name: z.ZodMiniString<string>;
382
+ }, z.core.$strict>], "kind">;
383
+ }, z.core.$strict>>;
384
+ target: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
385
+ id: z.ZodMiniString<string>;
386
+ kind: z.ZodMiniLiteral<"annotation">;
387
+ }, z.core.$strict>, z.ZodMiniObject<{
388
+ categories: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
389
+ "arts-entertainment": "arts-entertainment";
390
+ education: "education";
391
+ "food-drink": "food-drink";
392
+ landmark: "landmark";
393
+ lodging: "lodging";
394
+ medical: "medical";
395
+ "park-nature": "park-nature";
396
+ "public-services": "public-services";
397
+ religion: "religion";
398
+ retail: "retail";
399
+ "sport-leisure": "sport-leisure";
400
+ transport: "transport";
401
+ "visitor-amenity": "visitor-amenity";
402
+ }>>>;
403
+ domain: z.ZodMiniString<string>;
404
+ kind: z.ZodMiniLiteral<"semantic-feature">;
405
+ }, z.core.$strict>, z.ZodMiniObject<{
406
+ kind: z.ZodMiniLiteral<"style-layer">;
407
+ layerId: z.ZodMiniString<string>;
408
+ }, z.core.$strict>, z.ZodMiniObject<{
409
+ kind: z.ZodMiniLiteral<"map">;
410
+ }, z.core.$strict>], "kind">;
411
+ tooltip: z.ZodMiniOptional<z.ZodMiniObject<{
412
+ content: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
413
+ kind: z.ZodMiniLiteral<"text">;
414
+ text: z.ZodMiniString<string>;
415
+ }, z.core.$strict>, z.ZodMiniObject<{
416
+ fallback: z.ZodMiniOptional<z.ZodMiniString<string>>;
417
+ field: z.ZodMiniString<string>;
418
+ kind: z.ZodMiniLiteral<"field">;
419
+ }, z.core.$strict>, z.ZodMiniObject<{
420
+ kind: z.ZodMiniLiteral<"view">;
421
+ name: z.ZodMiniString<string>;
422
+ }, z.core.$strict>], "kind">;
423
+ }, z.core.$strict>>;
424
+ }, z.core.$strict>>;
425
+ declare const tileflowInteractionTargetRefSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
426
+ id: z.ZodMiniString<string>;
427
+ kind: z.ZodMiniLiteral<"annotation">;
428
+ }, z.core.$strict>, z.ZodMiniObject<{
429
+ domain: z.ZodMiniString<string>;
430
+ featureId: z.ZodMiniUnion<readonly [z.ZodMiniNumberFormat, z.ZodMiniString<string>]>;
431
+ kind: z.ZodMiniLiteral<"semantic-feature">;
432
+ }, z.core.$strict>, z.ZodMiniObject<{
433
+ featureId: z.ZodMiniUnion<readonly [z.ZodMiniNumberFormat, z.ZodMiniString<string>]>;
434
+ kind: z.ZodMiniLiteral<"style-feature">;
435
+ layerId: z.ZodMiniString<string>;
436
+ }, z.core.$strict>, z.ZodMiniObject<{
437
+ coordinate: z.ZodMiniTuple<readonly [z.ZodMiniNumber<number>, z.ZodMiniNumber<number>], null>;
438
+ kind: z.ZodMiniLiteral<"map">;
439
+ }, z.core.$strict>], "kind">;
440
+ declare const tileflowInteractionStateSchema: z.ZodMiniObject<{
441
+ popup: z.ZodMiniNullable<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
442
+ id: z.ZodMiniString<string>;
443
+ kind: z.ZodMiniLiteral<"annotation">;
444
+ }, z.core.$strict>, z.ZodMiniObject<{
445
+ domain: z.ZodMiniString<string>;
446
+ featureId: z.ZodMiniUnion<readonly [z.ZodMiniNumberFormat, z.ZodMiniString<string>]>;
447
+ kind: z.ZodMiniLiteral<"semantic-feature">;
448
+ }, z.core.$strict>, z.ZodMiniObject<{
449
+ featureId: z.ZodMiniUnion<readonly [z.ZodMiniNumberFormat, z.ZodMiniString<string>]>;
450
+ kind: z.ZodMiniLiteral<"style-feature">;
451
+ layerId: z.ZodMiniString<string>;
452
+ }, z.core.$strict>, z.ZodMiniObject<{
453
+ coordinate: z.ZodMiniTuple<readonly [z.ZodMiniNumber<number>, z.ZodMiniNumber<number>], null>;
454
+ kind: z.ZodMiniLiteral<"map">;
455
+ }, z.core.$strict>], "kind">>;
456
+ }, z.core.$strict>;
457
+ declare const tileflowInteractionActionSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
458
+ target: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
459
+ id: z.ZodMiniString<string>;
460
+ kind: z.ZodMiniLiteral<"annotation">;
461
+ }, z.core.$strict>, z.ZodMiniObject<{
462
+ domain: z.ZodMiniString<string>;
463
+ featureId: z.ZodMiniUnion<readonly [z.ZodMiniNumberFormat, z.ZodMiniString<string>]>;
464
+ kind: z.ZodMiniLiteral<"semantic-feature">;
465
+ }, z.core.$strict>, z.ZodMiniObject<{
466
+ featureId: z.ZodMiniUnion<readonly [z.ZodMiniNumberFormat, z.ZodMiniString<string>]>;
467
+ kind: z.ZodMiniLiteral<"style-feature">;
468
+ layerId: z.ZodMiniString<string>;
469
+ }, z.core.$strict>, z.ZodMiniObject<{
470
+ coordinate: z.ZodMiniTuple<readonly [z.ZodMiniNumber<number>, z.ZodMiniNumber<number>], null>;
471
+ kind: z.ZodMiniLiteral<"map">;
472
+ }, z.core.$strict>], "kind">;
473
+ type: z.ZodMiniLiteral<"open-popup">;
474
+ }, z.core.$strict>, z.ZodMiniObject<{
475
+ type: z.ZodMiniLiteral<"close-popup">;
476
+ }, z.core.$strict>], "type">;
477
+
478
+ type TileflowInteractionDiagnosticCode = 'DUPLICATE_ANNOTATION_ID' | 'INVALID_FIELD' | 'INVALID_ANNOTATION' | 'INVALID_DOCUMENT' | 'LIMIT_EXCEEDED' | 'MISSING_VIEW' | 'OVERLAY_FAILURE' | 'SEMANTIC_MANIFEST_MISMATCH' | 'STALE_TARGET' | 'UNSTABLE_FEATURE_IDENTITY' | 'UNSUPPORTED_MODE' | 'UNSUPPORTED_TARGET';
479
+ type TileflowInteractionDiagnostic = {
480
+ code: TileflowInteractionDiagnosticCode;
481
+ level: 'error' | 'warning';
482
+ message: string;
483
+ /** RFC 6901 JSON Pointer. The empty string identifies the document root. */
484
+ path?: string;
485
+ target?: TileflowInteractionTargetRef;
486
+ };
487
+ type TileflowAnnotationValidationResult = {
488
+ annotations: TileflowAnnotation<TileflowInteractionJsonValue>[];
489
+ diagnostics: [];
490
+ ok: true;
491
+ } | {
492
+ diagnostics: TileflowInteractionDiagnostic[];
493
+ ok: false;
494
+ };
495
+ type TileflowInteractionBindingValidationResult = {
496
+ bindings: TileflowInteractionBinding[];
497
+ diagnostics: [];
498
+ ok: true;
499
+ } | {
500
+ diagnostics: TileflowInteractionDiagnostic[];
501
+ ok: false;
502
+ };
503
+ declare function validateTileflowAnnotations(input: unknown): TileflowAnnotationValidationResult;
504
+ declare function validateTileflowInteractionBindings(input: unknown): TileflowInteractionBindingValidationResult;
505
+
506
+ export { type TileflowPoiProperties as A, type TileflowPoiSizeRank as B, type TileflowResolvedAnnotationTarget as C, type TileflowResolvedInteractionTarget as D, type TileflowResolvedMapTarget as E, type TileflowResolvedPoiFeature as F, type TileflowResolvedPoiFeatureTarget as G, type TileflowResolvedSemanticFeature as H, type TileflowResolvedSemanticFeatureTarget as I, type TileflowResolvedStyleFeatureTarget as J, tileflowAnnotationSchema as K, tileflowAnnotationsSchema as L, tileflowInteractionActionSchema as M, tileflowInteractionBindingSchema as N, tileflowInteractionBindingsSchema as O, tileflowInteractionContentSchema as P, tileflowInteractionJsonValueSchema as Q, tileflowInteractionLimits as R, tileflowInteractionSchemaVersion as S, type TileflowInteractionState as T, tileflowInteractionStateSchema as U, tileflowInteractionTargetRefSchema as V, tileflowInteractionTargetSchema as W, tileflowPoiCategories as X, validateTileflowAnnotations as Y, validateTileflowInteractionBindings as Z, type TileflowInteractionAction as a, type TileflowInteractionTargetRef as b, type TileflowAnnotation as c, type TileflowAnnotationInteractionEvent as d, type TileflowAnnotationMarker as e, type TileflowAnnotationSurface as f, type TileflowAnnotationValidationResult as g, type TileflowAnnotationViewContext as h, type TileflowInteractionBinding as i, type TileflowInteractionBindingValidationResult as j, type TileflowInteractionContent as k, type TileflowInteractionCoordinate as l, type TileflowInteractionDiagnostic as m, type TileflowInteractionDiagnosticCode as n, type TileflowInteractionEvent as o, type TileflowInteractionEventType as p, type TileflowInteractionFieldContent as q, type TileflowInteractionInputModality as r, type TileflowInteractionJsonPrimitive as s, type TileflowInteractionJsonValue as t, type TileflowInteractionTarget as u, type TileflowInteractionTextContent as v, type TileflowInteractionViewContent as w, type TileflowInteractionViewContext as x, type TileflowPoiCategory as y, type TileflowPoiFilterRank as z };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@tileflow/interactions",
3
+ "version": "0.0.0-bootstrap.0",
4
+ "license": "Apache-2.0",
5
+ "description": "Portable annotation and interaction contracts for Tileflow maps.",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "homepage": "https://tileflow.dev",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/tileflow/tileflow-sdk.git",
12
+ "directory": "packages/interactions"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/tileflow/tileflow-sdk/issues"
16
+ },
17
+ "keywords": [
18
+ "tileflow",
19
+ "maps",
20
+ "annotations",
21
+ "interactions"
22
+ ],
23
+ "main": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
25
+ "files": [
26
+ "dist",
27
+ "LICENSE",
28
+ "NOTICE",
29
+ "GENERATED_OUTPUT_LICENSE.md",
30
+ "TRADEMARKS.md"
31
+ ],
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "default": "./dist/index.js"
37
+ },
38
+ "./maplibre": {
39
+ "types": "./dist/maplibre-entry.d.ts",
40
+ "import": "./dist/maplibre-entry.js",
41
+ "default": "./dist/maplibre-entry.js"
42
+ },
43
+ "./package.json": "./package.json"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "dependencies": {
49
+ "zod": "^4.4.3"
50
+ },
51
+ "peerDependencies": {
52
+ "maplibre-gl": ">=5 <7"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "maplibre-gl": {
56
+ "optional": true
57
+ }
58
+ },
59
+ "scripts": {
60
+ "build": "tsup src/index.ts src/maplibre-entry.ts --format esm --dts --clean --no-splitting",
61
+ "verify": "pnpm run build && tsx --test test/*.test.ts",
62
+ "typecheck": "tsc -p tsconfig.json --noEmit",
63
+ "lint": "tsc -p tsconfig.json --noEmit"
64
+ }
65
+ }