@vuetify/v0 0.0.15 → 0.0.18

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,1361 @@
1
+ import { i as ID } from "./index-C5LQZd3v.mjs";
2
+ import { App, ComputedRef, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef } from "vue";
3
+
4
+ //#region src/composables/createTrinity/index.d.ts
5
+
6
+ type ContextTrinity<Z = unknown> = readonly [() => Z, (context?: Z, app?: App) => Z, Z];
7
+ /**
8
+ * Creates a new trinity for a context composable and its provider.
9
+ *
10
+ * @param useContext The function that retrieves/uses the context (typically named `useContext`).
11
+ * @param provideContext The function that provides the context to descendants.
12
+ * @param context The default context instance to use when no custom context is provided.
13
+ * @template Z The type of the context.
14
+ * @returns A readonly tuple containing: [useContext function, provideContext wrapper function, default context instance].
15
+ *
16
+ * @remarks The trinity pattern is a foundational pattern used throughout the codebase for creating reusable context systems. It provides three related elements:
17
+ *
18
+ * 1. A function to retrieve/use the context
19
+ * 2. A function to provide the context (with default value support)
20
+ * 3. The default context instance
21
+ *
22
+ * The returned tuple is readonly (using `as const`) to ensure proper type inference.
23
+ *
24
+ * @see https://0.vuetifyjs.com/composables/foundation/create-trinity#create-trinity
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * interface MyContext {
29
+ * foo: string
30
+ * bar: number
31
+ * }
32
+ *
33
+ * export function createMyFeature<E extends MyContext = MyContext>() {
34
+ * const [useContext, _provideContext] = createContext<E>('my-context')
35
+ *
36
+ * const context = { foo: 'hello', bar: 42 }
37
+ *
38
+ * function provideContext (_context: E = context, app?: App): E {
39
+ * return _provideContext(_context, app)
40
+ * }
41
+ *
42
+ * return createTrinity<E>(useContext, provideContext, context)
43
+ * }
44
+ * ```
45
+ */
46
+ declare function createTrinity<Z = unknown>(useContext: () => Z, provideContext: (_context?: Z, app?: App) => Z, context: Z): ContextTrinity<Z>;
47
+ //#endregion
48
+ //#region src/composables/useRegistry/index.d.ts
49
+ interface RegistryTicket<V = unknown> {
50
+ /** The unique identifier. Is randomly generated if not provided. */
51
+ id: ID;
52
+ /**
53
+ * The index of the ticket in the registry.
54
+ *
55
+ * @remarks Automatically managed by the registry. Updated during reindexing. It's not recommended to manually set this.
56
+ */
57
+ index: number;
58
+ /** The value associated with the ticket. If not provided, it defaults to the index. */
59
+ value: V;
60
+ /**
61
+ * Whether the value is derived from index.
62
+ *
63
+ * @remarks Set to true when no explicit value is provided during registration. It's not recommended to manually set this.
64
+ */
65
+ valueIsIndex: boolean;
66
+ }
67
+ interface RegistryContext<Z extends RegistryTicket = RegistryTicket> {
68
+ /**
69
+ * The collection of tickets in the registry
70
+ *
71
+ * @template ID The type of the ticket ID.
72
+ * @template Z The type of the registry ticket.
73
+ *
74
+ * @remarks Exposed for read-only access and advanced use cases. **Warning:** Direct mutation may cause inconsistencies in indexes, catalogs, and caches. Always prefer using the provided methods (`register`, `unregister`, etc.) to maintain internal consistency.
75
+ */
76
+ collection: Map<ID, Z>;
77
+ /**
78
+ * Clear the entire registry
79
+ *
80
+ * @remarks Removes all tickets from the registry. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
81
+ *
82
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#clear
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * import { useRegistry } from '@vuetify/v0'
87
+ *
88
+ * const registry = useRegistry()
89
+ *
90
+ * registry.register({ id: 'ticket-1' })
91
+ * registry.register({ id: 'ticket-2' })
92
+ *
93
+ * console.log(registry.size) // 2
94
+ *
95
+ * registry.clear()
96
+ *
97
+ * console.log(registry.size) // 0
98
+ * ```
99
+ */
100
+ clear: () => void;
101
+ /**
102
+ * Check if a ticket exists by ID
103
+ *
104
+ * @param id The ID of the ticket to check.
105
+ * @remarks Calls `collection.has` internally.
106
+ *
107
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#has
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * import { useRegistry } from '@vuetify/v0'
112
+ *
113
+ * const registry = useRegistry()
114
+ *
115
+ * registry.register({ id: 'ticket-id' })
116
+ *
117
+ * const exists = registry.has('ticket-id') // true
118
+ * ```
119
+ */
120
+ has: (id: ID) => boolean;
121
+ /**
122
+ * Get all registered IDs
123
+ *
124
+ * @remarks Calls `collection.keys` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
125
+ *
126
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#keys
127
+ *
128
+ * @example
129
+ * ```ts
130
+ * import { useRegistry } from '@vuetify/v0'
131
+ *
132
+ * const registry = useRegistry()
133
+ *
134
+ * registry.register({ id: 'ticket-1' })
135
+ * registry.register({ id: 'ticket-2' })
136
+ *
137
+ * const ids = registry.keys() // ['ticket-1', 'ticket-2']
138
+ * ```
139
+ */
140
+ keys: () => ID[];
141
+ /**
142
+ * Browse for an ID(s) by value
143
+ *
144
+ * @param value The value to browse for.
145
+ * @remarks Returns a single ID or an array of IDs if multiple tickets share the same value.
146
+ *
147
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#browse
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * import { useRegistry } from '@vuetify/v0'
152
+ *
153
+ * const registry = useRegistry()
154
+ *
155
+ * registry.register({ id: 'ticket-1', value: 'common-value' })
156
+ * registry.register({ id: 'ticket-2', value: 'common-value' })
157
+ * registry.register({ id: 'ticket-3', value: 'unique-value' })
158
+ *
159
+ * const common = registry.browse('common-value') // ['ticket-1', 'ticket-2']
160
+ * const unique = registry.browse('unique-value') // ['ticket-3']
161
+ * ```
162
+ */
163
+ browse: (value: unknown) => ID[] | undefined;
164
+ /**
165
+ * lookup a ticket by index number
166
+ *
167
+ * @param index The index number to lookup.
168
+ * @remarks Maps do not support indexing by default, this method provides a way to retrieve an ID based on its index in the registry.
169
+ *
170
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#lookup
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * const registry = useRegistry()
175
+ *
176
+ * registry.register({ id: 'ticket-1' })
177
+ * registry.register({ id: 'ticket-2' })
178
+ *
179
+ * const ticket1 = registry.lookup(0) // 'ticket-1'
180
+ * const ticket2 = registry.lookup(1) // 'ticket-2'
181
+ * ```
182
+ */
183
+ lookup: (index: number) => ID | undefined;
184
+ /**
185
+ * Get a ticket by ID
186
+ *
187
+ * @param id The ID of the ticket to retrieve.
188
+ * @remarks Calls `collection.get` internally.
189
+ *
190
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#get
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * import { useRegistry } from '@vuetify/v0'
195
+ *
196
+ * const registry = useRegistry()
197
+ *
198
+ * registry.register({ id: 'ticket-id', value: 'some-value' })
199
+ *
200
+ * const ticket = registry.get('ticket-id') // { id: 'ticket-id', index: 0, value: 'some-value', ... }
201
+ * ```
202
+ */
203
+ get: (id: ID) => Z | undefined;
204
+ /**
205
+ * Update or insert a ticket by ID
206
+ *
207
+ * @param id The ID of the ticket to upsert.
208
+ * @param ticket The partial ticket data to update or insert.
209
+ * @remarks If the ticket exists, it will be updated with the provided data. If it doesn't exist, a new ticket will be created with the given ID and data. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
210
+ *
211
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#upsert
212
+ *
213
+ * @example
214
+ * ```ts
215
+ * import { useRegistry } from '@vuetify/v0'
216
+ *
217
+ * const registry = useRegistry()
218
+ *
219
+ * // Insert a new ticket
220
+ * const ticket = registry.upsert('ticket-id', { value: 'initial-value' })
221
+ *
222
+ * // Update the existing ticket
223
+ * const patched = registry.upsert('ticket-id', { value: 'updated-value' })
224
+ * ```
225
+ */
226
+ upsert: (id: ID, ticket?: Partial<Z>) => Z;
227
+ /**
228
+ * Get all values of registered tickets
229
+ *
230
+ * @remarks Calls `collection.values` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
231
+ *
232
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#values
233
+ *
234
+ * @example
235
+ * ```ts
236
+ * import { useRegistry } from '@vuetify/v0'
237
+ *
238
+ * const registry = useRegistry()
239
+ *
240
+ * registry.register({ id: 'ticket-1', value: 'value-1' })
241
+ * registry.register({ id: 'ticket-2', value: 'value-2' })
242
+ *
243
+ * const values = registry.values() // [{ id: 'ticket-1', ... }, { id: 'ticket-2', ... }]
244
+ * ```
245
+ */
246
+ values: () => Z[];
247
+ /**
248
+ * Get all entries of registered tickets
249
+ *
250
+ * @remarks Calls `collection.entries` internally with caching. First call is O(n), subsequent calls are O(1) until cache invalidation.
251
+ *
252
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#entries
253
+ *
254
+ * @example
255
+ * ```ts
256
+ * import { useRegistry } from '@vuetify/v0'
257
+ *
258
+ * const registry = useRegistry()
259
+ *
260
+ * registry.register({ id: 'ticket-1', value: 'value-1' })
261
+ * registry.register({ id: 'ticket-2', value: 'value-2' })
262
+ *
263
+ * const entries = registry.entries() // [['ticket-1', { id: 'ticket-1', ... }], ['ticket-2', { id: 'ticket-2', ... }]]
264
+ * ```
265
+ */
266
+ entries: () => [ID, Z][];
267
+ /**
268
+ * Register a new ticket
269
+ *
270
+ * @param ticket The partial ticket data to register.
271
+ * @remarks If no ID is provided, a unique ID will be generated automatically. If no value is provided, it defaults to the ticket's index. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
272
+ *
273
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#register
274
+ *
275
+ * @example
276
+ * ```ts
277
+ * import { useRegistry } from '@vuetify/v0'
278
+ *
279
+ * const registry = useRegistry()
280
+ *
281
+ * const ticket = registry.register()
282
+ *
283
+ * console.log(ticket) // { id: 'generated-id', index: 0, value: 0, valueIsIndex: true }
284
+ * ```
285
+ */
286
+ register: (ticket?: Partial<Z>) => Z;
287
+ /**
288
+ * Unregister an ticket by ID
289
+ *
290
+ * @param id The ID of the ticket to unregister.
291
+ * @remarks Removes the ticket from the registry and reindexes the remaining tickets. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
292
+ *
293
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#unregister
294
+ *
295
+ * @example
296
+ * ```ts
297
+ * import { useRegistry } from '@vuetify/v0'
298
+ *
299
+ * const registry = useRegistry()
300
+ *
301
+ * registry.register({ id: 'ticket-id' })
302
+ *
303
+ * registry.unregister('ticket-id')
304
+ * ```
305
+ */
306
+ unregister: (id: ID) => void;
307
+ /**
308
+ * Reset the index directory and update all tickets
309
+ *
310
+ * @remarks Rebuilds the internal index mapping and ensures all tickets have correct index values. This operation invalidates cached results from `keys()`, `values()`, and `entries()`.
311
+ *
312
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#reindex
313
+ *
314
+ * @example
315
+ * ```ts
316
+ * import { useRegistry } from '@vuetify/v0'
317
+ *
318
+ * const registry = useRegistry()
319
+ *
320
+ * registry.register({ id: 'ticket-1' })
321
+ * registry.register({ id: 'ticket-2' })
322
+ *
323
+ * // After some operations that may affect indexing
324
+ * registry.reindex()
325
+ * ```
326
+ */
327
+ reindex: () => void;
328
+ /**
329
+ * Seek for a ticket based on direction and optional predicate
330
+ *
331
+ * @param direction The direction to seek ('first' or 'last'). Defaults to 'first'.
332
+ * @param from The index to start seeking from. Defaults to the beginning or end based on direction.
333
+ * @param predicate An optional function to test each ticket. The first ticket that satisfies the predicate will be returned.
334
+ * @remarks This method allows for flexible searching within the registry, either from the start or end, and can filter tickets based on custom criteria.
335
+ *
336
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#seek
337
+ *
338
+ * @example
339
+ * ```ts
340
+ * import { useRegistry } from '@vuetify/v0'
341
+ *
342
+ * const registry = useRegistry()
343
+ *
344
+ * registry.register({ id: 'ticket-1', value: 'apple' })
345
+ * registry.register({ id: 'ticket-2', value: 'banana' })
346
+ * registry.register({ id: 'ticket-3', value: 'cherry' })
347
+ *
348
+ * // Seek the first ticket
349
+ * const first = registry.seek('first')
350
+ *
351
+ * // Seek the last ticket
352
+ * const last = registry.seek('last')
353
+ *
354
+ * // Seek the first ticket with value 'banana'
355
+ * const banana = registry.seek('first', undefined, ticket => ticket.value === 'banana')
356
+ *
357
+ * // Seek from index 1 to find the next ticket with value starting with 'c'
358
+ * const cherry = registry.seek('first', 1, ticket => (ticket.value as string).startsWith('c'))
359
+ * ```
360
+ */
361
+ seek: (direction?: 'first' | 'last', from?: number, predicate?: (ticket: Z) => boolean) => Z | undefined;
362
+ /**
363
+ * Listen for registry events
364
+ *
365
+ * @param event The name of the event to listen for.
366
+ * @param cb The callback function to invoke when the event is emitted.
367
+ * @remarks Must be enabled via the `events` option when creating the registry.
368
+ * Supported events:
369
+ * - `register:ticket` - Emitted when a ticket is registered, receives the ticket as argument
370
+ * - `unregister:ticket` - Emitted when a ticket is unregistered, receives the ticket as argument
371
+ * - `update:ticket` - Emitted when a ticket is updated, receives the updated ticket as argument
372
+ * - `clear:registry` - Emitted when the registry is cleared
373
+ * - `reindex:registry` - Emitted when the registry is reindexed
374
+ *
375
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#on
376
+ *
377
+ * @example
378
+ * ```ts
379
+ * import { useRegistry } from '@vuetify/v0'
380
+ *
381
+ * const registry = useRegistry({ events: true })
382
+ *
383
+ * registry.on('register:ticket', (ticket) => {
384
+ * console.log('Ticket registered:', ticket)
385
+ * })
386
+ *
387
+ * registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
388
+ * ```
389
+ */
390
+ on: (event: string, cb: Function) => void;
391
+ /**
392
+ * Stop listening for registry events
393
+ *
394
+ * @param event The name of the event to stop listening for.
395
+ * @param cb The callback function to remove.
396
+ * @remarks Must be enabled via the `events` option when creating the registry.
397
+ *
398
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#off
399
+ *
400
+ * @example
401
+ * ```ts
402
+ * import { onScopeDispose } from 'vue'
403
+ * import { useRegistry } from '@vuetify/v0'
404
+ *
405
+ * const registry = useRegistry({ events: true })
406
+ *
407
+ * function onRegister(ticket) {
408
+ * console.log('Ticket registered:', ticket)
409
+ * }
410
+ *
411
+ * registry.on('register:ticket', onRegister)
412
+ *
413
+ * registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
414
+ *
415
+ * onScopeDispose(() => {
416
+ * registry.off('register:ticket', onRegister)
417
+ * })
418
+ * ```
419
+ */
420
+ off: (event: string, cb: Function) => void;
421
+ /**
422
+ * Emit an event with data
423
+ *
424
+ * @param event The name of the event to emit.
425
+ * @param data The data to pass to event listeners.
426
+ * @remarks Must be enabled via the `events` option when creating the registry.
427
+ *
428
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#emit
429
+ *
430
+ * @example
431
+ * ```ts
432
+ * import { useRegistry } from '@vuetify/v0'
433
+ *
434
+ * const registry = useRegistry({ events: true })
435
+ *
436
+ * registry.on('custom-event', (data) => {
437
+ * console.log('Custom event received:', data)
438
+ * })
439
+ *
440
+ * registry.emit('custom-event', { message: 'Hello, World!' }) // Console: Custom event received: { message: 'Hello, World!' }
441
+ * ```
442
+ */
443
+ emit: (event: string, data: unknown) => void;
444
+ /**
445
+ * Clears the registry and removes all listeners
446
+ *
447
+ * @remarks Disposes of the registry by clearing all tickets and removing all event listeners.
448
+ *
449
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#dispose
450
+ *
451
+ * @example
452
+ * ```ts
453
+ * import { onScopeDispose } from 'vue'
454
+ * import { useRegistry } from '@vuetify/v0'
455
+ *
456
+ * const registry = useRegistry({ events: true })
457
+ *
458
+ * registry.register({ id: 'ticket-id' })
459
+ *
460
+ * onScopeDispose(() => {
461
+ * registry.dispose()
462
+ * })
463
+ * ```
464
+ */
465
+ dispose: () => void;
466
+ /**
467
+ * Onboard multiple tickets at once
468
+ *
469
+ * @param registrations An array of partial ticket data to register.
470
+ * @remarks Registers multiple tickets in a single operation and returns the array of registered tickets.
471
+ *
472
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#onboard
473
+ *
474
+ * @example
475
+ * ```ts
476
+ * import { useRegistry } from '@vuetify/v0'
477
+ *
478
+ * const registry = useRegistry()
479
+ *
480
+ * const tickets = registry.onboard([
481
+ * { id: 'ticket-1', value: 'value-1' },
482
+ * { id: 'ticket-2', value: 'value-2' },
483
+ * ])
484
+ *
485
+ * console.log(tickets) // [{ id: 'ticket-1', ... }, { id: 'ticket-2', ... }]
486
+ * ```
487
+ */
488
+ onboard: (registrations: Partial<Z>[]) => Z[];
489
+ /**
490
+ * Offboard multiple tickets at once
491
+ *
492
+ * @param ids An array of ticket IDs to unregister.
493
+ * @remarks Unregisters multiple tickets in a single operation with optimized reindexing.
494
+ *
495
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#offboard
496
+ *
497
+ * @example
498
+ * ```ts
499
+ * import { useRegistry } from '@vuetify/v0'
500
+ *
501
+ * const registry = useRegistry()
502
+ *
503
+ * registry.onboard([
504
+ * { id: 'ticket-1', value: 'value-1' },
505
+ * { id: 'ticket-2', value: 'value-2' },
506
+ * { id: 'ticket-3', value: 'value-3' },
507
+ * ])
508
+ *
509
+ * registry.offboard(['ticket-1', 'ticket-3'])
510
+ *
511
+ * console.log(registry.size) // 1
512
+ * ```
513
+ */
514
+ offboard: (ids: ID[]) => void;
515
+ /**
516
+ * The number of tickets in the registry
517
+ *
518
+ * @remarks Reflects the current size of the internal ticket collection.
519
+ *
520
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#size
521
+ *
522
+ * @example
523
+ * ```ts
524
+ * import { useRegistry } from '@vuetify/v0'
525
+ *
526
+ * const registry = useRegistry()
527
+ *
528
+ * registry.register({ id: 'ticket-1' })
529
+ * registry.register({ id: 'ticket-2' })
530
+ *
531
+ * console.log(registry.size) // 2
532
+ * ```
533
+ */
534
+ size: number;
535
+ /**
536
+ * Execute operations in a batch, deferring cache invalidation and event emission until complete
537
+ *
538
+ * @param fn The function containing batch operations.
539
+ * @returns The return value of the batch function.
540
+ * @remarks Useful for bulk operations like onboard(). Invalidation and events happen once at the end, not after each operation.
541
+ *
542
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#batch
543
+ *
544
+ * @example
545
+ * ```ts
546
+ * import { useRegistry } from '@vuetify/v0'
547
+ *
548
+ * const registry = useRegistry({ events: true })
549
+ *
550
+ * // Without batch: N invalidations + N events
551
+ * // With batch: 1 invalidation + N events (after all registrations)
552
+ * const tickets = registry.batch(() => {
553
+ * return [
554
+ * registry.register({ id: 'a' }),
555
+ * registry.register({ id: 'b' }),
556
+ * registry.register({ id: 'c' }),
557
+ * ]
558
+ * })
559
+ * ```
560
+ */
561
+ batch: <R>(fn: () => R) => R;
562
+ }
563
+ interface RegistryOptions {
564
+ /**
565
+ * Enable event emission for registry operations
566
+ *
567
+ * @default false
568
+ * @remarks When enabled, the registry will emit events for operations like registration and unregistration. Listeners can be added using the `on` method.
569
+ *
570
+ * @example
571
+ * ```ts
572
+ * import { useRegistry } from '@vuetify/v0'
573
+ *
574
+ * const registry = useRegistry({ events: true })
575
+ *
576
+ * registry.on('register:ticket', (ticket) => {
577
+ * console.log('Ticket registered:', ticket)
578
+ * })
579
+ *
580
+ * registry.register({ id: 'ticket-id' }) // Console: Ticket registered: { id: 'ticket-id', ... }
581
+ * ```
582
+ */
583
+ events?: boolean;
584
+ }
585
+ interface RegistryContextOptions extends RegistryOptions {
586
+ namespace?: string;
587
+ }
588
+ /**
589
+ * Creates a new registry instance.
590
+ *
591
+ * @param options The options for the registry instance.
592
+ * @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
593
+ * @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
594
+ * @returns A new registry instance.
595
+ *
596
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#use-registry
597
+ *
598
+ * @example
599
+ * ```ts
600
+ * import { useRegistry } from '@vuetify/v0'
601
+ *
602
+ * const registry = useRegistry()
603
+ *
604
+ * const ticket1 = registry.register({ id: 'user-1', value: { name: 'John' } })
605
+ * const ticket2 = registry.register({ id: 'user-2', value: { name: 'Jane' } })
606
+ *
607
+ * console.log(registry.size) // 2
608
+ * console.log(registry.get('user-1')) // { id: 'user-1', index: 0, value: { name: 'John' }, ... }
609
+ * ```
610
+ */
611
+ declare function useRegistry<Z extends RegistryTicket = RegistryTicket, E extends RegistryContext<Z> = RegistryContext<Z>>(options?: RegistryOptions): E;
612
+ /**
613
+ * Creates a new registry context.
614
+ *
615
+ * @param options The options for the registry context, including `namespace` (defaults to `'v0:registry'`) and `events`.
616
+ * @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
617
+ * @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
618
+ * @returns A new registry context.
619
+ *
620
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#create-registry-context
621
+ *
622
+ * @example
623
+ * ```ts
624
+ * import { createRegistryContext } from '@vuetify/v0'
625
+ *
626
+ * // With default namespace 'v0:registry'
627
+ * export const [useItems, provideItems, items] = createRegistryContext()
628
+ *
629
+ * // Or with custom namespace
630
+ * export const [useItems, provideItems, items] = createRegistryContext({ namespace: 'my-items' })
631
+ *
632
+ * // In a parent component:
633
+ * provideItems()
634
+ *
635
+ * // In a child component:
636
+ * const items = useItems()
637
+ * items.register({ id: 'item-1', value: 'Value 1' })
638
+ * ```
639
+ */
640
+ declare function createRegistryContext<Z extends RegistryTicket = RegistryTicket, E extends RegistryContext<Z> = RegistryContext<Z>>(_options?: RegistryContextOptions): ContextTrinity<E>;
641
+ //#endregion
642
+ //#region src/composables/useSelection/index.d.ts
643
+ interface SelectionTicket<V = unknown> extends RegistryTicket<V> {
644
+ /** Disabled state of the ticket */
645
+ disabled: MaybeRef<boolean>;
646
+ /** Whether the ticket is currently selected */
647
+ isSelected: Readonly<Ref<boolean, boolean>>;
648
+ /** Select self */
649
+ select: () => void;
650
+ /** Unselect self */
651
+ unselect: () => void;
652
+ /** Toggle self on and off */
653
+ toggle: () => void;
654
+ }
655
+ interface SelectionContext<Z extends SelectionTicket> extends RegistryContext<Z> {
656
+ /** Set of selected ticket IDs */
657
+ selectedIds: Reactive<Set<ID>>;
658
+ /** Set of selected ticket instances */
659
+ selectedItems: ComputedRef<Set<Z>>;
660
+ /** Set of selected ticket values */
661
+ selectedValues: ComputedRef<Set<unknown>>;
662
+ /** Disable state for the entire selection instance */
663
+ disabled: MaybeRef<boolean>;
664
+ /** Clear all selected IDs and reindexes */
665
+ reset: () => void;
666
+ /** Select a ticket by ID (Toggle ON) */
667
+ select: (id: ID) => void;
668
+ /** Unselect a ticket by ID (Toggle OFF) */
669
+ unselect: (id: ID) => void;
670
+ /** Toggles a ticket ON and OFF by ID */
671
+ toggle: (id: ID) => void;
672
+ /** Check if a ticket is selected by ID */
673
+ selected: (id: ID) => boolean;
674
+ /** Mandates selected ID based on "mandatory" Option */
675
+ mandate: () => void;
676
+ }
677
+ interface SelectionOptions extends RegistryOptions {
678
+ /** When true, the entire selection instance is disabled. */
679
+ disabled?: MaybeRef<boolean>;
680
+ /**
681
+ * When true, newly registered items are automatically selected if not disabled.
682
+ * Useful for pre-selecting items in multi-select scenarios.
683
+ */
684
+ enroll?: boolean;
685
+ /**
686
+ * Controls mandatory selection behavior:
687
+ * - `false` (default): No mandatory selection enforcement
688
+ * - `true`: Prevents deselecting the last selected item (user must always have one selected)
689
+ * - `'force'`: Automatically selects the first non-disabled item on registration
690
+ */
691
+ mandatory?: boolean | 'force';
692
+ /** When true, treats the selection as an array */
693
+ multiple?: boolean;
694
+ }
695
+ interface SelectionContextOptions extends SelectionOptions {
696
+ namespace?: string;
697
+ }
698
+ /**
699
+ * Creates a new selection instance for managing multiple selected items.
700
+ *
701
+ * Extends `useRegistry` with selection tracking via a reactive `Set` of selected IDs.
702
+ * Supports disabled items, mandatory selection enforcement, and auto-enrollment.
703
+ *
704
+ * @param options The options for the selection instance.
705
+ * @template Z The type of the selection ticket.
706
+ * @template E The type of the selection context.
707
+ * @returns A new selection instance with selection management methods.
708
+ *
709
+ * @remarks
710
+ * **Key Features:**
711
+ * - Multi-selection support (unlike `useSingle` which enforces single selection)
712
+ * - Set-based `selectedIds` tracking for efficient lookups
713
+ * - Computed `selectedItems` and `selectedValues` for reactive access
714
+ * - Each ticket gets `isSelected`, `select()`, `unselect()`, and `toggle()` methods
715
+ * - Disabled items cannot be selected
716
+ * - Mandatory mode prevents deselecting the last item
717
+ * - Force mode auto-selects first non-disabled item on registration
718
+ * - Enroll option auto-selects all non-disabled items on registration
719
+ *
720
+ * **Inheritance Chain:**
721
+ * `useRegistry` → `createSelection` → `createSingle`/`createGroup` → `createStep`
722
+ *
723
+ * @see https://0.vuetifyjs.com/composables/selection/use-selection
724
+ *
725
+ * @example
726
+ * ```ts
727
+ * import { createSelection } from '@vuetify/v0'
728
+ *
729
+ * const selection = createSelection({ mandatory: true })
730
+ *
731
+ * selection.onboard([
732
+ * { id: 'item-1', value: 'Item 1' },
733
+ * { id: 'item-2', value: 'Item 2', disabled: true },
734
+ * { id: 'item-3', value: 'Item 3' },
735
+ * ])
736
+ *
737
+ * selection.select('item-1')
738
+ * selection.select('item-3')
739
+ *
740
+ * console.log(selection.selectedIds) // Set { 'item-1', 'item-3' }
741
+ * console.log(Array.from(selection.selectedValues.value)) // ['Item 1', 'Item 3']
742
+ * ```
743
+ */
744
+ declare function createSelection<Z extends SelectionTicket = SelectionTicket, E extends SelectionContext<Z> = SelectionContext<Z>>(_options?: SelectionOptions): E;
745
+ /**
746
+ * Creates a new selection context.
747
+ *
748
+ * @param options The options for the selection context.
749
+ * @template Z The type of the selection ticket.
750
+ * @template E The type of the selection context.
751
+ * @returns A new selection context.
752
+ *
753
+ * @see https://0.vuetifyjs.com/composables/selection/use-selection
754
+ *
755
+ * @example
756
+ * ```ts
757
+ * import { createSelectionContext } from '@vuetify/v0'
758
+ *
759
+ * // With default namespace 'v0:selection'
760
+ * export const [useCheckboxes, provideCheckboxes, checkboxes] = createSelectionContext()
761
+ *
762
+ * // Or with custom namespace
763
+ * export const [useCheckboxes, provideCheckboxes, checkboxes] = createSelectionContext({ namespace: 'checkboxes' })
764
+ *
765
+ * // In a parent component:
766
+ * provideCheckboxes()
767
+ *
768
+ * // In a child component:
769
+ * const checkboxes = useCheckboxes()
770
+ * checkboxes.select('checkbox-1')
771
+ * ```
772
+ */
773
+ declare function createSelectionContext<Z extends SelectionTicket = SelectionTicket, E extends SelectionContext<Z> = SelectionContext<Z>>(_options?: SelectionContextOptions): ContextTrinity<E>;
774
+ /**
775
+ * Returns the current selection instance.
776
+ *
777
+ * @param namespace The namespace for the selection context. Defaults to `'v0:selection'`.
778
+ * @returns The current selection instance.
779
+ *
780
+ * @see https://0.vuetifyjs.com/composables/selection/use-selection
781
+ *
782
+ * @example
783
+ * ```vue
784
+ * <script setup lang="ts">
785
+ * import { useSelection } from '@vuetify/v0'
786
+ *
787
+ * const selection = useSelection()
788
+ * </script>
789
+ *
790
+ * <template>
791
+ * <div>
792
+ * <p>Selected: {{ selection.selectedIds.size }}</p>
793
+ * </div>
794
+ * </template>
795
+ * ```
796
+ */
797
+ declare function useSelection<Z extends SelectionTicket = SelectionTicket, E extends SelectionContext<Z> = SelectionContext<Z>>(namespace?: string): E;
798
+ //#endregion
799
+ //#region src/composables/useGroup/index.d.ts
800
+ interface GroupTicket<V = unknown> extends SelectionTicket<V> {
801
+ /** Whether the ticket should start in mixed/indeterminate state */
802
+ indeterminate?: MaybeRef<boolean>;
803
+ /** Whether the ticket is in a mixed/indeterminate state */
804
+ isMixed: Readonly<Ref<boolean>>;
805
+ /** Set self to mixed/indeterminate state */
806
+ mix: () => void;
807
+ /** Clear mixed/indeterminate state from self */
808
+ unmix: () => void;
809
+ }
810
+ interface GroupContext<Z extends GroupTicket> extends SelectionContext<Z> {
811
+ selectedIndexes: ComputedRef<Set<number>>;
812
+ /** Select one or more Tickets by ID */
813
+ select: (ids: ID | ID[]) => void;
814
+ /** Unselect one or more Tickets by ID */
815
+ unselect: (ids: ID | ID[]) => void;
816
+ /** Toggle one or more Tickets ON and OFF by ID */
817
+ toggle: (ids: ID | ID[]) => void;
818
+ /** Set of mixed/indeterminate ticket IDs */
819
+ mixedIds: Reactive<Set<ID>>;
820
+ /** Set of mixed/indeterminate ticket instances */
821
+ mixedItems: ComputedRef<Set<Z>>;
822
+ /** Set one or more Tickets to mixed/indeterminate state by ID */
823
+ mix: (ids: ID | ID[]) => void;
824
+ /** Clear mixed/indeterminate state from one or more Tickets by ID */
825
+ unmix: (ids: ID | ID[]) => void;
826
+ /** Check if a ticket is in mixed/indeterminate state by ID */
827
+ mixed: (id: ID) => boolean;
828
+ /** Whether no items are currently selected */
829
+ isNoneSelected: ComputedRef<boolean>;
830
+ /** Whether all selectable (non-disabled) items are selected */
831
+ isAllSelected: ComputedRef<boolean>;
832
+ /** Whether some but not all selectable items are selected */
833
+ isMixed: ComputedRef<boolean>;
834
+ /** Select all selectable (non-disabled) items */
835
+ selectAll: () => void;
836
+ /** Unselect all items (respects mandatory option) */
837
+ unselectAll: () => void;
838
+ /** Toggle between all selected and none selected */
839
+ toggleAll: () => void;
840
+ }
841
+ interface GroupOptions extends SelectionOptions {}
842
+ interface GroupContextOptions extends SelectionContextOptions {}
843
+ /**
844
+ * Creates a new group instance with batch selection and tri-state support.
845
+ *
846
+ * Extends `createSelection` to support selecting, unselecting, and toggling multiple items
847
+ * at once by passing an array of IDs. Adds tri-state (mixed/indeterminate) support for
848
+ * checkbox trees and similar use cases.
849
+ *
850
+ * @param options The options for the group instance.
851
+ * @template Z The type of the group ticket.
852
+ * @template E The type of the group context.
853
+ * @returns A new group instance with batch selection and tri-state support.
854
+ *
855
+ * @remarks
856
+ * **Key Differences from `createSelection`:**
857
+ * - `select()` accepts `ID | ID[]` for batch operations
858
+ * - `unselect()` accepts `ID | ID[]` for batch operations
859
+ * - `toggle()` accepts `ID | ID[]` for batch operations
860
+ * - Adds `selectedIndexes` computed Set for getting selected item indexes
861
+ * - Adds tri-state support via `mix()`, `unmix()`, `mixed()`, `mixedIds`, `mixedItems`
862
+ * - Perfect for checkbox trees, multi-select dropdowns, and bulk operations
863
+ *
864
+ * **Tri-State Support:**
865
+ * - Items can be in one of three states: selected, mixed (indeterminate), or unselected
866
+ * - `mix(id)` sets item to mixed state (clears selected if set)
867
+ * - `unmix(id)` clears mixed state
868
+ * - `select(id)` clears mixed state before selecting
869
+ * - `toggle(id)` on a mixed item selects it (resolves the indeterminate state positively)
870
+ * - Mixed state works on disabled items (it's a computed state, not user action)
871
+ *
872
+ * **Batch Operations:**
873
+ * - Single ID: `group.select('item-1')`
874
+ * - Array of IDs: `group.select(['item-1', 'item-2', 'item-3'])`
875
+ * - Uses `toArray()` utility internally to normalize input
876
+ * - Disabled items are automatically skipped in select operations
877
+ * - Non-existent IDs are silently ignored
878
+ *
879
+ * **Inheritance Chain:**
880
+ * `useRegistry` → `createSelection` → `createGroup`
881
+ *
882
+ * **Used By:**
883
+ * - `createFeatures` for feature flag management with multiple selections
884
+ *
885
+ * @see https://0.vuetifyjs.com/composables/selection/use-group
886
+ *
887
+ * @example
888
+ * ```ts
889
+ * import { createGroup } from '@vuetify/v0'
890
+ *
891
+ * const checkboxes = createGroup()
892
+ *
893
+ * checkboxes.onboard([
894
+ * { id: 'option-a', value: 'Option A' },
895
+ * { id: 'option-b', value: 'Option B' },
896
+ * { id: 'option-c', value: 'Option C' },
897
+ * ])
898
+ *
899
+ * // Select multiple items at once
900
+ * checkboxes.select(['option-a', 'option-c'])
901
+ *
902
+ * console.log(checkboxes.selectedIds) // Set { 'option-a', 'option-c' }
903
+ * console.log(Array.from(checkboxes.selectedIndexes.value)) // [0, 2]
904
+ *
905
+ * // Set item to mixed/indeterminate state
906
+ * checkboxes.mix('option-a')
907
+ * console.log(checkboxes.mixedIds) // Set { 'option-a' }
908
+ * console.log(checkboxes.selectedIds) // Set { 'option-c' } (option-a removed)
909
+ *
910
+ * // Toggle a mixed item selects it
911
+ * checkboxes.toggle('option-a')
912
+ * console.log(checkboxes.selectedIds) // Set { 'option-a', 'option-c' }
913
+ * console.log(checkboxes.mixedIds) // Set {} (cleared)
914
+ * ```
915
+ */
916
+ declare function createGroup<Z extends GroupTicket = GroupTicket, E extends GroupContext<Z> = GroupContext<Z>>(_options?: GroupOptions): E;
917
+ /**
918
+ * Creates a new group context.
919
+ *
920
+ * @param options The options for the group context.
921
+ * @template Z The type of the group ticket.
922
+ * @template E The type of the group context.
923
+ * @returns A new group context.
924
+ *
925
+ * @see https://0.vuetifyjs.com/composables/selection/use-group
926
+ *
927
+ * @example
928
+ * ```ts
929
+ * import { createGroupContext } from '@vuetify/v0'
930
+ *
931
+ * // With default namespace 'v0:group'
932
+ * export const [useMyGroup, provideMyGroup, myGroup] = createGroupContext()
933
+ *
934
+ * // Or with custom namespace
935
+ * export const [useMyGroup, provideMyGroup, myGroup] = createGroupContext({ namespace: 'my-group' })
936
+ *
937
+ * // In a parent component:
938
+ * provideMyGroup()
939
+ *
940
+ * // In a child component:
941
+ * const group = useMyGroup()
942
+ * ```
943
+ */
944
+ declare function createGroupContext<Z extends GroupTicket = GroupTicket, E extends GroupContext<Z> = GroupContext<Z>>(_options?: GroupContextOptions): ContextTrinity<E>;
945
+ /**
946
+ * Returns the current group instance.
947
+ *
948
+ * @param namespace The namespace for the group context. Defaults to `'v0:group'`.
949
+ * @returns The current group instance.
950
+ *
951
+ * @see https://0.vuetifyjs.com/composables/selection/use-group
952
+ *
953
+ * @example
954
+ * ```vue
955
+ * <script setup lang="ts">
956
+ * import { useGroup } from '@vuetify/v0'
957
+ *
958
+ * const group = useGroup()
959
+ * </script>
960
+ *
961
+ * <template>
962
+ * <div>
963
+ * <p>Selected: {{ group.selectedIds.size }}</p>
964
+ * </div>
965
+ * </template>
966
+ * ```
967
+ */
968
+ declare function useGroup<Z extends GroupTicket = GroupTicket, E extends GroupContext<Z> = GroupContext<Z>>(namespace?: string): E;
969
+ //#endregion
970
+ //#region src/composables/usePagination/index.d.ts
971
+ type PaginationTicket = {
972
+ type: 'page';
973
+ value: number;
974
+ } | {
975
+ type: 'ellipsis';
976
+ value: string;
977
+ };
978
+ interface PaginationContext {
979
+ /** Current page (1-indexed) */
980
+ page: ShallowRef<number>;
981
+ /** Items per page */
982
+ itemsPerPage: number;
983
+ /** Total number of items */
984
+ size: number;
985
+ /** Total number of pages (computed from size / itemsPerPage) */
986
+ pages: number;
987
+ /** Ellipsis character, or false if disabled */
988
+ ellipsis: string | false;
989
+ /** Visible page numbers and ellipsis for rendering */
990
+ items: ComputedRef<PaginationTicket[]>;
991
+ /** Start index of items on current page (0-indexed) */
992
+ pageStart: ComputedRef<number>;
993
+ /** End index of items on current page (exclusive, 0-indexed) */
994
+ pageStop: ComputedRef<number>;
995
+ /** Whether current page is the first page */
996
+ isFirst: ComputedRef<boolean>;
997
+ /** Whether current page is the last page */
998
+ isLast: ComputedRef<boolean>;
999
+ /** Go to first page */
1000
+ first: () => void;
1001
+ /** Go to last page */
1002
+ last: () => void;
1003
+ /** Go to next page */
1004
+ next: () => void;
1005
+ /** Go to previous page */
1006
+ prev: () => void;
1007
+ /** Go to specific page */
1008
+ select: (value: number) => void;
1009
+ }
1010
+ interface PaginationOptions {
1011
+ /** Initial page or ref for v-model (1-indexed). @default 1 */
1012
+ page?: number | ShallowRef<number>;
1013
+ /** Items per page. @default 10 */
1014
+ itemsPerPage?: MaybeRefOrGetter<number>;
1015
+ /** Total number of items. @default 0 */
1016
+ size?: MaybeRefOrGetter<number>;
1017
+ /** Maximum visible page buttons. @default 5 */
1018
+ visible?: MaybeRefOrGetter<number>;
1019
+ /** Ellipsis character. @default '…' */
1020
+ ellipsis?: string | false;
1021
+ }
1022
+ interface PaginationContextOptions extends PaginationOptions {
1023
+ /** Namespace for dependency injection */
1024
+ namespace?: string;
1025
+ }
1026
+ /**
1027
+ * Creates a pagination instance.
1028
+ *
1029
+ * @param options The options for the pagination instance.
1030
+ * @returns A pagination context with navigation methods.
1031
+ *
1032
+ * @example
1033
+ * ```ts
1034
+ * import { createPagination } from '@vuetify/v0'
1035
+ *
1036
+ * // Basic usage
1037
+ * const pagination = createPagination({ size: 100 })
1038
+ * pagination.next()
1039
+ * pagination.items.value // [{ type: 'page', value: 1 }, { type: 'page', value: 2 }, ...]
1040
+ *
1041
+ * // With v-model (pass a ref)
1042
+ * const page = ref(1)
1043
+ * const pagination = createPagination({ page, size: 100 })
1044
+ * // Mutating pagination.page or the passed ref syncs both
1045
+ * ```
1046
+ */
1047
+ declare function createPagination(_options?: PaginationOptions): PaginationContext;
1048
+ /**
1049
+ * Creates a pagination context for dependency injection.
1050
+ *
1051
+ * @param options The options including namespace.
1052
+ * @returns A trinity: [usePagination, providePagination, defaultContext]
1053
+ *
1054
+ * @example
1055
+ * ```ts
1056
+ * // With default namespace 'v0:pagination'
1057
+ * const [usePagination, providePaginationContext] = createPaginationContext({ size: 50 })
1058
+ *
1059
+ * // Or with custom namespace
1060
+ * const [usePagination, providePaginationContext] = createPaginationContext({
1061
+ * namespace: 'my-pagination',
1062
+ * size: 50,
1063
+ * })
1064
+ *
1065
+ * // Parent component
1066
+ * providePaginationContext()
1067
+ *
1068
+ * // Child component
1069
+ * const pagination = usePagination()
1070
+ * pagination.next()
1071
+ * ```
1072
+ */
1073
+ declare function createPaginationContext(_options?: PaginationContextOptions): ContextTrinity<PaginationContext>;
1074
+ /**
1075
+ * Returns the current pagination instance from context.
1076
+ *
1077
+ * @param namespace The namespace. @default 'v0:pagination'
1078
+ * @returns The pagination context.
1079
+ *
1080
+ * @example
1081
+ * ```vue
1082
+ * <script setup>
1083
+ * import { usePagination } from '@vuetify/v0'
1084
+ *
1085
+ * const pagination = usePagination()
1086
+ * </script>
1087
+ *
1088
+ * <template>
1089
+ * <button @click="pagination.prev()" :disabled="pagination.isFirst.value">Prev</button>
1090
+ * <button @click="pagination.next()" :disabled="pagination.isLast.value">Next</button>
1091
+ * </template>
1092
+ * ```
1093
+ */
1094
+ declare function usePagination(namespace?: string): PaginationContext;
1095
+ //#endregion
1096
+ //#region src/composables/useSingle/index.d.ts
1097
+ interface SingleTicket<V = unknown> extends SelectionTicket<V> {}
1098
+ interface SingleContext<Z extends SingleTicket> extends SelectionContext<Z> {
1099
+ selectedId: ComputedRef<ID | undefined>;
1100
+ selectedIndex: ComputedRef<number>;
1101
+ selectedItem: ComputedRef<Z | undefined>;
1102
+ selectedValue: ComputedRef<Z['value'] | undefined>;
1103
+ }
1104
+ interface SingleOptions extends SelectionOptions {}
1105
+ interface SingleContextOptions extends SelectionContextOptions {}
1106
+ /**
1107
+ * Creates a new single selection instance that enforces only one selected item at a time.
1108
+ *
1109
+ * Extends `createSelection` by automatically clearing previous selections when a new item is selected.
1110
+ * Adds computed singular properties: `selectedId`, `selectedItem`, `selectedIndex`, `selectedValue`.
1111
+ *
1112
+ * @param options The options for the single selection instance.
1113
+ * @template Z The type of the single selection ticket.
1114
+ * @template E The type of the single selection context.
1115
+ * @returns A new single selection instance with single-selection enforcement.
1116
+ *
1117
+ * @remarks
1118
+ * **Key Differences from `createSelection`:**
1119
+ * - Automatically clears `selectedIds` before selecting a new item (enforces single selection)
1120
+ * - Provides singular computed properties instead of plural sets
1121
+ * - Perfect for tabs, radio buttons, theme selectors, and other single-choice UI components
1122
+ *
1123
+ * **Computed Properties:**
1124
+ * - `selectedId`: The ID of the selected item (undefined if none selected)
1125
+ * - `selectedItem`: The selected ticket object (undefined if none selected)
1126
+ * - `selectedIndex`: The index of the selected item (-1 if none selected)
1127
+ * - `selectedValue`: The value of the selected item (undefined if none selected)
1128
+ *
1129
+ * **Inheritance Chain:**
1130
+ * `useRegistry` → `createSelection` → `createSingle` → `createStep`
1131
+ *
1132
+ * @see https://0.vuetifyjs.com/composables/selection/use-single
1133
+ *
1134
+ * @example
1135
+ * ```ts
1136
+ * import { createSingle } from '@vuetify/v0'
1137
+ *
1138
+ * const tabs = createSingle({ mandatory: true })
1139
+ *
1140
+ * tabs.onboard([
1141
+ * { id: 'home', value: 'Home' },
1142
+ * { id: 'about', value: 'About' },
1143
+ * { id: 'contact', value: 'Contact' },
1144
+ * ])
1145
+ *
1146
+ * tabs.first() // Select first tab
1147
+ *
1148
+ * console.log(tabs.selectedId.value) // 'home'
1149
+ * console.log(tabs.selectedIndex.value) // 0
1150
+ *
1151
+ * tabs.select('about') // Switch to about tab
1152
+ * console.log(tabs.selectedId.value) // 'about'
1153
+ * console.log(tabs.selectedIds.size) // 1 (always enforces single selection)
1154
+ * ```
1155
+ */
1156
+ declare function createSingle<Z extends SingleTicket = SingleTicket, E extends SingleContext<Z> = SingleContext<Z>>(_options?: SingleOptions): E;
1157
+ /**
1158
+ * Creates a new single selection context.
1159
+ *
1160
+ * @param options The options for the single selection context.
1161
+ * @template Z The type of the single selection ticket.
1162
+ * @template E The type of the single selection context.
1163
+ * @returns A new single selection context.
1164
+ *
1165
+ * @see https://0.vuetifyjs.com/composables/selection/use-single
1166
+ *
1167
+ * @example
1168
+ * ```ts
1169
+ * import { createSingleContext } from '@vuetify/v0'
1170
+ *
1171
+ * // With default namespace 'v0:single'
1172
+ * export const [useSingle, provideSingle, context] = createSingleContext()
1173
+ *
1174
+ * // In a parent component:
1175
+ * provideSingle()
1176
+ *
1177
+ * // In a child component:
1178
+ * const single = useSingle()
1179
+ * single.select('tab-1')
1180
+ * ```
1181
+ */
1182
+ declare function createSingleContext<Z extends SingleTicket = SingleTicket, E extends SingleContext<Z> = SingleContext<Z>>(_options?: SingleContextOptions): ContextTrinity<E>;
1183
+ /**
1184
+ * Returns the current single selection instance.
1185
+ *
1186
+ * @param namespace The namespace for the single selection context. Defaults to `'v0:single'`.
1187
+ * @returns The current single selection instance.
1188
+ *
1189
+ * @see https://0.vuetifyjs.com/composables/selection/use-single
1190
+ *
1191
+ * @example
1192
+ * ```vue
1193
+ * <script setup lang="ts">
1194
+ * import { useSingle } from '@vuetify/v0'
1195
+ *
1196
+ * const tabs = useSingle()
1197
+ * </script>
1198
+ *
1199
+ * <template>
1200
+ * <div>
1201
+ * <p>Selected: {{ tabs.selectedId }}</p>
1202
+ * </div>
1203
+ * </template>
1204
+ * ```
1205
+ */
1206
+ declare function useSingle<Z extends SingleTicket = SingleTicket, E extends SingleContext<Z> = SingleContext<Z>>(namespace?: string): E;
1207
+ //#endregion
1208
+ //#region src/composables/useStep/index.d.ts
1209
+ interface StepTicket<V = unknown> extends SingleTicket<V> {}
1210
+ interface StepContext<Z extends StepTicket> extends SingleContext<Z> {
1211
+ /** Select the first Ticket in the collection */
1212
+ first: () => void;
1213
+ /** Select the last Ticket in the collection */
1214
+ last: () => void;
1215
+ /** Select the next Ticket based on current index */
1216
+ next: () => void;
1217
+ /** Select the previous Ticket based on current index */
1218
+ prev: () => void;
1219
+ /** Step through the collection by a given count */
1220
+ step: (count: number) => void;
1221
+ }
1222
+ interface StepOptions extends SingleOptions {
1223
+ /**
1224
+ * Enable circular navigation (wrapping at boundaries).
1225
+ * - true: Navigation wraps around (carousel behavior)
1226
+ * - false: Navigation stops at boundaries (pagination behavior)
1227
+ * @default false
1228
+ */
1229
+ circular?: boolean;
1230
+ }
1231
+ interface StepContextOptions extends SingleContextOptions {
1232
+ /**
1233
+ * Enable circular navigation (wrapping at boundaries).
1234
+ * - true: Navigation wraps around (carousel behavior)
1235
+ * - false: Navigation stops at boundaries (pagination behavior)
1236
+ * @default false
1237
+ */
1238
+ circular?: boolean;
1239
+ }
1240
+ /**
1241
+ * Creates a new step instance with navigation through items.
1242
+ *
1243
+ * Extends `createSingle` with `first()`, `last()`, `next()`, `prev()`, and `step(count)` methods
1244
+ * for sequential navigation. Supports both circular (wrapping) and bounded (stopping at edges) modes.
1245
+ *
1246
+ * @param options The options for the step instance.
1247
+ * @template Z The type of the step ticket.
1248
+ * @template E The type of the step context.
1249
+ * @returns A new step instance with navigation methods.
1250
+ *
1251
+ * @remarks
1252
+ * **Key Features:**
1253
+ * - **Configurable Navigation**: `circular: true` for wrapping, `false` for bounded (default: false)
1254
+ * - **Disabled Item Skipping**: Automatically skips disabled items during navigation
1255
+ * - **Bidirectional**: Forward (`next`, positive `step`) and backward (`prev`, negative `step`)
1256
+ * - **Safe Edge Cases**: Handles empty registries and all-disabled scenarios gracefully
1257
+ *
1258
+ * **Navigation Methods:**
1259
+ * - `first()`: Select first non-disabled item
1260
+ * - `last()`: Select last non-disabled item
1261
+ * - `next()`: Move to next item (wraps if circular, stops at end if bounded)
1262
+ * - `prev()`: Move to previous item (wraps if circular, stops at start if bounded)
1263
+ * - `step(count)`: Move by `count` positions (negative for backward)
1264
+ *
1265
+ * **Circular Mode (`circular: true`):**
1266
+ * - Uses modulo arithmetic for wrapping: `((index % length) + length) % length`
1267
+ * - Works correctly with negative indexes and large step counts
1268
+ * - Perfect for carousels, theme switchers, infinite scrolling
1269
+ *
1270
+ * **Bounded Mode (`circular: false`, default):**
1271
+ * - Navigation stops at boundaries (no wrapping)
1272
+ * - `next()` on last item does nothing
1273
+ * - `prev()` on first item does nothing
1274
+ * - Perfect for pagination, wizards with explicit completion, forms
1275
+ *
1276
+ * **Inheritance Chain:**
1277
+ * `useRegistry` → `createSelection` → `createSingle` → `createStep`
1278
+ *
1279
+ * @see https://0.vuetifyjs.com/composables/selection/use-step
1280
+ *
1281
+ * @example
1282
+ * ```ts
1283
+ * import { createStep } from '@vuetify/v0'
1284
+ *
1285
+ * // Bounded navigation (default) - for pagination
1286
+ * const pagination = createStep({ circular: false })
1287
+ * pagination.onboard([
1288
+ * { id: 'page-1', value: 1 },
1289
+ * { id: 'page-2', value: 2 },
1290
+ * { id: 'page-3', value: 3 },
1291
+ * ])
1292
+ * pagination.first() // Select page 1
1293
+ * pagination.prev() // Does nothing (already at first)
1294
+ * pagination.next() // Select page 2
1295
+ *
1296
+ * // Circular navigation - for carousels
1297
+ * const carousel = createStep({ circular: true })
1298
+ * carousel.onboard([
1299
+ * { id: 'slide-1', value: 'First' },
1300
+ * { id: 'slide-2', value: 'Second' },
1301
+ * { id: 'slide-3', value: 'Third' },
1302
+ * ])
1303
+ * carousel.first()
1304
+ * carousel.prev() // Wraps to 'slide-3'
1305
+ * carousel.next() // Wraps to 'slide-1'
1306
+ * ```
1307
+ */
1308
+ declare function createStep<Z extends StepTicket = StepTicket, E extends StepContext<Z> = StepContext<Z>>(_options?: StepOptions): E;
1309
+ /**
1310
+ * Creates a new step context.
1311
+ *
1312
+ * @param options The options for the step context.
1313
+ * @template Z The type of the step ticket.
1314
+ * @template E The type of the step context.
1315
+ * @returns A new step context.
1316
+ *
1317
+ * @see https://0.vuetifyjs.com/composables/selection/use-step
1318
+ *
1319
+ * @example
1320
+ * ```ts
1321
+ * import { createStepContext } from '@vuetify/v0'
1322
+ *
1323
+ * // With default namespace 'v0:step'
1324
+ * export const [useStep, provideStep, context] = createStepContext()
1325
+ *
1326
+ * // In a parent component:
1327
+ * provideStep()
1328
+ *
1329
+ * // In a child component:
1330
+ * const context = useStep()
1331
+ * context.next() // Progress to next step
1332
+ * ```
1333
+ */
1334
+ declare function createStepContext<Z extends StepTicket = StepTicket, E extends StepContext<Z> = StepContext<Z>>(_options?: StepContextOptions): ContextTrinity<E>;
1335
+ /**
1336
+ * Returns the current step instance.
1337
+ *
1338
+ * @param namespace The namespace for the step context. Defaults to `'v0:step'`.
1339
+ * @returns The current step instance.
1340
+ *
1341
+ * @see https://0.vuetifyjs.com/composables/selection/use-step
1342
+ *
1343
+ * @example
1344
+ * ```vue
1345
+ * <script setup lang="ts">
1346
+ * import { useStep } from '@vuetify/v0'
1347
+ *
1348
+ * const wizard = useStep()
1349
+ * </script>
1350
+ *
1351
+ * <template>
1352
+ * <div>
1353
+ * <p>Current step: {{ wizard.selectedIndex }}</p>
1354
+ * <button @click="wizard.next()">Next</button>
1355
+ * </div>
1356
+ * </template>
1357
+ * ```
1358
+ */
1359
+ declare function useStep<Z extends StepTicket = StepTicket, E extends StepContext<Z> = StepContext<Z>>(namespace?: string): E;
1360
+ //#endregion
1361
+ export { SelectionContextOptions as A, createRegistryContext as B, GroupContextOptions as C, createGroupContext as D, createGroup as E, useSelection as F, ContextTrinity as H, RegistryContext as I, RegistryContextOptions as L, SelectionTicket as M, createSelection as N, useGroup as O, createSelectionContext as P, RegistryOptions as R, GroupContext as S, GroupTicket as T, createTrinity as U, useRegistry as V, PaginationOptions as _, createStep as a, createPaginationContext as b, SingleContext as c, SingleTicket as d, createSingle as f, PaginationContextOptions as g, PaginationContext as h, StepTicket as i, SelectionOptions as j, SelectionContext as k, SingleContextOptions as l, useSingle as m, StepContextOptions as n, createStepContext as o, createSingleContext as p, StepOptions as r, useStep as s, StepContext as t, SingleOptions as u, PaginationTicket as v, GroupOptions as w, usePagination as x, createPagination as y, RegistryTicket as z };