@fluentui/react-tabster 9.19.6 → 9.20.1

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.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { dispatchGroupperMoveFocusEvent } from 'tabster';
2
2
  import { dispatchMoverMoveFocusEvent } from 'tabster';
3
+ import { Events } from 'tabster';
3
4
  import type { GriffelStyle } from '@griffel/react';
4
5
  import { KEYBORG_FOCUSIN } from 'keyborg';
5
6
  import { KeyborgFocusInEvent } from 'keyborg';
6
7
  import { makeResetStyles } from '@griffel/react';
7
8
  import * as React_2 from 'react';
8
9
  import type { RefObject } from 'react';
9
- import { Types as TabsterTypes } from 'tabster';
10
+ import { Types } from 'tabster';
10
11
 
11
12
  /**
12
13
  * @internal
@@ -84,10 +85,348 @@ export declare interface CreateFocusOutlineStyleOptions extends Omit<CreateCusto
84
85
  enableOutline?: boolean;
85
86
  }
86
87
 
88
+ declare interface CrossOriginAPI {
89
+ focusedElement: CrossOriginFocusedElementState;
90
+ observedElement: CrossOriginObservedElementState;
91
+ setup(sendUp?: CrossOriginTransactionSend | null): (msg: CrossOriginMessage) => void;
92
+ isSetUp(): boolean;
93
+ dispose(): void;
94
+ }
95
+
96
+ declare interface CrossOriginElement {
97
+ readonly uid: string;
98
+ readonly ownerId: string;
99
+ readonly id?: string;
100
+ readonly rootId?: string;
101
+ readonly observedName?: string;
102
+ readonly observedDetails?: string;
103
+ focus(noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): Promise<boolean>;
104
+ }
105
+
106
+ declare interface CrossOriginFocusedElementState extends Subscribable<CrossOriginElement | undefined, FocusedElementDetails>, Disposable {
107
+ focus(element: CrossOriginElement, noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): Promise<boolean>;
108
+ focusById(elementId: string, rootId?: string, noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): Promise<boolean>;
109
+ focusByObservedName(observedName: string, timeout?: number, rootId?: string, noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): Promise<boolean>;
110
+ }
111
+
112
+ declare interface CrossOriginMessage {
113
+ data: CrossOriginTransactionData<any, any>;
114
+ send: CrossOriginTransactionSend;
115
+ }
116
+
117
+ declare interface CrossOriginObservedElementState extends Subscribable<CrossOriginElement, ObservedElementProps>, Disposable {
118
+ getElement(observedName: string, accessibility?: ObservedElementAccesibility): Promise<CrossOriginElement | null>;
119
+ waitElement(observedName: string, timeout: number, accessibility?: ObservedElementAccesibility): Promise<CrossOriginElement | null>;
120
+ requestFocus(observedName: string, timeout: number): Promise<boolean>;
121
+ }
122
+
123
+ declare interface CrossOriginSentTo {
124
+ [id: string]: true;
125
+ }
126
+
127
+ declare interface CrossOriginTransactionData<I, O> {
128
+ transaction: string;
129
+ type: CrossOriginTransactionType;
130
+ isResponse: boolean;
131
+ timestamp: number;
132
+ owner: string;
133
+ sentto: CrossOriginSentTo;
134
+ timeout?: number;
135
+ target?: string;
136
+ beginData?: I;
137
+ endData?: O;
138
+ }
139
+
140
+ declare type CrossOriginTransactionSend = (data: CrossOriginTransactionData<any, any>) => void;
141
+
142
+ declare type CrossOriginTransactionType = CrossOriginTransactionTypes[keyof CrossOriginTransactionTypes];
143
+
144
+ declare interface CrossOriginTransactionTypes {
145
+ Bootstrap: 1;
146
+ FocusElement: 2;
147
+ State: 3;
148
+ GetElement: 4;
149
+ RestoreFocusInDeloser: 5;
150
+ Ping: 6;
151
+ }
152
+
153
+ declare interface Deloser extends TabsterPart<DeloserProps> {
154
+ readonly uid: string;
155
+ dispose(): void;
156
+ isActive(): boolean;
157
+ setActive(active: boolean): void;
158
+ getActions(): DeloserElementActions;
159
+ setSnapshot(index: number): void;
160
+ focusFirst(): boolean;
161
+ unshift(element: HTMLElement): void;
162
+ focusDefault(): boolean;
163
+ resetFocus(): boolean;
164
+ findAvailable(): HTMLElement | null;
165
+ clearHistory(preserveExisting?: boolean): void;
166
+ customFocusLostHandler(element: HTMLElement): boolean;
167
+ }
168
+
169
+ declare interface DeloserAPI extends DeloserInterfaceInternal, Disposable {
170
+ getActions(element: HTMLElement): DeloserElementActions | undefined;
171
+ pause(): void;
172
+ resume(restore?: boolean): void;
173
+ }
174
+
175
+ declare type DeloserConstructor = (element: HTMLElement, props: DeloserProps) => Deloser;
176
+
177
+ declare interface DeloserElementActions {
178
+ focusDefault: () => boolean;
179
+ focusFirst: () => boolean;
180
+ resetFocus: () => boolean;
181
+ clearHistory: (preserveExisting?: boolean) => void;
182
+ setSnapshot: (index: number) => void;
183
+ isActive: () => boolean;
184
+ }
185
+
186
+ declare const DeloserEventName = "tabster:deloser";
187
+
188
+ declare interface DeloserInterfaceInternal {
189
+ /** @internal */
190
+ createDeloser(element: HTMLElement, props: DeloserProps): Deloser;
191
+ }
192
+
193
+ declare interface DeloserOnElement {
194
+ deloser: Deloser;
195
+ }
196
+
197
+ declare interface DeloserProps {
198
+ restoreFocusOrder?: RestoreFocusOrder;
199
+ noSelectorCheck?: boolean;
200
+ }
201
+
87
202
  export { dispatchGroupperMoveFocusEvent }
88
203
 
89
204
  export { dispatchMoverMoveFocusEvent }
90
205
 
