@sheetxl/utils-react 0.1.94 → 0.1.97

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,1360 @@
1
+ import { CellCoords } from '@sheetxl/utils';
2
+ import { default as default_2 } from 'react';
3
+ import { DependencyList } from 'react';
4
+ import { Dimensions } from '@sheetxl/utils';
5
+ import { Direction } from '@sheetxl/utils';
6
+ import { EditModeHandler } from '@sheetxl/utils';
7
+ import { JSX } from 'react/jsx-runtime';
8
+ import { ReferenceableClipboard } from '@sheetxl/utils';
9
+ import { RemoveListener } from '@sheetxl/utils';
10
+ import { TopLeft } from '@sheetxl/utils';
11
+ import { UndoManager } from '@sheetxl/utils';
12
+
13
+ declare function boundPixel(pixel: number, _increase?: boolean, _absOffset?: number): number;
14
+
15
+ export declare interface BusyNotificationOptions {
16
+ icon?: React.ReactNode;
17
+ }
18
+
19
+ export declare type CellFinder = (activeCoords: CellCoords, isContentfulCell: IsContentfulCell | undefined, hiddenAt: HiddenHeadersAt | undefined, direction: Direction, first: boolean, limit: number) => number;
20
+
21
+ export declare interface CellLayout {
22
+ /**
23
+ * Returns the offset given an index.
24
+ */
25
+ getColOffset: ItemSizer;
26
+ /**
27
+ * Returns the index given an offset.
28
+ */
29
+ getColIndex: ItemSizer;
30
+ /**
31
+ * Returns the offset given an index.
32
+ */
33
+ getRowOffset: ItemSizer;
34
+ /**
35
+ * Returns the index given an offset.
36
+ */
37
+ getRowIndex: ItemSizer;
38
+ }
39
+
40
+ export declare type ClickOrFocusAwayListener = (event: globalThis.MouseEvent | globalThis.KeyboardEvent) => void;
41
+
42
+ export declare interface ClickOrFocusAwayOptions {
43
+ mouseEvents?: boolean;
44
+ focusEvents?: boolean;
45
+ }
46
+
47
+ export declare class Command<STATE extends any = void, CONTEXT extends any = void> implements ICommand<STATE, CONTEXT> {
48
+ protected _key: string;
49
+ protected _target: ICommands.ITarget | (() => ICommands.ITarget);
50
+ protected _label: DynamicValue<string, CONTEXT>;
51
+ protected _scopedLabels?: Record<string, DynamicValue<string, CONTEXT>>;
52
+ protected _description?: DynamicValue<string, CONTEXT>;
53
+ protected _icon: DynamicValue<React.ReactNode, CONTEXT>;
54
+ protected _tags: DynamicValue<string[], CONTEXT>;
55
+ protected _shortcut: DynamicValue<IKeyStroke | IKeyStroke[] | null, CONTEXT>;
56
+ protected _disabled: DynamicValue<boolean, CONTEXT>;
57
+ protected _state: STATE;
58
+ protected _context: CONTEXT;
59
+ protected _callback: ICommandCallback<STATE>;
60
+ protected _listenersProperties: Set<ICommandPropertyListener<STATE, CONTEXT>>;
61
+ protected _listenersExecute: Set<ICommandHook<STATE, CONTEXT>>;
62
+ constructor(key: string, target: ICommands.ITarget | (() => ICommands.ITarget), props?: ICommandProperties<STATE, CONTEXT>, callback?: ICommandCallback<STATE>);
63
+ key(): string;
64
+ protected _resolve<T = any>(value: DynamicValue<T, CONTEXT>, scopedContext?: CONTEXT | (() => CONTEXT)): T;
65
+ target(): ICommands.ITarget;
66
+ label(scope?: string, scopedContext?: CONTEXT): string;
67
+ description(context?: DynamicContext<CONTEXT>): string;
68
+ tags(context?: DynamicContext<CONTEXT>): string[];
69
+ icon(context?: DynamicContext<CONTEXT>): React.ReactNode;
70
+ shortcut(): IKeyStroke | IKeyStroke[];
71
+ disabled(): boolean;
72
+ state(): STATE;
73
+ context(): any;
74
+ execute(args: STATE, hook?: ICommandHook<STATE, CONTEXT>): Promise<boolean>;
75
+ /**
76
+ * This is call when any command properties are changed but not when the callback is changed
77
+ */
78
+ addPropertyListener(listener: ICommandPropertyListener<STATE, CONTEXT>, fireOnListen?: boolean): RemoveListener;
79
+ addExecuteListener(listener: ICommandHook<STATE, CONTEXT>): RemoveListener;
80
+ protected _notifyExecute(args: STATE): void;
81
+ protected _notifyError(error: any, args: STATE): void;
82
+ updateCallback(callback: ICommandCallback<STATE>): ICommand<STATE, CONTEXT>;
83
+ update(props: ICommandProperties<STATE, CONTEXT>): ICommand<STATE, CONTEXT>;
84
+ protected _notifyPropertyChange(props: ICommandProperties<STATE, CONTEXT>): void;
85
+ protected _applyProps(props: ICommandProperties<STATE, CONTEXT>): ICommandProperties<STATE, CONTEXT>;
86
+ }
87
+
88
+ export declare interface CommandButtonCreator {
89
+ }
90
+
91
+ export declare interface CommandButtonMeta {
92
+ }
93
+
94
+ export declare interface CommandButtonRegistry {
95
+ }
96
+
97
+ /**
98
+ * Follow useCommandsButtons. pattern createCommandButtonSet
99
+ *
100
+ * Use ProviderContext or just set a singleton. (research why/which)
101
+ *
102
+ * Register icon, label, description
103
+ * { commandManager.createButton( commands.getCommand('formatAlignLeftToggle'), CommandButtonType.TOOLBAR ) }
104
+ *
105
+ * Register factory for each type of Command
106
+ * Register configuration for each key
107
+ *
108
+ * When registering to a component also
109
+ *
110
+ */
111
+ export declare const CommandButtonType: {
112
+ /**
113
+ * Suitable for toolbars. Click to open, click to close, generally disabled as icon
114
+ */
115
+ readonly Toolbar: "toolbar";
116
+ /**
117
+ * Suitable for menus. HoverIn to open, hover leave to close, generally disabled as icon and text
118
+ */
119
+ readonly Menuitem: "menuitem";
120
+ };
121
+
122
+ export declare type CommandButtonType = typeof CommandButtonType[keyof typeof CommandButtonType];
123
+
124
+ /**
125
+ * Default implementation of `ICommands.IGroup`.
126
+ */
127
+ export declare class CommandGroup implements ICommands.IGroup {
128
+ protected _target: ICommands.ITarget | (() => ICommands.ITarget);
129
+ protected _groupKey: string;
130
+ protected _root: CommandGroup | null;
131
+ protected _parent: CommandGroup | null;
132
+ protected _focused: CommandGroup;
133
+ protected _nodes: Map<string, CommandGroup>;
134
+ protected _uuid: string;
135
+ protected _children: Map<string, ICommands.IGroup>;
136
+ protected _commandsByKey: Map<string, ICommand<any, any>>;
137
+ protected _commandsByShortcut: Map<string, string>;
138
+ protected _listeners: Set<ICommands.IListener>;
139
+ protected _listenersByKey: Map<string, Set<ICommands.IListener> | null>;
140
+ protected _unListenersByCommand: Map<ICommand, RemoveListener>;
141
+ protected _commandsPropertyListener: ICommandPropertyListener<any, any>;
142
+ constructor(target: ICommands.ITarget | (() => ICommands.ITarget), groupKey?: string);
143
+ private _getCommand;
144
+ /** {@inheritDoc ICommands.IGroup.getCommand} */
145
+ getCommand(key: string, _ignoreActive?: boolean): ICommand<any, any>;
146
+ /** {@inheritDoc ICommands.IGroup.createChildGroup} */
147
+ createChildGroup(target: ICommands.ITarget | (() => ICommands.ITarget), when: string, replace?: boolean): ICommands.IGroup;
148
+ /** {@inheritDoc ICommands.IGroup.getKey} */
149
+ getKey(): string;
150
+ /** {@inheritDoc ICommands.IGroup.getGroup} */
151
+ getGroup(key: string): ICommands.IGroup | null;
152
+ protected _addCommands(commands: readonly ICommand<any, any>[], replace?: boolean): void;
153
+ /** {@inheritDoc ICommands.IGroup.removeFromParent} */
154
+ removeFromParent(): void;
155
+ /** {@inheritDoc ICommands.IGroup.addCommands} */
156
+ addCommands(commands: readonly ICommand<any, any>[], replace?: boolean): void;
157
+ /** {@inheritDoc ICommands.IGroup.getActive} */
158
+ getActive(): ICommands.IGroup;
159
+ /** {@inheritDoc ICommands.IGroup.activate} */
160
+ activate(groupKey?: string): void;
161
+ /** {@inheritDoc ICommands.IGroup.findCommandByEvent} */
162
+ findCommandByEvent(e: React.KeyboardEvent): ICommand | null;
163
+ /** {@inheritDoc ICommands.IGroup.dispatchToFocusedCommand} */
164
+ dispatchToFocusedCommand(e: React.KeyboardEvent): boolean;
165
+ /** {@inheritDoc ICommands.IGroup.getRoot} */
166
+ getRoot(): ICommands.IGroup;
167
+ /** {@inheritDoc ICommands.IGroup.getParent} */
168
+ getParent(): ICommands.IGroup | null;
169
+ /** {@inheritDoc ICommands.IGroup.addListener} */
170
+ addListener(listener: ICommands.IListener, options?: ICommands.IListenerOptions): RemoveListener;
171
+ protected _notifyCommands(listeners: Set<ICommands.IListener>, key: keyof ICommands.IListener, args?: any): void;
172
+ protected _notify(key: keyof ICommands.IListener, args?: any): void;
173
+ /** {@inheritDoc ICommands.IGroup.getAllCommands} */
174
+ getAllCommands(): {
175
+ command: ICommand<any, any>;
176
+ groupKey: string;
177
+ }[];
178
+ }
179
+
180
+ export declare interface CopyPasteProps {
181
+ source: ReferenceableClipboard.Source;
182
+ target?: ReferenceableClipboard.Target;
183
+ commands?: ICommands.IGroup;
184
+ /**
185
+ * Called when the clipboard is updated.
186
+ * @param reference If `null` then the clipboard was cleared.
187
+ */
188
+ onClipboardUpdate?: (reference: ReferenceableClipboard.ReferenceItem | null) => void;
189
+ /**
190
+ * Called after paste has been called.
191
+ */
192
+ onPaste?: (reference: ReferenceableClipboard.ReferenceItem, args: ReferenceableClipboard.PasteOptions) => void;
193
+ /**
194
+ * A notifier to provide for warnings and errors.
195
+ */
196
+ notifier?: Notifier;
197
+ }
198
+
199
+ export declare interface CopyPasteResults {
200
+ copy: (args?: ReferenceableClipboard.CopyOptions) => void;
201
+ paste: (args?: ReferenceableClipboard.PasteOptions) => void;
202
+ /**
203
+ * The clipboard used. Generally the `InternalClipboard.Global`.
204
+ */
205
+ clipboard: ReferenceableClipboard;
206
+ }
207
+
208
+ declare const createSyntheticEvent: <T extends Element, E extends Event>(event: E) => React.SyntheticEvent<T, E>;
209
+
210
+ export declare const defaultCreateScrollbar: (props: ScrollbarRefProps) => JSX.Element;
211
+
212
+ export declare const defaultCreateScrollCorner: ({ width, height }: {
213
+ width: any;
214
+ height: any;
215
+ }) => JSX.Element;
216
+
217
+ /**
218
+ * TODO - implement styling support similar to other scroll buttons. Currently hardcoded
219
+ */
220
+ export declare const defaultCreateScrollEdgeButton: (props: ScrollButtonProps) => default_2.ReactElement;
221
+
222
+ /**
223
+ * Relies on external styling. Follows the styling of scrollbars pattern. @see https://css-tricks.com/custom-scrollbars-in-webkit/
224
+ * class of scrollbar-button, vertical or horizontal, end
225
+ */
226
+ export declare const defaultCreateScrollEndButton: (props: ScrollButtonProps) => default_2.ReactElement;
227
+
228
+ /**
229
+ * Relies on external styling. Follows the styling of scrollbars pattern. @see https://css-tricks.com/custom-scrollbars-in-webkit/
230
+ * class of scrollbar-button, vertical or horizontal, end
231
+ */
232
+ export declare const defaultCreateScrollStartButton: (props: ScrollButtonProps) => default_2.ReactElement;
233
+
234
+ export declare const DefaultNotifier: Notifier;
235
+
236
+ /**
237
+ * Re-export detectIt.
238
+ * @returns The `detect-it` library.
239
+ */
240
+ declare function detectIt(): {
241
+ supportsPassiveEvents: boolean;
242
+ supportsPointerEvents: boolean;
243
+ supportsTouchEvents: boolean;
244
+ deviceType: 'mouseOnly' | 'touchOnly' | 'hybrid';
245
+ primaryInput: 'mouse' | 'touch';
246
+ };
247
+
248
+ export declare interface DevicePixelRatioOptions {
249
+ /**
250
+ * Default DPR to use if browser does not support the `devicePixelRatio`
251
+ * property, or when rendering on server
252
+ *
253
+ * @defaultValue `1`
254
+ */
255
+ defaultDpr?: number;
256
+ /**
257
+ * Whether or not to round the number down to the closest integer
258
+ *
259
+ * @defaultValue `true`
260
+ */
261
+ round?: boolean;
262
+ /**
263
+ * Maximum DPR to return (set to `2` to only generate 1 and 2)
264
+ *
265
+ * @defaultValue `3`
266
+ */
267
+ maxDpr?: number;
268
+ }
269
+
270
+ declare type DynamicContext<CONTEXT> = CONTEXT | (() => CONTEXT);
271
+
272
+ declare type DynamicValue<T, CONTEXT> = T | ((context?: DynamicContext<CONTEXT>) => T);
273
+
274
+ declare const EmptyCssProperties: React.CSSProperties;
275
+
276
+ declare const focusableNodeNames: Set<string>;
277
+
278
+ /**
279
+ * Wrap around a div to allow. This will navigate through enabled divs with tabindex (but only one level deep)
280
+ * It uses the current layout to determine navigation
281
+ * TODO - we need to find an
282
+ * tab/shift-tab navigation
283
+ * arrow key navigation
284
+ *
285
+ * another option is to use rowindex/columnIndex attributes?
286
+ *
287
+ * default direction (for tab)
288
+ */
289
+ export declare const FocusKeyNavigation: default_2.FC<FocusKeyNavigationProps>;
290
+
291
+ export declare interface FocusKeyNavigationProps extends default_2.HTMLAttributes<HTMLDivElement> {
292
+ refFocusStart?: default_2.RefObject<HTMLElement>;
293
+ /**
294
+ * If tab and all tabIndices are the same which direction should the tab scan. Note - shift tab will go the opposite direction
295
+ */
296
+ tabForward?: Direction;
297
+ }
298
+
299
+ export declare interface FullscreenPortalRoot {
300
+ getPortalContainer: () => Element;
301
+ }
302
+
303
+ /**
304
+ * Returns the current device pixel ratio (DPR) given the passed options
305
+ *
306
+ * @param options
307
+ * @returns current device pixel ratio
308
+ */
309
+ export declare function getDevicePixelRatio(options?: DevicePixelRatioOptions): number;
310
+
311
+ export declare const getPortalContainer: () => Element;
312
+
313
+ /**
314
+ * scan all elements until we find one in the given direction
315
+ * Note - only horizontal at the moment
316
+ */
317
+ declare const getScrollTo: (currentLocation: number, boundary: number, children: any, isLeft: boolean, defaultValue?: number) => number;
318
+
319
+ export declare interface HiddenHeadersAt {
320
+ /**
321
+ * A called back to traverse hidden headers
322
+ */
323
+ (index: number, reverse?: boolean): number;
324
+ }
325
+
326
+ export declare const HorizontalAlignment: {
327
+ /**
328
+ * Aligned based on the data value.
329
+ * Text data is left-aligned. Numbers, dates, and times are right-aligned. Boolean types are centered.
330
+ */
331
+ readonly General: "general";
332
+ readonly Left: "left";
333
+ readonly Right: "right";
334
+ readonly Center: "center";
335
+ readonly Justify: "justify";
336
+ readonly Fill: "fill";
337
+ /** Not Supported */
338
+ readonly Distributed: "distributed";
339
+ /** Not Supported */
340
+ readonly CenterContinuous: "centerContinuous";
341
+ };
342
+
343
+ export declare type HorizontalAlignment = typeof HorizontalAlignment[keyof typeof HorizontalAlignment];
344
+
345
+ export declare interface ICommand<STATE extends any = any, CONTEXT extends any = void> {
346
+ /**
347
+ * A unique key for the command. This is how the command is identified
348
+ * within the CommandTree
349
+ *
350
+ * @remarks
351
+ * Immutable
352
+ */
353
+ key(): string;
354
+ target(): ICommands.ITarget;
355
+ disabled(): boolean;
356
+ execute(args?: STATE, hook?: ICommandHook<STATE, CONTEXT>): Promise<boolean>;
357
+ /**
358
+ * Represents the current state of the value that can also be set
359
+ */
360
+ state(): STATE;
361
+ context(): CONTEXT;
362
+ /**
363
+ * Additional information that may be needed to render or make decisions about setting state.
364
+ */
365
+ update(props: ICommandProperties<STATE, CONTEXT>): ICommand<STATE, CONTEXT>;
366
+ updateCallback(callback: ICommandCallback<STATE>): ICommand<STATE, CONTEXT>;
367
+ /**
368
+ * This is call when any command properties are changed but not when the callback is changed
369
+ */
370
+ addPropertyListener(listener: ICommandPropertyListener<STATE, CONTEXT>, fireOnListen?: boolean): RemoveListener;
371
+ addExecuteListener(listener: ICommandHook<STATE, CONTEXT>): RemoveListener;
372
+ shortcut(): IKeyStroke | IKeyStroke[];
373
+ label(scope?: string, context?: DynamicContext<CONTEXT>): string;
374
+ tags(context?: DynamicContext<CONTEXT>): string[];
375
+ description(context?: DynamicContext<CONTEXT>): string;
376
+ icon(context?: DynamicContext<CONTEXT>): React.ReactNode;
377
+ }
378
+
379
+ export declare interface ICommandCallback<STATE extends any = void> {
380
+ (args?: STATE, command?: ICommand<STATE, unknown>): void | boolean | Promise<boolean> | Promise<void>;
381
+ }
382
+
383
+ /**
384
+ * A hook that can be passed to a command execute function.
385
+ */
386
+ export declare interface ICommandHook<STATE extends any, CONTEXT extends any = void> {
387
+ /**
388
+ * If implemented will be called when execute is called. If a promise is return if will wait until
389
+ * this is completed.
390
+ *
391
+ * @param command
392
+ * @param args
393
+ */
394
+ beforeExecute?(command: ICommand<STATE, CONTEXT>, args: STATE): Promise<boolean | void> | boolean | void;
395
+ /**
396
+ * Called when a command has been executed successful.
397
+ */
398
+ onExecute?(command: ICommand<STATE, CONTEXT>, args: STATE): void;
399
+ /**
400
+ * Called when a command failed to executed successfully.
401
+ */
402
+ onError?(command: ICommand<STATE, CONTEXT>, error: any, args: STATE): void;
403
+ }
404
+
405
+ export declare interface ICommandListener<STATE extends any, CONTEXT extends any = void> extends ICommandHook<STATE, CONTEXT> {
406
+ onChange?(command: ICommand<STATE, CONTEXT>): void;
407
+ }
408
+
409
+ export declare interface ICommandListenerOptions {
410
+ fireOnCommandChange: boolean;
411
+ }
412
+
413
+ export declare interface ICommandProperties<STATE extends any = void, CONTEXT extends any = void> {
414
+ disabled?: boolean | (() => boolean);
415
+ state?: STATE;
416
+ context?: DynamicContext<CONTEXT>;
417
+ shortcut?: IKeyStroke | IKeyStroke[] | (() => IKeyStroke);
418
+ label?: DynamicValue<string, CONTEXT>;
419
+ tags?: DynamicValue<string[], CONTEXT>;
420
+ /**
421
+ * The ability to override labels for specific context. Useful for content menus
422
+ * For example 'Rename Sheet' command might only want to be displayed as 'Rename' in the content menu.
423
+ */
424
+ scopedLabels?: Record<string, DynamicValue<string, CONTEXT>>;
425
+ description?: DynamicValue<string, CONTEXT>;
426
+ icon?: DynamicValue<React.ReactNode, CONTEXT>;
427
+ }
428
+
429
+ export declare interface ICommandPropertyListener<STATE extends any, CONTEXT extends any> {
430
+ /**
431
+ * Called when command properties have changed.
432
+ */
433
+ (props: ICommandProperties<STATE, CONTEXT>, command: ICommand<STATE, CONTEXT>): void;
434
+ }
435
+
436
+ /**
437
+ * The ICommands namespace contains interfaces for managing collections of commands and
438
+ * dispatching keystrokes to the most specific command.
439
+ *
440
+ * @remarks
441
+ * This is done by creating a hierarchy of command groups and tracking the 'most focused' group.
442
+ * All keystrokes will walk up the commands groups until a command is found.
443
+ *
444
+ */
445
+ export declare namespace ICommands {
446
+ export interface IListener {
447
+ /**
448
+ * Called when the active group has changed.
449
+ * @param source
450
+ */
451
+ onActiveChange?(source: ICommands.IGroup): void;
452
+ /**
453
+ * Called when a command has changed.
454
+ * @param source
455
+ * @param command
456
+ *
457
+ * @remarks
458
+ * For this to be enabled the keys must be provided in the {@link ICommands.IListenerOptions}.
459
+ */
460
+ onCommandChange?(source: ICommands.IGroup, command: ICommand): void;
461
+ /**
462
+ * Called when any change to the resolvable commands has occurred.
463
+ *
464
+ * @remarks
465
+ * This can be either due to changed the active or commands were added
466
+ */
467
+ onGroupChange?(source: ICommands.IGroup): void;
468
+ }
469
+ export interface IListenerOptions {
470
+ /**
471
+ * If provided then the onCommandChange will be called when the command changes.
472
+ */
473
+ keys?: string[];
474
+ }
475
+ /**
476
+ * Used to interactive with a dom element.
477
+ *
478
+ * @remarks
479
+ * * When dispatching keystrokes the target is used to determine if the keystroke
480
+ * can be consumed by the element.
481
+ * * Many commands will refocus the target after they have completed. The target focus will be called.
482
+ */
483
+ export interface ITarget {
484
+ /**
485
+ * Used to determine if a dom element is contained with the group.
486
+ *
487
+ * @param element
488
+ *
489
+ * @remarks
490
+ * This is used for validating keystrokes and focus traversal.
491
+ */
492
+ contains(element: Node | null): boolean;
493
+ /**
494
+ * Called after a command is executed.
495
+ */
496
+ focus(): void;
497
+ }
498
+ /**
499
+ * Contains commands and child command maps.
500
+ */
501
+ export interface ILookup {
502
+ /**
503
+ * Return a command that matches the key.
504
+ *
505
+ * @remarks
506
+ * Search both the current and any child commands groups that are actives.
507
+ */
508
+ getCommand(key: string): ICommand<any, any>;
509
+ }
510
+ /**
511
+ * A command group is a collection of commands and child command groups.
512
+ */
513
+ export interface IGroup extends ICommands.ILookup {
514
+ /**
515
+ * Create a new map to add Commands.
516
+ *
517
+ * @param target {@link ICommands.ITarget}.
518
+ * @param groupKey String description describing the reason for the group. This is presented to the user in the shortcut UI.
519
+ * @param replace If `true` replace the existing commands. If `false` ignores duplicates. If unspecified a warning will be logged for duplicates.
520
+ */
521
+ createChildGroup(target: ICommands.ITarget | (() => ICommands.ITarget), groupKey: string, replace?: boolean): ICommands.IGroup;
522
+ /**
523
+ * Returns the keys associated with the group
524
+ */
525
+ getKey(): string;
526
+ /**
527
+ * Remove the command group from the parent.
528
+ * @remarks
529
+ * If this is the root this operation will have no effect
530
+ */
531
+ removeFromParent(): void;
532
+ /**
533
+ * Returns a group for the given when string.
534
+ */
535
+ getGroup(key: string): ICommands.IGroup | null;
536
+ /**
537
+ * Add a collection of commands to the group.
538
+ * @param commands The commands to add.
539
+ * @param replace If `true` replace the existing commands. If `false` ignores duplicates. If unspecified a warning will be logged for duplicates.
540
+ * @remarks
541
+ * Set the commands for the current node.
542
+ */
543
+ addCommands(commands: readonly ICommand<any, any>[], replace?: boolean): void;
544
+ /**
545
+ * Set the command group to the 'focused group.
546
+ * @param key The key of the group to activate. If not provided then the current group is activated.
547
+ */
548
+ activate(key?: string): void;
549
+ /**
550
+ * Return the active group.
551
+ *
552
+ * @remarks
553
+ * This is the group that the dispatch will start from.
554
+ */
555
+ getActive(): ICommands.IGroup;
556
+ /**
557
+ *
558
+ * @param e The keyboard event to dispatch
559
+ */
560
+ dispatchToFocusedCommand(e: React.KeyboardEvent): boolean;
561
+ /**
562
+ * Returns the top most commands group.
563
+ *
564
+ * @remarks
565
+ * If root then will return return itself.
566
+ */
567
+ getRoot(): ICommands.IGroup;
568
+ /**
569
+ * Returns the parent command group.
570
+ *
571
+ * @remarks
572
+ * If root then will return return itself.
573
+ */
574
+ getParent(): ICommands.IGroup | null;
575
+ /**
576
+ * Add listener.
577
+ */
578
+ addListener(listener: ICommands.IListener, options?: ICommands.IListenerOptions): RemoveListener;
579
+ /**
580
+ * Returns a list of all commands in the group and all children commands.
581
+ * @remarks
582
+ * This does not return parent commands.
583
+ */
584
+ getAllCommands(): {
585
+ command: ICommand<any, any>;
586
+ groupKey: string;
587
+ }[];
588
+ /**
589
+ * Return a command that matched the keyboard event or `null` if no command was found.
590
+ *
591
+ * @param e The keyboard event.
592
+ */
593
+ findCommandByEvent(e: React.KeyboardEvent): ICommand | null;
594
+ }
595
+ }
596
+
597
+ export declare interface ICommandsListeners<STATE extends any, CONTEXT extends any = void> extends ICommandHook<STATE, CONTEXT> {
598
+ /**
599
+ * Called when either the command group is updated or if keys are provided then the commands as well.
600
+ * @param commands
601
+ */
602
+ onChange?(commands: ICommands.IGroup): void;
603
+ }
604
+
605
+ export declare interface IKeyStroke {
606
+ readonly key: string;
607
+ readonly modifiers?: KeyModifiers[];
608
+ }
609
+
610
+ export declare interface InputOptionsNotificationOptions extends OptionsNotificationOptions {
611
+ initialValue?: string;
612
+ /**
613
+ * Css style for input
614
+ */
615
+ inputProps?: React.HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>;
616
+ inputLabel?: string;
617
+ inputType?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
618
+ inputPlaceHolder?: string;
619
+ onInputOption?: (input?: string, option?: string) => void;
620
+ /**
621
+ * Call when an option is selected. If false is returned, the the
622
+ * dialog will not close. Notification is not provided but can
623
+ * be supplied via the textFieldProps helperText property.
624
+ * @remarks
625
+ * Optional the textProps can be updated via the textFieldProps argument
626
+ */
627
+ onValidateInputOption?: (input?: string, option?: string) => InputValidationResults | Promise<InputValidationResults>;
628
+ }
629
+
630
+ export declare interface InputResults {
631
+ input: string;
632
+ option: string;
633
+ }
634
+
635
+ export declare interface InputValidationResults {
636
+ valid: boolean;
637
+ message?: string;
638
+ }
639
+
640
+ export declare interface IsContentfulCell {
641
+ (coords: CellCoords): boolean;
642
+ }
643
+
644
+ export declare interface IScrollPaneElement extends HTMLDivElement, ScrollPaneAttributes {
645
+ }
646
+
647
+ export declare interface IShowToolTipProperties {
648
+ /**
649
+ * The anchor for the tooltip. x,y are required
650
+ * but width and height can also be provided.
651
+ */
652
+ anchor: {
653
+ x: number;
654
+ y: number;
655
+ width?: number;
656
+ height?: number;
657
+ };
658
+ /**
659
+ * The value to display. This is either a string or a react element
660
+ */
661
+ display?: string | default_2.ReactElement;
662
+ /**
663
+ * Purely suggestion only
664
+ * If not specified then the consumer will determine
665
+ */
666
+ placement?: ToolTipPlacement;
667
+ }
668
+
669
+ export declare interface ISplitPaneElement extends HTMLDivElement, SplitPaneAttributes {
670
+ }
671
+
672
+ export declare type ItemSizer = (index: number) => number;
673
+
674
+ export declare const KeyCodes: {
675
+ readonly BackSpace: 8;
676
+ readonly Tab: 9;
677
+ readonly Clear: 12;
678
+ readonly Enter: 13;
679
+ readonly Shift: 16;
680
+ readonly Control: 17;
681
+ readonly Alt: 18;
682
+ readonly Pause: 19;
683
+ readonly CapsLock: 20;
684
+ readonly Escape: 27;
685
+ readonly Space: 32;
686
+ readonly PageUp: 33;
687
+ readonly PageDown: 34;
688
+ readonly End: 35;
689
+ readonly Home: 36;
690
+ readonly Left: 37;
691
+ readonly Up: 38;
692
+ readonly Right: 39;
693
+ readonly Down: 40;
694
+ readonly Insert: 45;
695
+ readonly Delete: 46;
696
+ readonly Digit_8: 56;
697
+ readonly Y: 89;
698
+ readonly Z: 90;
699
+ readonly Meta: 91;
700
+ readonly F1: 112;
701
+ readonly F2: 113;
702
+ readonly F3: 114;
703
+ readonly F4: 115;
704
+ readonly F5: 116;
705
+ readonly F6: 117;
706
+ readonly F7: 118;
707
+ readonly F8: 119;
708
+ readonly F9: 120;
709
+ readonly F10: 121;
710
+ readonly F11: 122;
711
+ readonly F12: 123;
712
+ readonly NumLock: 144;
713
+ readonly ScrollLock: 145;
714
+ readonly BackSlash: 220;
715
+ readonly Slash: 191;
716
+ readonly BracketRight: 221;
717
+ readonly BracketLeft: 219;
718
+ };
719
+
720
+ export declare type KeyCodes = typeof KeyCodes[keyof typeof KeyCodes];
721
+
722
+ export declare const KeyModifiers: {
723
+ readonly Shift: "shift";
724
+ readonly Alt: "alt";
725
+ readonly Ctrl: "ctrl";
726
+ readonly Meta: "meta";
727
+ };
728
+
729
+ export declare type KeyModifiers = typeof KeyModifiers[keyof typeof KeyModifiers];
730
+
731
+ export declare const MouseButtonCodes: {
732
+ readonly Left: 1;
733
+ readonly Middle: 2;
734
+ readonly Right: 3;
735
+ };
736
+
737
+ export declare type MouseButtonCodes = typeof MouseButtonCodes[keyof typeof MouseButtonCodes];
738
+
739
+ /**
740
+ * Configuration for non-blocking notifications.
741
+ */
742
+ declare interface NotificationOptions_2 {
743
+ /**
744
+ * A hint for decorations of the message.
745
+ */
746
+ type?: NotificationType;
747
+ /**
748
+ * Setting this to true will leave the notification on the screen unless it is dismissed (programmatically or through user interaction).
749
+ * If `false` will be removed after a period of time.
750
+ *
751
+ * @defaultValue false
752
+ */
753
+ persist?: boolean;
754
+ /**
755
+ * Ignores displaying multiple snackBars with the same `message`.
756
+ *
757
+ * @defaultValue false
758
+ */
759
+ preventDuplicate?: boolean;
760
+ /**
761
+ * If provided then then notification provider should not notify if the same id is used again.
762
+ */
763
+ onceKey?: string;
764
+ /**
765
+ * Passed directly to the Snackbar component.
766
+ */
767
+ enqueueProps?: Record<string, any>;
768
+ }
769
+ export { NotificationOptions_2 as NotificationOptions }
770
+
771
+ /**
772
+ * Indicates the type of notification.
773
+ */
774
+ export declare const NotificationType: {
775
+ readonly Default: "default";
776
+ readonly Error: "error";
777
+ readonly Success: "success";
778
+ readonly Warning: "warning";
779
+ readonly Info: "info";
780
+ };
781
+
782
+ export declare type NotificationType = typeof NotificationType[keyof typeof NotificationType];
783
+
784
+ /**
785
+ * Interface that provides popups for the user.
786
+ */
787
+ export declare interface Notifier {
788
+ /**
789
+ * Useful when informing the user of something but are not expecting a response.
790
+ */
791
+ showMessage?: (message: string | React.ReactNode, options?: NotificationOptions_2) => void;
792
+ /**
793
+ * Useful when performing a long running operation and you want to inform the user.
794
+ *
795
+ * A return type of a handler will be returned to allow for hideBusy.
796
+ * If multiple calls are made the consumer should continue to indicated blocked
797
+ * until all calls have been hideBusy.
798
+ */
799
+ showBusy?: (message: string | React.ReactNode, options?: BusyNotificationOptions) => (Promise<() => void>) | (() => void);
800
+ /**
801
+ * Show a dialog for a given type.
802
+ * @param type
803
+ * @param props
804
+ * @param options
805
+ */
806
+ showWindow?: (type: string, props?: any, options?: {
807
+ disableAutoDestroy?: boolean;
808
+ }) => Promise<HTMLElement>;
809
+ /**
810
+ * Should return error object exception.
811
+ *
812
+ * @param error
813
+ */
814
+ showError?: (error: Error | string) => void;
815
+ /**
816
+ * Provide a user with a list of options to choose from.
817
+ * @param options
818
+ */
819
+ showOptions?: (options: OptionsNotificationOptions) => Promise<string>;
820
+ /**
821
+ * Provider a user with a way to enter a text input.
822
+ * @param options
823
+ */
824
+ showInputOptions?: (options: InputOptionsNotificationOptions) => Promise<InputResults>;
825
+ }
826
+
827
+ export declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
828
+
829
+ /**
830
+ * Configuration for an options dialog.
831
+ */
832
+ export declare interface OptionsNotificationOptions extends React.HTMLAttributes<HTMLDivElement> {
833
+ /**
834
+ * The options as a list of strings
835
+ */
836
+ options?: string[];
837
+ /**
838
+ * The title of the options panel
839
+ */
840
+ title?: string;
841
+ /**
842
+ * Display text information for the user to make a decision.
843
+ */
844
+ description?: string;
845
+ /**
846
+ * Display an icon next to the description for additional context
847
+ *
848
+ * @remarks
849
+ * Not yet implemented
850
+ */
851
+ icon?: React.ReactNode;
852
+ /**
853
+ * Allows for the option will be the default selected option and the enter key trigger.
854
+ * @defaultValue The first option
855
+ */
856
+ defaultOption?: string;
857
+ /**
858
+ * Allows for the cancel option to be specified. Allow for special styling.
859
+ * @defaultValue 'Cancel'
860
+ */
861
+ cancelOption?: string;
862
+ /**
863
+ * Call when an option is selected.
864
+ * @remarks
865
+ * It is possible that the option can be both a cancel and a default option.
866
+ */
867
+ onOption?: (option: string, isCancel: boolean, isDefault: boolean) => void;
868
+ /**
869
+ * Hook for create custom options buttons
870
+ * @param props
871
+ *
872
+ * @remarks
873
+ * The option is passed as the `children` prop and as the second argument
874
+ */
875
+ createOptionsButton?: (option: string, props: React.HTMLAttributes<HTMLButtonElement> & React.Attributes, isDefaultOption: boolean) => React.ReactNode;
876
+ /**
877
+ * Call when an option is selected. If false is returned, the the
878
+ * dialog will not close. Notification is not provided but can
879
+ * be supplied via the textFieldProps helperText property.
880
+ */
881
+ onValidateOption?: (option?: string) => boolean | Promise<boolean>;
882
+ }
883
+
884
+ /**
885
+ * If returns false don't setup the other listeners
886
+ */
887
+ export declare type PointerDownListener = (event: default_2.PointerEvent<Element>) => void;
888
+
889
+ export declare interface PointerHandlerOptions {
890
+ /**
891
+ * If returns false then other events will not be fired
892
+ */
893
+ onPointerDown: (event: default_2.PointerEvent<Element>, modifiers: PointerModifiers) => boolean | void;
894
+ /**
895
+ * If the Pointer has moved or it the Pointer was held for a period of timerContinuous.
896
+ */
897
+ onPointerMoveOrWait?: (event: globalThis.PointerEvent, modifiers: PointerModifiers, originalEvent: default_2.PointerEvent<Element>) => void;
898
+ /**
899
+ * Called when Pointer is released. This is different than the regular
900
+ * Pointer up in that it will be called even if the Pointer is released
901
+ * when outside the component.
902
+ */
903
+ onPointerUp?: (event: globalThis.PointerEvent, modifiers: PointerModifiers, originalEvent: default_2.PointerEvent<Element>) => void;
904
+ timerInitial?: number;
905
+ timerContinuous?: number;
906
+ /**
907
+ * If this is being used for a touch device then this should be true. This will
908
+ * prevent the default touch events from being fired (by calling defaultPrevent during the capture phase).
909
+ * @default false
910
+ */
911
+ processTouch?: boolean;
912
+ /**
913
+ * If true the touch events will be consumed and not propagated.
914
+ * @default true
915
+ */
916
+ consumeTouch?: boolean;
917
+ }
918
+
919
+ /**
920
+ * The pointer modifiers are used because pointer events and keyboard events
921
+ * both have modifiers but pointer events are not updated with a keyboard event
922
+ * is pressed.
923
+ */
924
+ export declare interface PointerModifiers {
925
+ ctrlKey: boolean;
926
+ shiftKey: boolean;
927
+ altKey: boolean;
928
+ metaKey: boolean;
929
+ }
930
+
931
+ export declare namespace ReactUtils {
932
+ export {
933
+ detectIt,
934
+ boundPixel,
935
+ focusableNodeNames,
936
+ EmptyCssProperties,
937
+ toPrettyKeyCode,
938
+ createSyntheticEvent
939
+ }
940
+ }
941
+
942
+ export declare interface RepeatClickOptions {
943
+ timerInitial?: number;
944
+ timerContinuous?: number;
945
+ }
946
+
947
+ export declare const RoundedTab: default_2.FC<RoundedTabProps>;
948
+
949
+ export declare interface RoundedTabProps extends default_2.HTMLAttributes<HTMLElement> {
950
+ radius?: number;
951
+ strokeWidth?: number;
952
+ strokeColor?: string;
953
+ }
954
+
955
+ export declare type ScrollableViewport = {
956
+ left: number;
957
+ top: number;
958
+ width: number;
959
+ height: number;
960
+ totalWidth: number;
961
+ totalHeight: number;
962
+ };
963
+
964
+ export declare const Scrollbar: default_2.NamedExoticComponent<ScrollbarProps & default_2.RefAttributes<HTMLDivElement>>;
965
+
966
+ export declare const ScrollbarOrientation: {
967
+ readonly Horizontal: "horizontal";
968
+ readonly Vertical: "vertical";
969
+ };
970
+
971
+ export declare type ScrollbarOrientation = typeof ScrollbarOrientation[keyof typeof ScrollbarOrientation];
972
+
973
+ export declare interface ScrollbarProps extends default_2.HTMLAttributes<HTMLElement> {
974
+ offset: number;
975
+ totalSize: number;
976
+ viewportSize: number;
977
+ orientation: ScrollbarOrientation;
978
+ onScrollOffset: (offset: number, viewportSize: number, totalSize: number) => void;
979
+ /**
980
+ * Add custom scrollButtons.
981
+ * This should only be set to true if you have used css styling to hide the default scrollButtons
982
+ * using:
983
+ ::-webkit-scrollbar-button: {
984
+ display: 'none'
985
+ }
986
+ *
987
+ * @defaultValue false
988
+ */
989
+ showCustomScrollButtons?: boolean;
990
+ scrollButtonIncrement?: number;
991
+ scrollButtonInitialRepeatDelay?: number;
992
+ scrollButtonAdditionalRepeatDelay?: number;
993
+ createScrollStartButton?: (props: ScrollButtonProps) => default_2.ReactElement;
994
+ createScrollEndButton?: (props: ScrollButtonProps) => default_2.ReactElement;
995
+ }
996
+
997
+ export declare interface ScrollbarRefProps extends ScrollbarProps {
998
+ ref?: React.Ref<HTMLDivElement>;
999
+ }
1000
+
1001
+ export declare interface ScrollButtonProps {
1002
+ style?: default_2.CSSProperties;
1003
+ orientation?: ScrollbarOrientation;
1004
+ disabled: boolean;
1005
+ onMouseUp: (e: default_2.MouseEvent<HTMLElement>) => void;
1006
+ onMouseLeave: (e: default_2.MouseEvent<HTMLElement>) => void;
1007
+ onMouseDown: (e: default_2.MouseEvent<HTMLElement>) => void;
1008
+ onClick?: (e: default_2.MouseEvent<HTMLElement>) => void;
1009
+ }
1010
+
1011
+ export declare const ScrollPane: default_2.FC<ScrollPaneProps & {
1012
+ ref?: default_2.Ref<IScrollPaneElement>;
1013
+ }>;
1014
+
1015
+ export declare interface ScrollPaneAttributes {
1016
+ isScrollPane: () => true;
1017
+ }
1018
+
1019
+ export declare interface ScrollPaneProps extends React.HTMLAttributes<HTMLDivElement> {
1020
+ viewport: ScrollableViewport;
1021
+ onScrollViewport?: (scrollPoint: Partial<TopLeft>) => void;
1022
+ showHorizontalScrollbar?: boolean;
1023
+ showVerticalScrollbar?: boolean;
1024
+ createScrollCorner?: (dims: Dimensions) => React.ReactNode;
1025
+ createHorizontalScrollbar?: (props: ScrollbarRefProps) => React.ReactNode;
1026
+ createVerticalScrollbar?: (props: ScrollbarRefProps) => React.ReactNode;
1027
+ /**
1028
+ * By default the ScrollPane will listen for events on all of the children of the ScrollPane but this
1029
+ * allows for a custom element to be specified. Useful when the ScrollPane has some elements
1030
+ * that should not be touch enabled (for example headers)
1031
+ */
1032
+ touchElement?: HTMLElement;
1033
+ /**
1034
+ * If touch is disabled.
1035
+ * @defaultValue false unless no touch events are detected
1036
+ */
1037
+ disableTouch?: boolean;
1038
+ }
1039
+
1040
+ export declare interface ScrollState extends TopLeft {
1041
+ horizontalScrollDirection: Direction | null;
1042
+ verticalScrollDirection: Direction | null;
1043
+ }
1044
+
1045
+ export declare namespace ScrollUtils {
1046
+ export {
1047
+ getScrollTo
1048
+ }
1049
+ }
1050
+
1051
+ export declare class SimpleCommand extends Command<void, void> {
1052
+ }
1053
+
1054
+ /**
1055
+ * SplitPane
1056
+ * A component can have two children and will add a resizer between the two.
1057
+ * @remarks
1058
+ *
1059
+ * Because this component measures the elements (both panes and the resizer) it is important
1060
+ * that none of these have margins or paddings. If these are required then use a nested element.
1061
+ */
1062
+ export declare const SplitPane: default_2.FC<SplitPaneProps & {
1063
+ ref?: default_2.Ref<ISplitPaneElement>;
1064
+ }>;
1065
+
1066
+ export declare interface SplitPaneAttributes {
1067
+ /**
1068
+ * Programmatic api to set the position. Can be either a string with px or %.
1069
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
1070
+ * @param position - Pixels as `string` or a percent as a `number`.
1071
+ */
1072
+ setPosition: (position: string | number) => void;
1073
+ isSplitPane: () => true;
1074
+ }
1075
+
1076
+ export declare interface SplitPaneProps extends default_2.HTMLAttributes<HTMLDivElement> {
1077
+ /**
1078
+ * The elementBefore the divider.
1079
+ */
1080
+ elementBefore?: default_2.ReactElement<any>;
1081
+ /**
1082
+ * The element after the divider.
1083
+ */
1084
+ elementAfter?: default_2.ReactElement<any>;
1085
+ /**
1086
+ * If the fixedPane is set resizing will keep one the sizes.
1087
+ *
1088
+ * @remarks
1089
+ * When set the default position to be interpreted as pixels.
1090
+ */
1091
+ fixedPane?: 'before' | 'after' | null;
1092
+ /**
1093
+ * The position. Can be either a string with px or %.
1094
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
1095
+ */
1096
+ position?: number | string;
1097
+ /**
1098
+ * The minimum size. Can be either a string with px or %.
1099
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
1100
+ */
1101
+ minBefore?: number | string;
1102
+ /**
1103
+ * The minimum size. Can be either a string with px or %.
1104
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
1105
+ */
1106
+ maxBefore?: number | string;
1107
+ /**
1108
+ * The minimum size. Can be either a string with px or %.
1109
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
1110
+ */
1111
+ minAfter?: number | string;
1112
+ /**
1113
+ * The minimum size. Can be either a string with px or %.
1114
+ * If it is a number it will be interpreted based on whether there is a fixed pane or not.
1115
+ */
1116
+ maxAfter?: number | string;
1117
+ /**
1118
+ * When the position has been changed.
1119
+ * @remarks This is not fired during drag.
1120
+ * @param position
1121
+ */
1122
+ onPositionChange?: (position: {
1123
+ pixels: number;
1124
+ percent: number;
1125
+ }) => void;
1126
+ /**
1127
+ * Determine the direction of the scrollPane
1128
+ */
1129
+ splitDirection?: 'row' | 'column';
1130
+ disabled?: boolean;
1131
+ resizerProps?: SplitPaneResizerProps;
1132
+ paneProps?: default_2.HTMLAttributes<HTMLElement>;
1133
+ paneBeforeProps?: default_2.HTMLAttributes<HTMLElement>;
1134
+ paneAfterProps?: default_2.HTMLAttributes<HTMLElement>;
1135
+ onDragStart?: () => void;
1136
+ onDragResize?: (position: number) => void;
1137
+ onDragFinish?: (position: number) => void;
1138
+ createResizer?: (props: SplitPaneResizerProps & default_2.Attributes & {
1139
+ ref?: default_2.Ref<HTMLDivElement>;
1140
+ }) => default_2.ReactElement;
1141
+ }
1142
+
1143
+ export declare const SplitPaneResizer: (props: SplitPaneResizerProps & default_2.Attributes & {
1144
+ ref?: default_2.Ref<HTMLDivElement>;
1145
+ }) => default_2.ReactElement;
1146
+
1147
+ export declare interface SplitPaneResizerProps extends default_2.HTMLAttributes<HTMLDivElement> {
1148
+ splitDirection?: 'row' | 'column';
1149
+ disabled?: boolean;
1150
+ paddingBefore?: number;
1151
+ paddingAfter?: number;
1152
+ hitAreaProps?: default_2.HTMLAttributes<HTMLDivElement>;
1153
+ }
1154
+
1155
+ export declare interface Style {
1156
+ stroke?: string;
1157
+ strokeLeftColor?: string;
1158
+ strokeTopColor?: string;
1159
+ strokeRightColor?: string;
1160
+ strokeBottomColor?: string;
1161
+ strokeWidth?: number;
1162
+ strokeTopWidth?: number;
1163
+ strokeRightWidth?: number;
1164
+ strokeBottomWidth?: number;
1165
+ strokeLeftWidth?: number;
1166
+ strokeStyle?: string;
1167
+ }
1168
+
1169
+ export declare interface TextSelectionRange {
1170
+ start: number;
1171
+ end: number;
1172
+ direction?: 'forward' | 'backward' | 'none';
1173
+ }
1174
+
1175
+ export declare const ToolTipPlacement: {
1176
+ readonly BottomEnd: "bottom-end";
1177
+ readonly BottomStart: "bottom-start";
1178
+ readonly Bottom: "bottom";
1179
+ readonly LeftEnd: "left-end";
1180
+ readonly LeftStart: "left-start";
1181
+ readonly Left: "left";
1182
+ readonly RightEnd: "right-end";
1183
+ readonly RightStart: "right-start";
1184
+ readonly Right: "right";
1185
+ readonly TopEnd: "top-end";
1186
+ readonly TopStart: "top-start";
1187
+ readonly Top: "top";
1188
+ };
1189
+
1190
+ export declare type ToolTipPlacement = typeof ToolTipPlacement[keyof typeof ToolTipPlacement];
1191
+
1192
+ declare const toPrettyKeyCode: (key: string) => string;
1193
+
1194
+ export declare const toShortcutString: (keyStroke: IKeyStroke, modifierSymbol?: boolean) => string;
1195
+
1196
+ export declare interface UndoContext {
1197
+ readonly undoManager: UndoManager;
1198
+ }
1199
+
1200
+ export declare interface UndoManagerProps {
1201
+ manager: UndoManager;
1202
+ /**
1203
+ * Not allow to invoke undo/redo
1204
+ * Interesting.... Because this is sharable and not scoped to an object it's not clear the best
1205
+ * way to disable/protect a sheet. Excel clears the undo stack!
1206
+ */
1207
+ disabled?: boolean;
1208
+ notifier?: Notifier;
1209
+ commands?: ICommands.IGroup;
1210
+ }
1211
+
1212
+ export declare interface UndoManagerResults {
1213
+ /**
1214
+ * Call undo manager via command
1215
+ */
1216
+ undo: (count?: number) => void;
1217
+ /**
1218
+ * Call undo manager via command
1219
+ */
1220
+ redo: (count?: number) => void;
1221
+ }
1222
+
1223
+ /**
1224
+ * This is a callback hook that is similar to useCallback except in
1225
+ * one important way. When it's dependencies change it does
1226
+ * NOT update the callback handler itself. Useful
1227
+ * in the instance where you want to pass a callback and
1228
+ * want to avoid have stale values do to closure but don't
1229
+ * want a re-render to occur.
1230
+ */
1231
+ export declare const useCallbackRef: <T extends (...args: any[]) => any>(callback: T, deps: DependencyList) => T;
1232
+
1233
+ /**
1234
+ * Useful for capture command changes. This can be used with an @see ICommandHook or without.
1235
+ * If used with then will call the function. If not then a change will force a re-render.
1236
+
1237
+ * @param command
1238
+ * @param listener
1239
+ */
1240
+ export declare function useCommand<STATE = any, CONTEXT = any>(command: ICommand<STATE, CONTEXT> | ICommand<STATE, CONTEXT>[], listener?: ICommandListener<STATE, CONTEXT>): number;
1241
+
1242
+ /**
1243
+ * Useful for capture command changes. This can be used with an @see ICommandHook or without.
1244
+ * If used with then will call the function. If not then a change will force a re-render.
1245
+ *
1246
+ * @param commands
1247
+ * @param keys
1248
+ * @param listener
1249
+ * @param deps Optional dependencies to trigger a re-render
1250
+ *
1251
+ * @remarks
1252
+ * A change to the commands, keys, or listeners will not trigger a rerender. The deps argument can be used.
1253
+ */
1254
+ export declare function useCommands<STATE extends any, CONTEXT extends any = void>(commands: ICommands.IGroup, keys?: string[], listener?: ICommandsListeners<STATE, CONTEXT>, deps?: React.DependencyList): ICommand<STATE, CONTEXT>[];
1255
+
1256
+ /**
1257
+ * Copy paste hook.
1258
+ */
1259
+ export declare const useCopyPaste: (props: CopyPasteProps) => CopyPasteResults;
1260
+
1261
+ /**
1262
+ * Get the device pixel ratio, potentially rounded and capped.
1263
+ * Will emit new values if it changes.
1264
+ *
1265
+ * @param options
1266
+ * @returns The current device pixel ratio, or the default if none can be resolved
1267
+ */
1268
+ export declare function useDevicePixelRatio(options?: DevicePixelRatioOptions): number;
1269
+
1270
+ export declare const useEditMode: () => EditModeHandler;
1271
+
1272
+ export declare function useFullscreenPortal(): FullscreenPortalRoot;
1273
+
1274
+ export declare const useGlobalClipboard: () => any;
1275
+
1276
+ /**
1277
+ * Uses React 18's built-in `useId()` when available, or falls back to a
1278
+ * slightly less performant (requiring a double render) implementation for
1279
+ * earlier React versions.
1280
+ *
1281
+ * @see {@link https://movable-ui.com/docs/useId}
1282
+ */
1283
+ export declare const useId: any;
1284
+
1285
+ export declare function useImperativeElement<R extends T, A = any, T = HTMLElement & A>(refForwarded: React.Ref<R>, attributeFn?: () => Partial<A>, deps?: DependencyList): React.RefObject<R>;
1286
+
1287
+ /**
1288
+ * Simple hook that calls onMouseDown at intervals until mouse is up.
1289
+ *
1290
+ * @remarks
1291
+ * Fires the original mouse down event so preventDefault should be ignored or treated accordingly.
1292
+ */
1293
+ export declare function useMouseDownAndHoldListener(onPointerDown: (event: default_2.PointerEvent<Element>) => boolean | void, options?: RepeatClickOptions): (event: default_2.PointerEvent<Element>) => void;
1294
+
1295
+ export declare function useOnClickOrFocusAway(ref: default_2.RefObject<any>, listenerArg: ClickOrFocusAwayListener, options?: ClickOrFocusAwayOptions): void;
1296
+
1297
+ /**
1298
+ * This hook will respond on Pointer down and then continue to fire events
1299
+ * until the Pointer is released.
1300
+ *
1301
+ * Returns PointerDownListener that should be added to the
1302
+ * source component's onPointerDown event handler.
1303
+ */
1304
+ export declare function useSynchronizedPointerHandler(options: PointerHandlerOptions): PointerDownListener;
1305
+
1306
+ export declare function useTraceUpdate(props: any, enabled?: boolean): void;
1307
+
1308
+ /**
1309
+ * Undo manager hook
1310
+ */
1311
+ export declare const useUndoManager: ({ manager, commands: commandsParent, disabled: propDisabled, notifier }: UndoManagerProps) => UndoManagerResults;
1312
+
1313
+ /**
1314
+ * The virtual scrollbar is for very large scroll area.
1315
+ * Browsers have issues with more than divs more than 6m pixels width/height (which by most account is reasonable).
1316
+ *
1317
+ * This virtualScrollbar also has an elastic component that allows the scrollbar to shrink to its minSize
1318
+ * for easier scrolling for large virtual areas with small content areas. (Similar to excel desktop)
1319
+ *
1320
+ * Note -
1321
+ * Because of the virtual nature of the scrollbar the onScroll method is disabled
1322
+ * and onScrollOffset must be used.
1323
+ */
1324
+ export declare const VirtualScrollbar: default_2.NamedExoticComponent<VirtualScrollbarProps & default_2.RefAttributes<HTMLDivElement>>;
1325
+
1326
+ export declare interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onScroll"> {
1327
+ /**
1328
+ * Amount of scrollbar between minSize and totalSize. This is mean to show that there is more scroll area.
1329
+ * @defaultValue 100
1330
+ */
1331
+ endGap?: number;
1332
+ /**
1333
+ * If this is the minimum scrollbar size.
1334
+ * By default this is the bottom of the viewport but can be extended.
1335
+ * @defaultValue 0
1336
+ */
1337
+ minSize?: number;
1338
+ /**
1339
+ * Determines the increment amount when the scrollbar has been dragged to the end but is not scrolled to total size.
1340
+ * @defaultValue 100;
1341
+ */
1342
+ endScrollIncrement?: number;
1343
+ /**
1344
+ * The max size of the area before scaling is implemented.
1345
+ * @defaultValue 1000000
1346
+ */
1347
+ scaleLimit?: number;
1348
+ /**
1349
+ * The factor amount for physical scaling
1350
+ * @defaultValue 100
1351
+ */
1352
+ scaleFactor?: number;
1353
+ /**
1354
+ * The default precision. This is a factor of the scale factor.
1355
+ * @defaultValue 50
1356
+ */
1357
+ precisionFactor?: number;
1358
+ }
1359
+
1360
+ export { }