206
+ declare interface Disposable {
207
+ /** @internal */
208
+ dispose(): void;
209
+ }
210
+
211
+ declare type DisposeFunc = () => void;
212
+
213
+ declare interface DOMAPI {
214
+ createMutationObserver: (callback: MutationCallback) => MutationObserver;
215
+ createTreeWalker(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;
216
+ getParentNode(node: Node | null | undefined): ParentNode | null;
217
+ getParentElement(element: HTMLElement | null | undefined): HTMLElement | null;
218
+ nodeContains(parent: Node | null | undefined, child: Node | null | undefined): boolean;
219
+ getActiveElement(doc: Document): Element | null;
220
+ querySelector(element: ParentNode, selector: string): Element | null;
221
+ querySelectorAll(element: ParentNode, selector: string): Element[];
222
+ getElementById(doc: Document, id: string): HTMLElement | null;
223
+ getFirstChild(node: Node | null | undefined): ChildNode | null;
224
+ getLastChild(node: Node | null | undefined): ChildNode | null;
225
+ getNextSibling(node: Node | null | undefined): ChildNode | null;
226
+ getPreviousSibling(node: Node | null | undefined): ChildNode | null;
227
+ getFirstElementChild(element: Element | null | undefined): Element | null;
228
+ getLastElementChild(element: Element | null | undefined): Element | null;
229
+ getNextElementSibling(element: Element | null | undefined): Element | null;
230
+ getPreviousElementSibling(element: Element | null | undefined): Element | null;
231
+ appendChild(parent: Node, child: Node): Node;
232
+ insertBefore(parent: Node, child: Node, referenceChild: Node | null): Node;
233
+ getSelection(ref: Node): Selection | null;
234
+ }
235
+
236
+ declare interface DummyInputManager {
237
+ moveOut: (backwards: boolean) => void;
238
+ moveOutWithDefaultAction: (backwards: boolean, relatedEvent: KeyboardEvent) => void;
239
+ }
240
+
241
+ declare interface DummyInputObserver {
242
+ add(dummy: HTMLElement, callback: () => void): void;
243
+ remove(dummy: HTMLElement): void;
244
+ dispose(): void;
245
+ domChanged?(parent: HTMLElement): void;
246
+ updatePositions(compute: (scrollTopLeftCache: Map<HTMLElement, {
247
+ scrollTop: number;
248
+ scrollLeft: number;
249
+ } | null>) => () => void): void;
250
+ }
251
+
252
+ declare type FindAllProps = Pick<FindFocusableProps, 'container' | 'modalizerId' | 'currentElement' | 'isBackward' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'acceptCondition' | 'ignoreAccessibility' | 'onElement'>;
253
+
254
+ declare type FindDefaultProps = Pick<FindFocusableProps, 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'>;
255
+
256
+ /**
257
+ * A callback that is called for every found element during search. Returning false stops search.
258
+ */
259
+ declare type FindElementCallback = (element: HTMLElement) => boolean;
260
+
261
+ declare type FindFirstProps = Pick<FindFocusableProps, 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'>;
262
+
263
+ declare interface FindFocusableOutputProps {
264
+ /**
265
+ * An output parameter. Will be true after the findNext/findPrev() call if some focusable
266
+ * elements were skipped during the search and the result element not immediately next
267
+ * focusable after the currentElement.
268
+ */
269
+ outOfDOMOrder?: boolean;
270
+ /**
271
+ * An output parameter. Will be true if the found element is uncontrolled.
272
+ */
273
+ uncontrolled?: HTMLElement | null;
274
+ }
275
+
276
+ declare interface FindFocusableProps {
277
+ /**
278
+ * The container used for the search.
279
+ */
280
+ container: HTMLElement;
281
+ /**
282
+ * The elemet to start from.
283
+ */
284
+ currentElement?: HTMLElement;
285
+ /**
286
+ * See `referenceElement` of GetTabsterContextOptions for description.
287
+ */
288
+ referenceElement?: HTMLElement;
289
+ /**
290
+ * Includes elements that can be focused programmatically.
291
+ */
292
+ includeProgrammaticallyFocusable?: boolean;
293
+ /**
294
+ * Ignore accessibility check.
295
+ */
296
+ ignoreAccessibility?: boolean;
297
+ /**
298
+ * Take active modalizer into account when searching for elements
299
+ * (the elements out of active modalizer will not be returned).
300
+ */
301
+ useActiveModalizer?: boolean;
302
+ /**
303
+ * Search withing the specified modality, null for everything outside of modalizers, string within
304
+ * a specific id, undefined for search within the current application state.
305
+ */
306
+ modalizerId?: string | null;
307
+ /**
308
+ * If true, find previous element instead of the next one.
309
+ */
310
+ isBackward?: boolean;
311
+ /**
312
+ * @param el - element visited.
313
+ * @returns if an element should be accepted.
314
+ */
315
+ acceptCondition?(el: HTMLElement): boolean;
316
+ /**
317
+ * A callback that will be called for every focusable element found during findAll().
318
+ * If false is returned from this callback, the search will stop.
319
+ */
320
+ onElement?: FindElementCallback;
321
+ }
322
+
323
+ declare type FindNextProps = Pick<FindFocusableProps, 'currentElement' | 'referenceElement' | 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'>;
324
+
325
+ declare interface FocusableAcceptElementState {
326
+ container: HTMLElement;
327
+ modalizerUserId?: string;
328
+ currentCtx?: TabsterContext;
329
+ from: HTMLElement;
330
+ fromCtx?: TabsterContext;
331
+ isBackward?: boolean;
332
+ found?: boolean;
333
+ foundElement?: HTMLElement;
334
+ foundBackward?: HTMLElement;
335
+ rejectElementsFrom?: HTMLElement;
336
+ uncontrolled?: HTMLElement;
337
+ acceptCondition: (el: HTMLElement) => boolean;
338
+ hasCustomCondition?: boolean;
339
+ includeProgrammaticallyFocusable?: boolean;
340
+ ignoreAccessibility?: boolean;
341
+ cachedGrouppers: {
342
+ [id: string]: {
343
+ isActive: boolean | undefined;
344
+ first?: HTMLElement | null;
345
+ };
346
+ };
347
+ isFindAll?: boolean;
348
+ /**
349
+ * A flag that indicates that some focusable elements were skipped
350
+ * during the search and the found element is not the one the browser
351
+ * would normally focus if the user pressed Tab.
352
+ */
353
+ skippedFocusable?: boolean;
354
+ }
355
+
356
+ declare interface FocusableAPI extends Disposable {
357
+ getProps(element: HTMLElement): FocusableProps;
358
+ isFocusable(element: HTMLElement, includeProgrammaticallyFocusable?: boolean, noVisibleCheck?: boolean, noAccessibleCheck?: boolean): boolean;
359
+ isVisible(element: HTMLElement): boolean;
360
+ isAccessible(element: HTMLElement): boolean;
361
+ findFirst(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;
362
+ findLast(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;
363
+ findNext(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;
364
+ findPrev(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;
365
+ findDefault(options: FindDefaultProps, out?: FindFocusableOutputProps): HTMLElement | null;
366
+ /**
367
+ * @returns All focusables in a given context that satisfy an given condition
368
+ */
369
+ findAll(options: FindAllProps): HTMLElement[];
370
+ findElement(options: FindFocusableProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;
371
+ }
372
+
373
+ declare interface FocusableOnElement {
374
+ focusable: FocusableProps;
375
+ }
376
+
377
+ declare interface FocusableProps {
378
+ isDefault?: boolean;
379
+ isIgnored?: boolean;
380
+ /**
381
+ * Do not determine an element's focusability based on aria-disabled.
382
+ */
383
+ ignoreAriaDisabled?: boolean;
384
+ /**
385
+ * Exclude element (and all subelements) from Mover navigation.
386
+ */
387
+ excludeFromMover?: boolean;
388
+ /**
389
+ * Prevents tabster from handling the keydown event
390
+ */
391
+ ignoreKeydown?: {
392
+ Tab?: boolean;
393
+ Escape?: boolean;
394
+ Enter?: boolean;
395
+ ArrowUp?: boolean;
396
+ ArrowDown?: boolean;
397
+ ArrowLeft?: boolean;
398
+ ArrowRight?: boolean;
399
+ PageUp?: boolean;
400
+ PageDown?: boolean;
401
+ Home?: boolean;
402
+ End?: boolean;
403
+ };
404
+ }
405
+
406
+ declare const FocusableSelector: string;
407
+
408
+ declare interface FocusedElementDetails {
409
+ relatedTarget?: HTMLElement;
410
+ isFocusedProgrammatically?: boolean;
411
+ modalizerId?: string;
412
+ }
413
+
414
+ declare interface FocusedElementState extends Subscribable<HTMLElement | undefined, FocusedElementDetails>, Disposable {
415
+ getFocusedElement(): HTMLElement | undefined;
416
+ getLastFocusedElement(): HTMLElement | undefined;
417
+ focus(element: HTMLElement, noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): boolean;
418
+ focusDefault(container: HTMLElement): boolean;
419
+ /** @internal */
420
+ getFirstOrLastTabbable(isFirst: boolean, props: Pick<FindFocusableProps, 'container' | 'ignoreAccessibility'>): HTMLElement | undefined;
421
+ focusFirst(props: FindFirstProps): boolean;
422
+ focusLast(props: FindFirstProps): boolean;
423
+ resetFocus(container: HTMLElement): boolean;
424
+ }
425
+
426
+ declare const FocusInEventName = "tabster:focusin";
427
+
428
+ declare const FocusOutEventName = "tabster:focusout";
429
+
91
430
  export declare type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;
92
431
 
93
432
  export declare type FocusOutlineStyleOptions = {
@@ -101,21 +440,904 @@ export declare type FocusOutlineStyleOptions = {
101
440
  outlineOffset?: string | FocusOutlineOffset;
102
441
  };
103
442
 
443
+ declare type GetTabster = () => TabsterCore;
444
+
445
+ declare interface GetTabsterContextOptions {
446
+ /**
447
+ * Should visit **all** element ancestors to verify if `dir='rtl'` is set
448
+ */
449
+ checkRtl?: boolean;
450
+ /**
451
+ * The element to start computing the context from. Useful when dealing
452
+ * with nested structures. For example, if we have an element inside a groupper
453
+ * inside another groupper, the `groupper` prop in this element's contexts will
454
+ * be the inner groupper, but when we pass the inner groupper's parent element
455
+ * as `referenceElement`, the context groupper will be the outer one. Having
456
+ * this option simplifies searching for the next tabbable element in the
457
+ * environment of nested movers and grouppers.
458
+ */
459
+ referenceElement?: HTMLElement;
460
+ }
461
+
462
+ declare type GetWindow = () => Window;
463
+
104
464
  declare type GriffelResetStyle = Parameters<typeof makeResetStyles>[0];
105
465
 
466
+ declare interface Groupper extends TabsterPart<GroupperProps>, TabsterPartWithFindNextTabbable, TabsterPartWithAcceptElement {
467
+ readonly id: string;
468
+ readonly dummyManager: DummyInputManager | undefined;
469
+ dispose(): void;
470
+ makeTabbable(isUnlimited: boolean): void;
471
+ isActive(noIfFirstIsFocused?: boolean): boolean | undefined;
472
+ setFirst(element: HTMLElement | undefined): void;
473
+ getFirst(orContainer: boolean): HTMLElement | undefined;
474
+ }
475
+
476
+ declare interface GroupperAPI extends GroupperAPIInternal, Disposable {
477
+ /** @internal (will likely be exposed once the API is fully stable) */
478
+ moveFocus(element: HTMLElement, action: GroupperMoveFocusAction): HTMLElement | null;
479
+ }
480
+
481
+ declare interface GroupperAPIInternal {
482
+ /** @internal */
483
+ createGroupper(element: HTMLElement, props: GroupperProps, sys: SysProps | undefined): Groupper;
484
+ /** @internal */
485
+ handleKeyPress(element: HTMLElement, event: KeyboardEvent, fromModalizer?: boolean): void;
486
+ }
487
+
488
+ declare interface GroupperAPIInternal {
489
+ forgetCurrentGrouppers(): void;
490
+ }
491
+
492
+ declare type GroupperConstructor = (tabster: TabsterCore, element: HTMLElement, props: GroupperProps) => Groupper;
493
+
494
+ declare type GroupperMoveFocusAction = GroupperMoveFocusActions_2[keyof GroupperMoveFocusActions_2];
495
+
496
+ export declare const GroupperMoveFocusActions: {
497
+ readonly Enter: 1;
498
+ readonly Escape: 2;
499
+ };
500
+
501
+ declare interface GroupperMoveFocusActions_2 {
502
+ Enter: 1;
503
+ Escape: 2;
504
+ }
505
+
506
+ declare const GroupperMoveFocusActions_2: GroupperMoveFocusActions_2;
507
+
508
+ export declare const GroupperMoveFocusEvent: typeof Events.GroupperMoveFocusEvent;
509
+
510
+ declare type GroupperMoveFocusEvent_2 = CustomEvent<{
511
+ action: GroupperMoveFocusAction;
512
+ } | undefined>;
513
+
514
+ export declare type GroupperMoveFocusEventDetail = Events.GroupperMoveFocusEventDetail;
515
+
516
+ export declare const GroupperMoveFocusEventName: "tabster:groupper:movefocus";
517
+
518
+ declare const GroupperMoveFocusEventName_2 = "tabster:groupper:movefocus";
519
+
520
+ declare interface GroupperOnElement {
521
+ groupper: Groupper;
522
+ }
523
+
524
+ declare interface GroupperProps {
525
+ tabbability?: GroupperTabbability;
526
+ delegated?: boolean;
527
+ }
528
+
529
+ declare interface GroupperTabbabilities {
530
+ Unlimited: 0;
531
+ Limited: 1;
532
+ LimitedTrapFocus: 2;
533
+ }
534
+
535
+ declare const GroupperTabbabilities: GroupperTabbabilities;
536
+
537
+ declare type GroupperTabbability = GroupperTabbabilities[keyof GroupperTabbabilities];
538
+
539
+ declare interface InternalAPI {
540
+ stopObserver(): void;
541
+ resumeObserver(syncState: boolean): void;
542
+ }
543
+
544
+ declare interface KeyboardNavigationState extends Subscribable<boolean>, Disposable {
545
+ isNavigatingWithKeyboard(): boolean;
546
+ setNavigatingWithKeyboard(isNavigatingWithKeyboard: boolean): void;
547
+ }
548
+
106
549
  export { KEYBORG_FOCUSIN }
107
550
 
108
551
  export { KeyborgFocusInEvent }
109
552
 
110
- export declare type TabsterDOMAttribute = TabsterTypes.TabsterDOMAttribute;
553
+ declare interface Modalizer extends TabsterPart<ModalizerProps>, TabsterPartWithFindNextTabbable {
554
+ readonly userId: string;
555
+ readonly dummyManager: DummyInputManager | undefined;
556
+ /**
557
+ * @returns - Whether the element is inside the modalizer
558
+ */
559
+ contains(element: HTMLElement): boolean;
560
+ dispose(): void;
561
+ isActive(): boolean;
562
+ makeActive(isActive: boolean): void;
563
+ focused(noIncrement?: boolean): number;
564
+ triggerFocusEvent(eventName: ModalizerEventName, allElements: boolean): boolean;
565
+ }
111
566
 
567
+ declare const ModalizerActiveEventName = "tabster:modalizer:active";
568
+
569
+ declare interface ModalizerAPI extends ModalizerAPIInternal, Disposable {
570
+ /**
571
+ * Activates a Modalizer and focuses the first or default element within
572
+ *
573
+ * @param elementFromModalizer - An element that belongs to a Modalizer
574
+ * @param noFocusFirst - Do not focus on the first element in the Modalizer
575
+ * @param noFocusDefault - Do not focus the default element in the Modalizre
576
+ */
577
+ focus(elementFromModalizer: HTMLElement, noFocusFirst?: boolean, noFocusDefault?: boolean): boolean;
578
+ }
579
+
580
+ declare interface ModalizerAPIInternal extends TabsterPartWithAcceptElement {
581
+ /** @internal */
582
+ activeId: string | undefined;
583
+ /** @internal */
584
+ currentIsOthersAccessible: boolean | undefined;
585
+ /** @internal */
586
+ activeElements: WeakHTMLElement<HTMLElement>[];
587
+ /** @internal */
588
+ createModalizer(element: HTMLElement, props: ModalizerProps, sys: SysProps | undefined): Modalizer;
589
+ /**
590
+ * Sets active modalizers.
591
+ * When active, everything outside of the modalizers with the specific user
592
+ * defined id gets `aria-hidden`.
593
+ *
594
+ * @param userId - user defined identifier or undefined (if nothing is modal).
595
+ */
596
+ /** @internal */
597
+ setActive(modalizer: Modalizer | undefined): void;
598
+ /** @internal */
599
+ hiddenUpdate(): void;
600
+ /** @internal */
601
+ isAugmented(element: HTMLElement): boolean;
602
+ }
603
+
604
+ declare const ModalizerBeforeFocusOutEventName = "tabster:modalizer:beforefocusout";
605
+
606
+ declare type ModalizerConstructor = (tabster: TabsterCore, element: HTMLElement, props: ModalizerProps) => Modalizer;
607
+
608
+ /**
609
+ * A signature for the accessibleCheck callback from getModalizer().
610
+ * It is called when active Modalizer sets aria-hidden on elements outsidef of it.
611
+ *
612
+ * @param element - The element that is about to receive aria-hidden.
613
+ * @param activeModalizerElements - The container elements of the active modalizer.
614
+ * @returns true if the element should remain accessible and should not receive
615
+ * aria-hidden.
616
+ */
617
+ declare type ModalizerElementAccessibleCheck = (element: HTMLElement, activeModalizerElements?: HTMLElement[]) => boolean;
618
+
619
+ declare type ModalizerEvent = TabsterEventWithDetails<ModalizerEventDetails>;
620
+
621
+ declare type ModalizerEventDetails = {
622
+ id: string;
623
+ element: HTMLElement;
624
+ eventName: ModalizerEventName;
625
+ };
626
+
627
+ declare type ModalizerEventName = typeof ModalizerActiveEventName | typeof ModalizerInactiveEventName | typeof ModalizerBeforeFocusOutEventName | typeof ModalizerFocusInEventName | typeof ModalizerFocusOutEventName;
628
+
629
+ declare const ModalizerFocusInEventName = "tabster:modalizer:focusin";
630
+
631
+ declare const ModalizerFocusOutEventName = "tabster:modalizer:focusout";
632
+
633
+ declare const ModalizerInactiveEventName = "tabster:modalizer:inactive";
634
+
635
+ declare interface ModalizerOnElement {
636
+ modalizer: Modalizer;
637
+ }
638
+
639
+ declare interface ModalizerProps {
640
+ id: string;
641
+ isOthersAccessible?: boolean;
642
+ isAlwaysAccessible?: boolean;
643
+ isNoFocusFirst?: boolean;
644
+ isNoFocusDefault?: boolean;
645
+ /** A focus trap variant, keeps focus inside the modal when tabbing */
646
+ isTrapped?: boolean;
647
+ }
648
+
649
+ declare const MoveFocusEventName = "tabster:movefocus";
650
+
651
+ declare interface Mover extends TabsterPart<MoverProps>, TabsterPartWithFindNextTabbable, TabsterPartWithAcceptElement {
652
+ readonly id: string;
653
+ readonly dummyManager: DummyInputManager | undefined;
654
+ readonly visibilityTolerance: NonNullable<MoverProps['visibilityTolerance']>;
655
+ dispose(): void;
656
+ setCurrent(element: HTMLElement | undefined): void;
657
+ getCurrent(): HTMLElement | null;
658
+ getState(element: HTMLElement): MoverElementState | undefined;
659
+ }
660
+
661
+ declare interface MoverAPI extends MoverAPIInternal, Disposable {
662
+ /** @internal (will likely be exposed once the API is fully stable) */
663
+ moveFocus(fromElement: HTMLElement, key: MoverKey): HTMLElement | null;
664
+ }
665
+
666
+ declare interface MoverAPIInternal {
667
+ /** @internal */
668
+ createMover(element: HTMLElement, props: MoverProps, sys: SysProps | undefined): Mover;
669
+ }
670
+
671
+ declare type MoverConstructor = (tabster: TabsterCore, element: HTMLElement, props: MoverProps) => Mover;
672
+
673
+ declare type MoverDirection = MoverDirections[keyof MoverDirections];
674
+
675
+ declare interface MoverDirections {
676
+ Both: 0;
677
+ Vertical: 1;
678
+ Horizontal: 2;
679
+ Grid: 3;
680
+ GridLinear: 4;
681
+ }
682
+
683
+ declare const MoverDirections: MoverDirections;
684
+
685
+ declare interface MoverElementState {
686
+ isCurrent: boolean | undefined;
687
+ visibility: Visibility;
688
+ }
689
+
690
+ declare type MoverEvent = TabsterEventWithDetails<MoverElementState>;
691
+
692
+ declare const MoverEventName = "tabster:mover";
693
+
694
+ declare type MoverKey = MoverKeys_2[keyof MoverKeys_2];
695
+
696
+ export declare const MoverKeys: {
697
+ readonly ArrowUp: 1;
698
+ readonly ArrowDown: 2;
699
+ readonly ArrowLeft: 3;
700
+ readonly ArrowRight: 4;
701
+ readonly PageUp: 5;
702
+ readonly PageDown: 6;
703
+ readonly Home: 7;
704
+ readonly End: 8;
705
+ };
706
+
707
+ declare interface MoverKeys_2 {
708
+ ArrowUp: 1;
709
+ ArrowDown: 2;
710
+ ArrowLeft: 3;
711
+ ArrowRight: 4;
712
+ PageUp: 5;
713
+ PageDown: 6;
714
+ Home: 7;
715
+ End: 8;
716
+ }
717
+
718
+ declare const MoverKeys_2: MoverKeys_2;
719
+
720
+ export declare const MoverMoveFocusEvent: typeof Events.MoverMoveFocusEvent;
721
+
722
+ declare type MoverMoveFocusEvent_2 = CustomEvent<{
723
+ key: MoverKey;
724
+ } | undefined>;
725
+
726
+ export declare type MoverMoveFocusEventDetail = Events.MoverMoveFocusEventDetail;
727
+
728
+ /**
729
+ * For all exports below, we don't do wildcard exports to keep Tabster API flexible. We export only required
730
+ * parts when they are needed.
731
+ */
732
+ export declare const MoverMoveFocusEventName: "tabster:mover:movefocus";
733
+
734
+ declare const MoverMoveFocusEventName_2 = "tabster:mover:movefocus";
735
+
736
+ declare interface MoverOnElement {
737
+ mover: Mover;
738
+ }
739
+
740
+ declare interface MoverProps {
741
+ direction?: MoverDirection;
742
+ memorizeCurrent?: boolean;
743
+ tabbable?: boolean;
744
+ /**
745
+ * Whether to allow cyclic navigation in the mover
746
+ * Can only be applied if navigationType is MoverKeys.Arrows
747
+ *
748
+ * @defaultValue false
749
+ */
750
+ cyclic?: boolean;
751
+ /**
752
+ * In case we need a rich state of the elements inside a Mover,
753
+ * we can track it. It takes extra resourses and might affect
754
+ * performance when a Mover has many elements inside, so make sure
755
+ * you use this prop when it is really needed.
756
+ */
757
+ trackState?: boolean;
758
+ /**
759
+ * When set to Visibility.Visible or Visibility.PartiallyVisible,
760
+ * uses the visibility part of the trackState prop to be able to
761
+ * go to first/last visible element (instead of first/last focusable
762
+ * element in DOM) when tabbing from outside of the mover.
763
+ */
764
+ visibilityAware?: Visibility;
765
+ /**
766
+ * When true, Mover will try to locate a focusable with Focusable.isDefault
767
+ * property as a prioritized element to focus. True by default.
768
+ */
769
+ hasDefault?: boolean;
770
+ /**
771
+ * A value between 0 and 1 that specifies the tolerance allowed
772
+ * when testing for visibility.
773
+ *
774
+ * @example
775
+ * an element of height 100px has 10px that are above the viewport
776
+ * hidden by scroll. This element is a valid visible element to focus.
777
+ *
778
+ * @default 0.8
779
+ */
780
+ visibilityTolerance?: number;
781
+ }
782
+
783
+ declare type NextTabbable = {
784
+ element: HTMLElement | null | undefined;
785
+ uncontrolled?: HTMLElement | null;
786
+ outOfDOMOrder?: boolean;
787
+ };
788
+
789
+ declare interface ObservedElementAccesibilities {
790
+ Any: 0;
791
+ Accessible: 1;
792
+ Focusable: 2;
793
+ }
794
+
795
+ declare const ObservedElementAccesibilities: ObservedElementAccesibilities;
796
+
797
+ declare type ObservedElementAccesibility = ObservedElementAccesibilities[keyof ObservedElementAccesibilities];
798
+
799
+ declare interface ObservedElementAPI extends Subscribable<HTMLElement, ObservedElementDetails>, Disposable, ObservedElementAPIInternal {
800
+ getElement(observedName: string, accessibility?: ObservedElementAccesibility): HTMLElement | null;
801
+ waitElement(observedName: string, timeout: number, accessibility?: ObservedElementAccesibility): ObservedElementAsyncRequest<HTMLElement | null>;
802
+ requestFocus(observedName: string, timeout: number): ObservedElementAsyncRequest<boolean>;
803
+ }
804
+
805
+ declare interface ObservedElementAPIInternal {
806
+ /** @internal */
807
+ onObservedElementUpdate(element: HTMLElement): void;
808
+ }
809
+
810
+ declare interface ObservedElementAsyncRequest<T> {
811
+ result: Promise<T>;
812
+ cancel(): void;
813
+ }
814
+
815
+ declare interface ObservedElementDetails extends ObservedElementProps {
816
+ accessibility?: ObservedElementAccesibility;
817
+ }
818
+
819
+ declare interface ObservedElementProps {
820
+ names: string[];
821
+ details?: any;
822
+ }
823
+
824
+ declare interface ObservedOnElement {
825
+ observed: ObservedElementProps;
826
+ }
827
+
828
+ declare interface OutlineAPI extends Disposable {
829
+ setup(props?: Partial<OutlineProps>): void;
830
+ }
831
+
832
+ declare interface OutlinedElementProps {
833
+ isIgnored?: boolean;
834
+ }
835
+
836
+ declare interface OutlineElements {
837
+ container: HTMLDivElement;
838
+ left: HTMLDivElement;
839
+ top: HTMLDivElement;
840
+ right: HTMLDivElement;
841
+ bottom: HTMLDivElement;
842
+ }
843
+
844
+ declare interface OutlineOnElement {
845
+ outline: OutlinedElementProps;
846
+ }
847
+
848
+ declare interface OutlineProps {
849
+ areaClass: string;
850
+ outlineClass: string;
851
+ outlineColor: string;
852
+ outlineWidth: number;
853
+ zIndex: number;
854
+ }
855
+
856
+ declare type RestoreFocusOrder = RestoreFocusOrders[keyof RestoreFocusOrders];
857
+
858
+ declare interface RestoreFocusOrders {
859
+ History: 0;
860
+ DeloserDefault: 1;
861
+ RootDefault: 2;
862
+ DeloserFirst: 3;
863
+ RootFirst: 4;
864
+ }
865
+
866
+ declare const RestoreFocusOrders: RestoreFocusOrders;
867
+
868
+ declare interface Restorer extends Disposable, TabsterPart<RestorerProps> {
869
+ }
870
+
871
+ declare interface RestorerAPI extends RestorerAPIInternal, Disposable {
872
+ }
873
+
874
+ declare interface RestorerAPIInternal {
875
+ /** @internal */
876
+ createRestorer(element: HTMLElement, props: RestorerProps): Restorer;
877
+ }
878
+
879
+ declare interface RestorerOnElement {
880
+ restorer: Restorer;
881
+ }
882
+
883
+ declare interface RestorerProps {
884
+ type: RestorerType;
885
+ }
886
+
887
+ declare type RestorerType = (typeof RestorerTypes)[keyof typeof RestorerTypes];
888
+
889
+ declare const RestorerTypes: {
890
+ readonly Source: 0;
891
+ readonly Target: 1;
892
+ };
893
+
894
+ declare interface Root extends TabsterPart<RootProps> {
895
+ /**@internal*/
896
+ addDummyInputs(): void;
897
+ readonly uid: string;
898
+ dispose(): void;
899
+ moveOutWithDefaultAction(backwards: boolean, relatedEvent: KeyboardEvent): void;
900
+ }
901
+
902
+ declare interface RootAPI extends Disposable, RootAPIInternal {
903
+ eventTarget: EventTarget;
904
+ }
905
+
906
+ declare interface RootAPIInternal {
907
+ /**@internal*/
908
+ createRoot(element: HTMLElement, props: RootProps, sys: SysProps | undefined): Root;
909
+ /**@internal*/
910
+ onRoot(root: Root, removed?: boolean): void;
911
+ /**@internal*/
912
+ addDummyInputs(): void;
913
+ }
914
+
915
+ declare type RootConstructor = (tabster: TabsterCore, element: HTMLElement, props: RootProps) => Root;
916
+
917
+ declare interface RootFocusEventDetails {
918
+ element: HTMLElement;
919
+ }
920
+
921
+ declare interface RootOnElement {
922
+ root: Root;
923
+ }
924
+
925
+ declare interface RootProps {
926
+ restoreFocusOrder?: RestoreFocusOrder;
927
+ }
928
+
929
+ declare interface Subscribable<A, B = undefined> {
930
+ subscribe(callback: SubscribableCallback<A, B>): void;
931
+ /** @internal */
932
+ subscribeFirst(callback: SubscribableCallback<A, B>): void;
933
+ unsubscribe(callback: SubscribableCallback<A, B>): void;
934
+ }
935
+
936
+ declare type SubscribableCallback<A, B = undefined> = (val: A, details: B) => void;
937
+
938
+ declare type SysDummyInputsPosition = SysDummyInputsPositions[keyof SysDummyInputsPositions];
939
+
940
+ declare interface SysDummyInputsPositions {
941
+ Auto: 0;
942
+ Inside: 1;
943
+ Outside: 2;
944
+ }
945
+
946
+ declare const SysDummyInputsPositions: SysDummyInputsPositions;
947
+
948
+ declare interface SysOnElement {
949
+ sys: SysProps;
950
+ }
951
+
952
+ /**
953
+ * Ability to fine-tune Tabster internal behaviour in rare cases of need.
954
+ * Normally, should not be used. A deep understanding of the intention and the effect
955
+ * is required.
956
+ */
957
+ declare interface SysProps {
958
+ /**
959
+ * Force dummy input position outside or inside of the element.
960
+ * By default (when undefined), the position is determined dynamically
961
+ * (for example inside for <li> elements and outside for <table> elements,
962
+ * plus a default Groupper/Mover/Modalizer implementation position).
963
+ * Setting to true will force the dummy inputs to be always outside of the element,
964
+ * setting to false will force the dummy inputs to be always inside.
965
+ */
966
+ dummyInputsPosition?: SysDummyInputsPosition;
967
+ }
968
+
969
+ declare interface Tabster {
970
+ keyboardNavigation: KeyboardNavigationState;
971
+ focusedElement: FocusedElementState;
972
+ focusable: FocusableAPI;
973
+ root: RootAPI;
974
+ uncontrolled: UncontrolledAPI;
975
+ /** @internal */
976
+ core: TabsterCore;
977
+ }
978
+
979
+ /**
980
+ * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!
981
+ * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!
982
+ *
983
+ * Do not use anything from this file. It is a snapshot of the older Tabster typings exposed by a mistake.
984
+ * The exposed typings should have been removed, but we don't do it in minor versions to avoid breaking changes.
985
+ * Everything reexported from this file as react-tabster/TabsterTypes is marked as deprecated and shouldn't
986
+ * be used anywhre.
987
+ *
988
+ * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!
989
+ * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!
990
+ */
991
+ declare const TabsterAttributeName = "data-tabster";
992
+
993
+ declare interface TabsterAttributeOnElement {
994
+ string: string;
995
+ object: TabsterAttributeProps;
996
+ }
997
+
998
+ declare type TabsterAttributeProps = Partial<{
999
+ deloser: DeloserProps;
1000
+ root: RootProps;
1001
+ uncontrolled: UncontrolledProps;
1002
+ modalizer: ModalizerProps;
1003
+ focusable: FocusableProps;
1004
+ groupper: GroupperProps;
1005
+ mover: MoverProps;
1006
+ observed: ObservedElementProps;
1007
+ outline: OutlinedElementProps;
1008
+ sys: SysProps;
1009
+ restorer: RestorerProps;
1010
+ }>;
1011
+
1012
+ declare interface TabsterAugmentedAttributes {
1013
+ [name: string]: string | null;
1014
+ }
1015
+
1016
+ declare interface TabsterCompat {
1017
+ attributeTransform?: <P>(old: P) => TabsterAttributeProps;
1018
+ }
1019
+
1020
+ declare interface TabsterContext {
1021
+ root: Root;
1022
+ modalizer?: Modalizer;
1023
+ groupper?: Groupper;
1024
+ mover?: Mover;
1025
+ groupperBeforeMover?: boolean;
1026
+ modalizerInGroupper?: Groupper;
1027
+ /**
1028
+ * Whether `dir='rtl'` is set on an ancestor
1029
+ */
1030
+ rtl?: boolean;
1031
+ excludedFromMover?: boolean;
1032
+ uncontrolled?: HTMLElement | null;
1033
+ ignoreKeydown: (e: KeyboardEvent) => boolean;
1034
+ }
1035
+
1036
+ declare type TabsterContextMoverGroupper = {
1037
+ isMover: true;
1038
+ mover: Mover;
1039
+ } | {
1040
+ isMover: false;
1041
+ groupper: Groupper;
1042
+ };
1043
+
1044
+ declare interface TabsterCore extends Pick<TabsterCoreProps, 'controlTab' | 'rootDummyInputs'>, Disposable, TabsterCoreInternal, Omit<Tabster, 'core'> {
1045
+ }
1046
+
1047
+ declare interface TabsterCoreInternal {
1048
+ /** @internal */
1049
+ groupper?: GroupperAPI;
1050
+ /** @internal */
1051
+ mover?: MoverAPI;
1052
+ /** @internal */
1053
+ outline?: OutlineAPI;
1054
+ /** @internal */
1055
+ deloser?: DeloserAPI;
1056
+ /** @internal */
1057
+ modalizer?: ModalizerAPI;
1058
+ /** @internal */
1059
+ observedElement?: ObservedElementAPI;
1060
+ /** @internal */
1061
+ crossOrigin?: CrossOriginAPI;
1062
+ /** @internal */
1063
+ internal: InternalAPI;
1064
+ /** @internal */
1065
+ restorer?: RestorerAPI;
1066
+ /** @internal */
1067
+ _dummyObserver: DummyInputObserver;
1068
+ /** @internal */
1069
+ _version: string;
1070
+ /** @internal */
1071
+ _noop: boolean;
1072
+ /** @internal */
1073
+ storageEntry(element: HTMLElement, addremove?: boolean): TabsterElementStorageEntry | undefined;
1074
+ /** @internal */
1075
+ getWindow: GetWindow;
1076
+ /** @internal */
1077
+ createTabster(noRefCount?: boolean, props?: TabsterCoreProps): Tabster;
1078
+ /** @internal */
1079
+ disposeTabster(wrapper: Tabster, allInstances?: boolean): void;
1080
+ /** @internal */
1081
+ forceCleanup(): void;
1082
+ /** @internal */
1083
+ queueInit(callback: () => void): void;
1084
+ /** @internal */
1085
+ drainInitQueue(): void;
1086
+ /** @internal */
1087
+ getParent: (el: Node) => Node | null;
1088
+ }
1089
+
1090
+ declare interface TabsterCoreProps {
1091
+ autoRoot?: RootProps;
1092
+ /**
1093
+ * Allows all tab key presses under the tabster root to be controlled by tabster
1094
+ * @default true
1095
+ */
1096
+ controlTab?: boolean;
1097
+ /**
1098
+ * When controlTab is false, Root doesn't have dummy inputs by default.
1099
+ * This option allows to enable dummy inputs on Root.
1100
+ */
1101
+ rootDummyInputs?: boolean;
1102
+ /**
1103
+ * A callback that will be called for the uncontrolled areas when Tabster wants
1104
+ * to know is the uncontrolled element wants complete control (for example it
1105
+ * is trapping focus) and Tabster should not interfere with handling Tab.
1106
+ * If the callback returns undefined, then the default behaviour is to return
1107
+ * the uncontrolled.completely value from the element. If the callback returns
1108
+ * non-undefined value, the callback's value will dominate the element's
1109
+ * uncontrolled.completely value.
1110
+ */
1111
+ checkUncontrolledCompletely?: (element: HTMLElement, completely: boolean) => boolean | undefined;
1112
+ /**
1113
+ * @deprecated use checkUncontrolledCompletely.
1114
+ */
1115
+ checkUncontrolledTrappingFocus?: (element: HTMLElement) => boolean;
1116
+ /**
1117
+ * Custom getter for parent elements. Defaults to the default .parentElement call
1118
+ * Currently only used to detect tabster contexts
1119
+ */
1120
+ getParent?(el: Node): Node | null;
1121
+ /**
1122
+ * Ability to redefine all DOM API calls used by Tabster. For example, for
1123
+ * ShadowDOM support.
1124
+ */
1125
+ DOMAPI?: Partial<DOMAPI>;
1126
+ }
1127
+
1128
+ export declare type TabsterDOMAttribute = Types.TabsterDOMAttribute;
1129
+
1130
+ declare interface TabsterDOMAttribute_2 {
1131
+ [TabsterAttributeName]: string | undefined;
1132
+ }
1133
+
1134
+ declare const TabsterDummyInputAttributeName = "data-tabster-dummy";
1135
+
1136
+ declare interface TabsterElementStorage {
1137
+ [uid: string]: TabsterElementStorageEntry;
1138
+ }
1139
+
1140
+ declare interface TabsterElementStorageEntry {
1141
+ tabster?: TabsterOnElement;
1142
+ attr?: TabsterAttributeOnElement;
1143
+ aug?: TabsterAugmentedAttributes;
1144
+ }
1145
+
1146
+ declare type TabsterEventWithDetails<D> = CustomEvent<D | undefined>;
1147
+
1148
+ declare type TabsterMoveFocusEvent = TabsterEventWithDetails<TabsterMoveFocusEventDetails>;
1149
+
1150
+ declare interface TabsterMoveFocusEventDetails {
1151
+ by: 'mover' | 'groupper' | 'modalizer' | 'root';
1152
+ owner: HTMLElement;
1153
+ next: HTMLElement | null;
1154
+ relatedEvent?: KeyboardEvent;
1155
+ }
1156
+
1157
+ declare type TabsterOnElement = Partial<RootOnElement & DeloserOnElement & ModalizerOnElement & FocusableOnElement & MoverOnElement & GroupperOnElement & ObservedOnElement & OutlineOnElement & UncontrolledOnElement & SysOnElement & RestorerOnElement>;
1158
+
1159
+ declare interface TabsterPart<P> {
1160
+ readonly id: string;
1161
+ getElement(): HTMLElement | undefined;
1162
+ getProps(): P;
1163
+ setProps(props: P): void;
1164
+ }
1165
+
1166
+ declare interface TabsterPartWithAcceptElement {
1167
+ acceptElement(element: HTMLElement, state: FocusableAcceptElementState): number | undefined;
1168
+ }
1169
+
1170
+ declare interface TabsterPartWithFindNextTabbable {
1171
+ findNextTabbable(current?: HTMLElement, reference?: HTMLElement, isBackward?: boolean, ignoreAccessibility?: boolean): NextTabbable | null;
1172
+ }
1173
+
1174
+ declare namespace TabsterTypes {
1175
+ export {
1176
+ TabsterAttributeName,
1177
+ TabsterDummyInputAttributeName,
1178
+ DeloserEventName,
1179
+ ModalizerActiveEventName,
1180
+ ModalizerInactiveEventName,
1181
+ ModalizerFocusInEventName,
1182
+ ModalizerFocusOutEventName,
1183
+ ModalizerBeforeFocusOutEventName,
1184
+ MoverEventName,
1185
+ FocusInEventName,
1186
+ FocusOutEventName,
1187
+ MoveFocusEventName,
1188
+ MoverMoveFocusEventName_2 as MoverMoveFocusEventName,
1189
+ GroupperMoveFocusEventName_2 as GroupperMoveFocusEventName,
1190
+ FocusableSelector,
1191
+ MoverMoveFocusEvent_2 as MoverMoveFocusEvent,
1192
+ GroupperMoveFocusActions_2 as GroupperMoveFocusActions,
1193
+ GroupperMoveFocusAction,
1194
+ GroupperMoveFocusEvent_2 as GroupperMoveFocusEvent,
1195
+ TabsterEventWithDetails,
1196
+ TabsterMoveFocusEventDetails,
1197
+ TabsterMoveFocusEvent,
1198
+ TabsterDOMAttribute_2 as TabsterDOMAttribute,
1199
+ TabsterCoreProps,
1200
+ DOMAPI,
1201
+ GetTabster,
1202
+ GetWindow,
1203
+ SubscribableCallback,
1204
+ Disposable,
1205
+ Subscribable,
1206
+ KeyboardNavigationState,
1207
+ FocusedElementDetails,
1208
+ FocusedElementState,
1209
+ WeakHTMLElement,
1210
+ TabsterPart,
1211
+ TabsterPartWithFindNextTabbable,
1212
+ TabsterPartWithAcceptElement,
1213
+ ObservedElementProps,
1214
+ ObservedElementDetails,
1215
+ ObservedElementAccesibilities,
1216
+ ObservedElementAccesibility,
1217
+ ObservedElementAsyncRequest,
1218
+ ObservedElementAPI,
1219
+ CrossOriginElement,
1220
+ CrossOriginSentTo,
1221
+ CrossOriginTransactionTypes,
1222
+ CrossOriginTransactionType,
1223
+ CrossOriginTransactionData,
1224
+ CrossOriginTransactionSend,
1225
+ CrossOriginMessage,
1226
+ CrossOriginFocusedElementState,
1227
+ CrossOriginObservedElementState,
1228
+ CrossOriginAPI,
1229
+ OutlineProps,
1230
+ OutlinedElementProps,
1231
+ OutlineAPI,
1232
+ DeloserElementActions,
1233
+ RestoreFocusOrders,
1234
+ RestoreFocusOrder,
1235
+ DeloserProps,
1236
+ Deloser,
1237
+ DeloserConstructor,
1238
+ DeloserAPI,
1239
+ FocusableProps,
1240
+ FocusableAcceptElementState,
1241
+ FindFocusableProps,
1242
+ FindFocusableOutputProps,
1243
+ FindFirstProps,
1244
+ FindNextProps,
1245
+ FindDefaultProps,
1246
+ FindAllProps,
1247
+ FindElementCallback,
1248
+ FocusableAPI,
1249
+ DummyInputManager,
1250
+ Visibilities,
1251
+ Visibility,
1252
+ MoverElementState,
1253
+ MoverDirections,
1254
+ RestorerTypes,
1255
+ RestorerType,
1256
+ MoverDirection,
1257
+ NextTabbable,
1258
+ MoverProps,
1259
+ MoverEvent,
1260
+ Mover,
1261
+ MoverConstructor,
1262
+ MoverKeys_2 as MoverKeys,
1263
+ MoverKey,
1264
+ MoverAPI,
1265
+ GroupperTabbabilities,
1266
+ GroupperTabbability,
1267
+ GroupperProps,
1268
+ Groupper,
1269
+ GroupperConstructor,
1270
+ GroupperAPIInternal,
1271
+ GroupperAPI,
1272
+ ModalizerProps,
1273
+ ModalizerEventName,
1274
+ ModalizerEventDetails,
1275
+ ModalizerEvent,
1276
+ Modalizer,
1277
+ ModalizerConstructor,
1278
+ RootProps,
1279
+ Root,
1280
+ RootConstructor,
1281
+ SysDummyInputsPositions,
1282
+ SysDummyInputsPosition,
1283
+ SysProps,
1284
+ GetTabsterContextOptions,
1285
+ TabsterContextMoverGroupper,
1286
+ TabsterContext,
1287
+ RootFocusEventDetails,
1288
+ RootAPI,
1289
+ UncontrolledAPI,
1290
+ ModalizerAPI,
1291
+ RestorerAPI,
1292
+ Restorer,
1293
+ ModalizerElementAccessibleCheck,
1294
+ UncontrolledProps,
1295
+ DeloserOnElement,
1296
+ RootOnElement,
1297
+ ModalizerOnElement,
1298
+ RestorerOnElement,
1299
+ FocusableOnElement,
1300
+ MoverOnElement,
1301
+ GroupperOnElement,
1302
+ UncontrolledOnElement,
1303
+ ObservedOnElement,
1304
+ OutlineOnElement,
1305
+ SysOnElement,
1306
+ RestorerProps,
1307
+ TabsterAttributeProps,
1308
+ TabsterAttributeOnElement,
1309
+ TabsterAugmentedAttributes,
1310
+ TabsterOnElement,
1311
+ OutlineElements,
1312
+ TabsterElementStorageEntry,
1313
+ TabsterElementStorage,
1314
+ DisposeFunc,
1315
+ InternalAPI,
1316
+ DummyInputObserver,
1317
+ Tabster,
1318
+ TabsterCore,
1319
+ TabsterCompat
1320
+ }
1321
+ }
112
1322
  export { TabsterTypes }
113
1323
 
1324
+ declare interface UncontrolledAPI {
1325
+ isUncontrolledCompletely(element: HTMLElement, completely: boolean): boolean;
1326
+ }
1327
+
1328
+ declare interface UncontrolledOnElement {
1329
+ uncontrolled: UncontrolledProps;
1330
+ }
1331
+
1332
+ declare interface UncontrolledProps {
1333
+ completely?: boolean;
1334
+ }
1335
+
114
1336
  /**
115
1337
  * A hook that returns the necessary tabster attributes to support arrow key navigation
116
1338
  * @param options - Options to configure keyboard navigation
117
1339
  */
118
- export declare const useArrowNavigationGroup: (options?: UseArrowNavigationGroupOptions) => TabsterTypes.TabsterDOMAttribute;
1340
+ export declare const useArrowNavigationGroup: (options?: UseArrowNavigationGroupOptions) => Types.TabsterDOMAttribute;
119
1341
 
120
1342
  export declare interface UseArrowNavigationGroupOptions {
121
1343
  /**
@@ -140,7 +1362,7 @@ export declare interface UseArrowNavigationGroupOptions {
140
1362
  /**
141
1363
  * Tabster should ignore default handling of keydown events
142
1364
  */
143
- ignoreDefaultKeydown?: TabsterTypes.FocusableProps['ignoreKeydown'];
1365
+ ignoreDefaultKeydown?: Types.FocusableProps['ignoreKeydown'];
144
1366
  /**
145
1367
  * The default focusable item in the group will be an element with Focusable.isDefault property.
146
1368
  * Note that there is no way in \@fluentui/react-tabster to set default focusable element,
@@ -153,7 +1375,7 @@ export declare interface UseArrowNavigationGroupOptions {
153
1375
  * A hook that returns the necessary tabster attributes to support groupping.
154
1376
  * @param options - Options to configure keyboard navigation
155
1377
  */
156
- export declare const useFocusableGroup: (options?: UseFocusableGroupOptions) => TabsterTypes.TabsterDOMAttribute;
1378
+ export declare const useFocusableGroup: (options?: UseFocusableGroupOptions) => Types.TabsterDOMAttribute;
157
1379
 
158
1380
  export declare interface UseFocusableGroupOptions {
159
1381
  /**
@@ -163,7 +1385,7 @@ export declare interface UseFocusableGroupOptions {
163
1385
  /**
164
1386
  * Tabster can ignore default handling of keydown events
165
1387
  */
166
- ignoreDefaultKeydown?: TabsterTypes.FocusableProps['ignoreKeydown'];
1388
+ ignoreDefaultKeydown?: Types.FocusableProps['ignoreKeydown'];
167
1389
  }
168
1390
 
169
1391
  /**
@@ -173,8 +1395,8 @@ export declare const useFocusFinders: () => {
173
1395
  findAllFocusable: (container: HTMLElement, acceptCondition?: ((el: HTMLElement) => boolean) | undefined) => HTMLElement[];
174
1396
  findFirstFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
175
1397
  findLastFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
176
- findNextFocusable: (currentElement: HTMLElement, options?: Pick<Partial<TabsterTypes.FindNextProps>, 'container'>) => HTMLElement | null | undefined;
177
- findPrevFocusable: (currentElement: HTMLElement, options?: Pick<Partial<TabsterTypes.FindNextProps>, 'container'>) => HTMLElement | null | undefined;
1398
+ findNextFocusable: (currentElement: HTMLElement, options?: Pick<Partial<Types.FindNextProps>, 'container'>) => HTMLElement | null | undefined;
1399
+ findPrevFocusable: (currentElement: HTMLElement, options?: Pick<Partial<Types.FindNextProps>, 'container'>) => HTMLElement | null | undefined;
178
1400
  };
179
1401
 
180
1402
  /**
@@ -182,7 +1404,7 @@ export declare const useFocusFinders: () => {
182
1404
  * @param name - The observed element to focus
183
1405
  * @returns Function that will focus the
184
1406
  */
185
- export declare function useFocusObserved(name: string, options?: UseFocusObservedOptions): () => TabsterTypes.ObservedElementAsyncRequest<boolean>;
1407
+ export declare function useFocusObserved(name: string, options?: UseFocusObservedOptions): () => Types.ObservedElementAsyncRequest<boolean>;
186
1408
 
187
1409
  declare interface UseFocusObservedOptions {
188
1410
  /**
@@ -219,7 +1441,7 @@ export declare function useKeyboardNavAttribute<E extends HTMLElement>(): RefObj
219
1441
  * @param attributes - collection of tabster attributes from other react-tabster hooks
220
1442
  * @returns single merged tabster attribute
221
1443
  */
222
- export declare const useMergedTabsterAttributes_unstable: (...attributes: TabsterTypes.TabsterDOMAttribute[]) => TabsterTypes.TabsterDOMAttribute;
1444
+ export declare const useMergedTabsterAttributes_unstable: (...attributes: Types.TabsterDOMAttribute[]) => Types.TabsterDOMAttribute;
223
1445
 
224
1446
  /**
225
1447
  * Applies modal dialog behaviour through DOM attributes
@@ -229,8 +1451,8 @@ export declare const useMergedTabsterAttributes_unstable: (...attributes: Tabste
229
1451
  * @returns DOM attributes to apply to the modal element and its trigger
230
1452
  */
231
1453
  export declare const useModalAttributes: (options?: UseModalAttributesOptions) => {
232
- modalAttributes: TabsterTypes.TabsterDOMAttribute;
233
- triggerAttributes: TabsterTypes.TabsterDOMAttribute;
1454
+ modalAttributes: Types.TabsterDOMAttribute;
1455
+ triggerAttributes: Types.TabsterDOMAttribute;
234
1456
  };
235
1457
 
236
1458
  export declare interface UseModalAttributesOptions {
@@ -258,7 +1480,7 @@ export declare interface UseModalAttributesOptions {
258
1480
  id?: string;
259
1481
  }
260
1482
 
261
- export declare function useObservedElement(name: string | string[]): TabsterTypes.TabsterDOMAttribute;
1483
+ export declare function useObservedElement(name: string | string[]): Types.TabsterDOMAttribute;
262
1484
 
263
1485
  /**
264
1486
  * Instantiates [keyborg](https://github.com/microsoft/keyborg) and subscribes to changes
@@ -272,13 +1494,13 @@ export declare function useOnKeyboardNavigationChange(callback: (isNavigatingWit
272
1494
  * Focus will be restored to the most recent target element when it is lost from a source
273
1495
  * @returns Attribute to apply to the element that might lose focus
274
1496
  */
275
- export declare function useRestoreFocusSource(): TabsterTypes.TabsterDOMAttribute;
1497
+ export declare function useRestoreFocusSource(): Types.TabsterDOMAttribute;
276
1498
 
277
1499
  /**
278
1500
  * Focus will be restored to the most recent target element when it is lost from a source
279
1501
  * @returns Attribute to apply to the target element where focus is restored
280
1502
  */
281
- export declare function useRestoreFocusTarget(): TabsterTypes.TabsterDOMAttribute;
1503
+ export declare function useRestoreFocusTarget(): Types.TabsterDOMAttribute;
282
1504
 
283
1505
  /**
284
1506
  */
@@ -288,12 +1510,27 @@ export declare function useSetKeyboardNavigation(): (isNavigatingWithKeyboard: b
288
1510
  * @internal
289
1511
  * Hook that returns tabster attributes while ensuring tabster exists
290
1512
  */
291
- export declare const useTabsterAttributes: (props: TabsterTypes.TabsterAttributeProps) => TabsterTypes.TabsterDOMAttribute;
1513
+ export declare const useTabsterAttributes: (props: Types.TabsterAttributeProps) => Types.TabsterDOMAttribute;
292
1514
 
293
1515
  /**
294
1516
  * Designates an area where tabster does not control focus
295
1517
  * @returns Attribute to apply to the target element that should be uncontrolled by tabster
296
1518
  */
297
- export declare function useUncontrolledFocus(): TabsterTypes.TabsterDOMAttribute;
1519
+ export declare function useUncontrolledFocus(): Types.TabsterDOMAttribute;
1520
+
1521
+ declare interface Visibilities {
1522
+ Invisible: 0;
1523
+ PartiallyVisible: 1;
1524
+ Visible: 2;
1525
+ }
1526
+
1527
+ declare const Visibilities: Visibilities;
1528
+
1529
+ declare type Visibility = Visibilities[keyof Visibilities];
1530
+
1531
+ declare interface WeakHTMLElement<D = undefined> {
1532
+ get(): HTMLElement | undefined;
1533
+ getData(): D | undefined;
1534
+ }
298
1535
 
299
1536
  export { }