UNPKG

40.4 kBMarkdownView Raw
1## API Report File for "@uifabric/utilities"
2
3> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
5```ts
6
7import { DATA_PORTAL_ATTRIBUTE } from '@fluentui/dom-utilities';
8import { elementContains } from '@fluentui/dom-utilities';
9import { elementContainsAttribute } from '@fluentui/dom-utilities';
10import { findElementRecursive } from '@fluentui/dom-utilities';
11import { getChildren } from '@fluentui/dom-utilities';
12import { getParent } from '@fluentui/dom-utilities';
13import { getVirtualParent } from '@fluentui/dom-utilities';
14import { IProcessedStyleSet } from '@uifabric/merge-styles';
15import { IStyleFunction } from '@uifabric/merge-styles';
16import { IStyleFunctionOrObject } from '@uifabric/merge-styles';
17import { IStyleSet } from '@uifabric/merge-styles';
18import { isVirtualElement } from '@fluentui/dom-utilities';
19import { IVirtualElement } from '@fluentui/dom-utilities';
20import { Omit } from '@uifabric/merge-styles';
21import { portalContainsElement } from '@fluentui/dom-utilities';
22import * as React from 'react';
23import { setPortalAttribute } from '@fluentui/dom-utilities';
24import { setVirtualParent } from '@fluentui/dom-utilities';
25
26// @public
27export function addDirectionalKeyCode(which: number): void;
28
29// @public
30export function addElementAtIndex<T>(array: T[], index: number, itemToAdd: T): T[];
31
32// @public
33export const allowOverscrollOnElement: (element: HTMLElement | null, events: EventGroup) => void;
34
35// @public
36export const allowScrollOnElement: (element: HTMLElement | null, events: EventGroup) => void;
37
38// @public
39export const anchorProperties: Record<string, number>;
40
41// @public
42export function appendFunction(parent: any, ...functions: any[]): () => void;
43
44// @public
45export function arraysEqual<T>(array1: T[], array2: T[]): boolean;
46
47// @public
48export function asAsync<TProps>(options: IAsAsyncOptions<TProps>): React.ForwardRefExoticComponent<React.PropsWithoutRef<TProps & {
49 asyncPlaceholder?: "symbol" | "object" | "text" | "table" | "ruby" | "small" | "input" | "progress" | "select" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "q" | "rp" | "rt" | "s" | "samp" | "script" | "section" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "big" | React.ComponentClass<any, any> | React.FunctionComponent<any> | "keygen" | "menuitem" | "noindex" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | undefined;
50}> & React.RefAttributes<React.ElementType<TProps>>>;
51
52// @public
53export function assertNever(x: never): never;
54
55// @public
56export function assign(target: any, ...args: any[]): any;
57
58// @public
59export class Async {
60 constructor(parent?: object, onError?: (e: any) => void);
61 // (undocumented)
62 cancelAnimationFrame(id: number, targetElement?: Element | null): void;
63 clearImmediate(id: number, targetElement?: Element | null): void;
64 clearInterval(id: number): void;
65 clearTimeout(id: number): void;
66 debounce<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
67 leading?: boolean;
68 maxWait?: number;
69 trailing?: boolean;
70 }): ICancelable<T> & T;
71 dispose(): void;
72 // (undocumented)
73 protected _logError(e: any): void;
74 // (undocumented)
75 requestAnimationFrame(callback: () => void, targetElement?: Element | null): number;
76 setImmediate(callback: () => void, targetElement?: Element | null): number;
77 setInterval(callback: () => void, duration: number): number;
78 setTimeout(callback: () => void, duration: number): number;
79 throttle<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
80 leading?: boolean;
81 trailing?: boolean;
82 }): T;
83 }
84
85// @public
86export const audioProperties: Record<string, number>;
87
88// @public
89export class AutoScroll {
90 constructor(element: HTMLElement);
91 // (undocumented)
92 dispose(): void;
93 }
94
95// @public @deprecated
96export class BaseComponent<TProps extends IBaseProps = {}, TState = {}> extends React.Component<TProps, TState> {
97 constructor(props: TProps, context?: any);
98 protected readonly _async: Async;
99 readonly className: string;
100 componentDidMount(): void;
101 componentDidUpdate(prevProps: TProps, prevState: TState): void;
102 componentWillUnmount(): void;
103 protected readonly _disposables: IDisposable[];
104 protected readonly _events: EventGroup;
105 // @deprecated (undocumented)
106 static onError: (errorMessage?: string, ex?: any) => void;
107 // @deprecated
108 protected _resolveRef(refName: string): (ref: React.ReactNode) => React.ReactNode;
109 protected _skipComponentRefResolution: boolean;
110 protected _updateComponentRef(currentProps: IBaseProps, newProps?: IBaseProps): void;
111 protected _warnConditionallyRequiredProps(requiredProps: string[], conditionalPropName: string, condition: boolean): void;
112 protected _warnDeprecations(deprecationMap: ISettingsMap<TProps>): void;
113 protected _warnMutuallyExclusive(mutuallyExclusiveMap: ISettingsMap<TProps>): void;
114}
115
116// @public
117export const baseElementEvents: Record<string, number>;
118
119// @public
120export const baseElementProperties: Record<string, number>;
121
122// @public
123export const buttonProperties: Record<string, number>;
124
125// @public
126export function calculatePrecision(value: number | string): number;
127
128// @public
129export function classNamesFunction<TStyleProps extends {}, TStyleSet extends IStyleSet<TStyleSet>>(options?: IClassNamesFunctionOptions): (getStyles: IStyleFunctionOrObject<TStyleProps, TStyleSet> | undefined, styleProps?: TStyleProps) => IProcessedStyleSet<TStyleSet>;
130
131// @public (undocumented)
132export const colGroupProperties: Record<string, number>;
133
134// @public (undocumented)
135export const colProperties: Record<string, number>;
136
137// @public
138export function composeComponentAs<TProps>(outer: IComponentAs<TProps>, inner: IComponentAs<TProps>): IComponentAs<TProps>;
139
140// @public
141export function composeRenderFunction<TProps>(outer: IRenderFunction<TProps>, inner: IRenderFunction<TProps>): IRenderFunction<TProps>;
142
143// @public
144export function createArray<T>(size: number, getItem: (index: number) => T): T[];
145
146// @public
147export function createMemoizer<F extends (input: any) => any>(getValue: F): F;
148
149// @public
150export const createMergedRef: <TType, TValue = null>(value?: TValue | undefined) => (...newRefs: (((instance: TType | TValue | null) => void) | React.RefObject<TType | TValue | null> | null | undefined)[]) => (newValue: TType | TValue | null) => void;
151
152// Warning: (ae-incompatible-release-tags) The symbol "css" is marked as @public, but its signature references "ICssInput" which is marked as @internal
153//
154// @public
155export function css(...args: ICssInput[]): string;
156
157// @public (undocumented)
158export function customizable(scope: string, fields: string[], concatStyles?: boolean): <P>(ComposedComponent: React.ComponentType<P>) => any;
159
160// @public (undocumented)
161export class Customizations {
162 static applyBatchedUpdates(code: () => void, suppressUpdate?: boolean): void;
163 static applyScopedSettings(scopeName: string, settings: ISettings): void;
164 static applySettings(settings: ISettings): void;
165 // (undocumented)
166 static getSettings(properties: string[], scopeName?: string, localSettings?: ICustomizations): any;
167 // (undocumented)
168 static observe(onChange: () => void): void;
169 // (undocumented)
170 static reset(): void;
171 // (undocumented)
172 static unobserve(onChange: () => void): void;
173}
174
175// @public
176export class Customizer extends React.Component<ICustomizerProps> {
177 // (undocumented)
178 componentDidMount(): void;
179 // (undocumented)
180 componentWillUnmount(): void;
181 // (undocumented)
182 render(): React.ReactElement<{}>;
183}
184
185// @public (undocumented)
186export const CustomizerContext: React.Context<ICustomizerContext>;
187
188// @public
189export const DATA_IS_SCROLLABLE_ATTRIBUTE = "data-is-scrollable";
190
191export { DATA_PORTAL_ATTRIBUTE }
192
193// Warning: (ae-incompatible-release-tags) The symbol "DelayedRender" is marked as @public, but its signature references "IDelayedRenderState" which is marked as @internal
194//
195// @public
196export class DelayedRender extends React.Component<IDelayedRenderProps, IDelayedRenderState> {
197 constructor(props: IDelayedRenderProps);
198 // (undocumented)
199 componentDidMount(): void;
200 // (undocumented)
201 componentWillUnmount(): void;
202 // (undocumented)
203 static defaultProps: {
204 delay: number;
205 };
206 // (undocumented)
207 render(): React.ReactElement<{}> | null;
208 }
209
210// @public
211export function disableBodyScroll(): void;
212
213// @public
214export const divProperties: Record<string, number>;
215
216// @public
217export function doesElementContainFocus(element: HTMLElement): boolean;
218
219export { elementContains }
220
221export { elementContainsAttribute }
222
223// @public
224export function enableBodyScroll(): void;
225
226// @public
227export class EventGroup {
228 constructor(parent: any);
229 declare(event: string | string[]): void;
230 // (undocumented)
231 dispose(): void;
232 static isDeclared(target: any, eventName: string): boolean;
233 // (undocumented)
234 static isObserved(target: any, eventName: string): boolean;
235 // (undocumented)
236 off(target?: any, eventName?: string, callback?: (args?: any) => void, options?: boolean | AddEventListenerOptions): void;
237 on(target: any, eventName: string, callback: (args?: any) => void, options?: boolean | AddEventListenerOptions): void;
238 onAll(target: any, events: {
239 [key: string]: (args?: any) => void;
240 }, useCapture?: boolean): void;
241 static raise(target: any, eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined;
242 raise(eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined;
243 // (undocumented)
244 static stopPropagation(event: any): void;
245 }
246
247// @public
248export function extendComponent<T extends React.Component>(parent: T, methods: {
249 [key in keyof T]?: T[key];
250}): void;
251
252// @public
253export class FabricPerformance {
254 static measure(name: string, func: () => void): void;
255 // (undocumented)
256 static reset(): void;
257 // (undocumented)
258 static setPeriodicReset(): void;
259 // Warning: (ae-incompatible-release-tags) The symbol "summary" is marked as @public, but its signature references "IPerfSummary" which is marked as @internal
260 //
261 // (undocumented)
262 static summary: IPerfSummary;
263 }
264
265// @public
266export function filteredAssign(isAllowed: (propName: string) => boolean, target: any, ...args: any[]): any;
267
268// @public
269export function find<T>(array: T[], cb: (item: T, index: number) => boolean): T | undefined;
270
271export { findElementRecursive }
272
273// @public
274export function findIndex<T>(array: T[], cb: (item: T, index: number) => boolean, fromIndex?: number): number;
275
276// @public
277export function findScrollableParent(startingElement: HTMLElement | null): HTMLElement | Window | undefined | null;
278
279// @public
280export function fitContentToBounds(options: IFitContentToBoundsOptions): ISize;
281
282// @public
283export type FitMode = 'contain' | 'cover';
284
285// @public
286export function flatten<T>(array: (T | T[])[]): T[];
287
288// @public
289export function focusAsync(element: HTMLElement | {
290 focus: () => void;
291} | undefined | null): void;
292
293// @public
294export function focusFirstChild(rootElement: HTMLElement): boolean;
295
296// @public
297export const FocusRects: React.FunctionComponent<{
298 rootRef?: React.RefObject<HTMLElement>;
299}>;
300
301// @public
302export function format(s: string, ...values: any[]): string;
303
304// @public
305export const formProperties: Record<string, number>;
306
307export { getChildren }
308
309// @public
310export function getDistanceBetweenPoints(point1: Point, point2: Point): number;
311
312// @public
313export function getDocument(rootElement?: HTMLElement | null): Document | undefined;
314
315// @public
316export function getElementIndexPath(fromElement: HTMLElement, toElement: HTMLElement): number[];
317
318// @public
319export function getFirstFocusable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean): HTMLElement | null;
320
321// @public
322export function getFirstTabbable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean, checkNode?: boolean): HTMLElement | null;
323
324// @public
325export function getFocusableByIndexPath(parent: HTMLElement, path: number[]): HTMLElement | undefined;
326
327// @public
328export function getId(prefix?: string): string;
329
330// @public
331export function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
332
333// @public
334export function getLanguage(persistenceType?: 'localStorage' | 'sessionStorage' | 'none'): string | null;
335
336// @public
337export function getLastFocusable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean): HTMLElement | null;
338
339// @public
340export function getLastTabbable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean, checkNode?: boolean): HTMLElement | null;
341
342// @public
343export function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(tagName: string, props: {}, excludedPropNames?: string[]): TAttributes;
344
345// @public
346export function getNativeProps<T extends Record<string, any>>(props: Record<string, any>, allowedPropNames: string[] | Record<string, number>, excludedPropNames?: string[]): T;
347
348// @public
349export function getNextElement(rootElement: HTMLElement, currentElement: HTMLElement | null, checkNode?: boolean, suppressParentTraversal?: boolean, suppressChildTraversal?: boolean, includeElementsInFocusZones?: boolean, allowFocusRoot?: boolean, tabbable?: boolean): HTMLElement | null;
350
351export { getParent }
352
353// @public
354export function getPreviousElement(rootElement: HTMLElement, currentElement: HTMLElement | null, checkNode?: boolean, suppressParentTraversal?: boolean, traverseChildren?: boolean, includeElementsInFocusZones?: boolean, allowFocusRoot?: boolean, tabbable?: boolean): HTMLElement | null;
355
356// @public
357export function getPropsWithDefaults<TProps extends {}>(defaultProps: Partial<TProps>, propsWithoutDefaults: TProps): TProps;
358
359// @public
360export function getRect(element: HTMLElement | Window | null): IRectangle | undefined;
361
362// @public
363export function getResourceUrl(url: string): string;
364
365// @public
366export function getRTL(theme?: {
367 rtl?: boolean;
368}): boolean;
369
370// @public
371export function getRTLSafeKeyCode(key: number, theme?: {
372 rtl?: boolean;
373}): number;
374
375// @public
376export function getScrollbarWidth(): number;
377
378export { getVirtualParent }
379
380// @public
381export function getWindow(rootElement?: Element | null): Window | undefined;
382
383// @public
384export class GlobalSettings {
385 // (undocumented)
386 static addChangeListener(cb: IChangeEventCallback): void;
387 // (undocumented)
388 static getValue<T>(key: string, defaultValue?: T | (() => T)): T;
389 // (undocumented)
390 static removeChangeListener(cb: IChangeEventCallback): void;
391 // (undocumented)
392 static setValue<T>(key: string, value: T): T;
393}
394
395// @public
396export function hasHorizontalOverflow(element: HTMLElement): boolean;
397
398// @public
399export function hasOverflow(element: HTMLElement): boolean;
400
401// @public
402export function hasVerticalOverflow(element: HTMLElement): boolean;
403
404// @public
405export function hoistMethods(destination: any, source: any, exclusions?: string[]): string[];
406
407// @public
408export function hoistStatics<TSource extends Object, TDest>(source: TSource, dest: TDest): TDest;
409
410// @public
411export const htmlElementProperties: Record<string, number>;
412
413// @public (undocumented)
414export interface IAsAsyncOptions<TProps> {
415 load: () => Promise<React.ElementType<TProps>>;
416 onError?: (error: Error) => void;
417 onLoad?: () => void;
418}
419
420// @public
421export interface IBaseProps<T = any> {
422 // (undocumented)
423 componentRef?: IRefObject<T>;
424}
425
426// @public (undocumented)
427export type ICancelable<T extends (...args: any[]) => any> = {
428 flush: () => ReturnType<T>;
429 cancel: () => void;
430 pending: () => boolean;
431};
432
433// @public
434export interface IChangeDescription {
435 // (undocumented)
436 key: string;
437 // (undocumented)
438 oldValue: any;
439 // (undocumented)
440 value: any;
441}
442
443// @public
444export interface IChangeEventCallback {
445 // (undocumented)
446 (changeDescription?: IChangeDescription): void;
447 // (undocumented)
448 __id__?: string;
449}
450
451// @public @deprecated (undocumented)
452export type IClassNames<T> = {
453 [key in keyof T]: string;
454};
455
456// @public (undocumented)
457export interface IClassNamesFunctionOptions {
458 cacheSize?: number;
459 disableCaching?: boolean;
460 useStaticStyles?: boolean;
461}
462
463// @public
464export type IComponentAs<T> = React.ComponentType<IComponentAsProps<T>>;
465
466// @public
467export type IComponentAsProps<T> = T & {
468 defaultRender?: React.ComponentType<T>;
469};
470
471// Warning: (ae-internal-missing-underscore) The name "ICssInput" should be prefixed with an underscore because the declaration is marked as @internal
472//
473// @internal
474export type ICssInput = string | ISerializableObject | IDictionary | null | undefined | boolean;
475
476// @public (undocumented)
477export interface ICustomizableProps {
478 fields?: string[];
479 scope: string;
480}
481
482// @public (undocumented)
483export interface ICustomizations {
484 // (undocumented)
485 inCustomizerContext?: boolean;
486 // (undocumented)
487 scopedSettings: {
488 [key: string]: ISettings;
489 };
490 // (undocumented)
491 settings: ISettings;
492}
493
494// @public (undocumented)
495export interface ICustomizerContext {
496 // (undocumented)
497 customizations: ICustomizations;
498}
499
500// @public (undocumented)
501export type ICustomizerProps = IBaseProps & Partial<{
502 settings: ISettings | ISettingsFunction;
503 scopedSettings: ISettings | ISettingsFunction;
504}> & {
505 contextTransform?: (context: Readonly<ICustomizerContext>) => ICustomizerContext;
506};
507
508// Warning: (ae-internal-missing-underscore) The name "IDeclaredEventsByName" should be prefixed with an underscore because the declaration is marked as @internal
509//
510// @internal (undocumented)
511export interface IDeclaredEventsByName {
512 // (undocumented)
513 [eventName: string]: boolean;
514}
515
516// @public
517export interface IDelayedRenderProps extends React.Props<{}> {
518 delay?: number;
519}
520
521// Warning: (ae-internal-missing-underscore) The name "IDelayedRenderState" should be prefixed with an underscore because the declaration is marked as @internal
522//
523// @internal
524export interface IDelayedRenderState {
525 isRendered: boolean;
526}
527
528// Warning: (ae-internal-missing-underscore) The name "IDictionary" should be prefixed with an underscore because the declaration is marked as @internal
529//
530// @internal
531export interface IDictionary {
532 // (undocumented)
533 [className: string]: boolean;
534}
535
536// @public
537export interface IDisposable {
538 // (undocumented)
539 dispose: () => void;
540}
541
542// Warning: (ae-internal-missing-underscore) The name "IEventRecord" should be prefixed with an underscore because the declaration is marked as @internal
543//
544// @internal (undocumented)
545export interface IEventRecord {
546 // (undocumented)
547 callback: (args?: any) => void;
548 // (undocumented)
549 elementCallback?: (...args: any[]) => void;
550 // (undocumented)
551 eventName: string;
552 // (undocumented)
553 objectCallback?: (args?: any) => void;
554 // (undocumented)
555 options?: boolean | AddEventListenerOptions;
556 // (undocumented)
557 parent: any;
558 // (undocumented)
559 target: any;
560}
561
562// Warning: (ae-internal-missing-underscore) The name "IEventRecordList" should be prefixed with an underscore because the declaration is marked as @internal
563//
564// @internal (undocumented)
565export interface IEventRecordList {
566 // (undocumented)
567 [id: string]: IEventRecord[] | number;
568 // (undocumented)
569 count: number;
570}
571
572// Warning: (ae-internal-missing-underscore) The name "IEventRecordsByName" should be prefixed with an underscore because the declaration is marked as @internal
573//
574// @internal (undocumented)
575export interface IEventRecordsByName {
576 // (undocumented)
577 [eventName: string]: IEventRecordList;
578}
579
580// @public
581export interface IFitContentToBoundsOptions {
582 boundsSize: ISize;
583 contentSize: ISize;
584 maxScale?: number;
585 mode: FitMode;
586}
587
588// @public
589export const iframeProperties: Record<string, number>;
590
591// @public @deprecated (undocumented)
592export const imageProperties: Record<string, number>;
593
594// @public
595export const imgProperties: Record<string, number>;
596
597// @public
598export function initializeComponentRef<TProps extends IBaseProps, TState>(obj: React.Component<TProps, TState>): void;
599
600// @public @deprecated
601export function initializeFocusRects(window?: Window): void;
602
603// @public
604export const inputProperties: Record<string, number>;
605
606// @public (undocumented)
607export interface IObjectWithKey {
608 // (undocumented)
609 key?: string | number;
610}
611
612// Warning: (ae-internal-missing-underscore) The name "IPerfData" should be prefixed with an underscore because the declaration is marked as @internal
613//
614// @internal
615export interface IPerfData {
616 // (undocumented)
617 duration: number;
618 // (undocumented)
619 timeStamp: number;
620}
621
622// Warning: (ae-internal-missing-underscore) The name "IPerfMeasurement" should be prefixed with an underscore because the declaration is marked as @internal
623//
624// @internal
625export interface IPerfMeasurement {
626 // (undocumented)
627 all: IPerfData[];
628 // (undocumented)
629 count: number;
630 // (undocumented)
631 totalDuration: number;
632}
633
634// Warning: (ae-internal-missing-underscore) The name "IPerfSummary" should be prefixed with an underscore because the declaration is marked as @internal
635//
636// @internal
637export interface IPerfSummary {
638 // (undocumented)
639 [key: string]: IPerfMeasurement;
640}
641
642// @public @deprecated
643export interface IPoint extends Point {
644}
645
646// @public (undocumented)
647export interface IPropsWithStyles<TStyleProps, TStyleSet extends IStyleSet<TStyleSet>> {
648 // (undocumented)
649 styles?: IStyleFunctionOrObject<TStyleProps, TStyleSet>;
650}
651
652// @public
653export interface IRectangle {
654 // (undocumented)
655 bottom?: number;
656 // (undocumented)
657 height: number;
658 // (undocumented)
659 left: number;
660 // (undocumented)
661 right?: number;
662 // (undocumented)
663 top: number;
664 // (undocumented)
665 width: number;
666}
667
668// @public (undocumented)
669export type IRefObject<T> = React.RefObject<T> | RefObject<T> | ((ref: T | null) => void);
670
671// @public
672export interface IRenderComponent<TProps> {
673 children: (props: TProps) => JSX.Element;
674}
675
676// @public
677export interface IRenderFunction<P> {
678 // (undocumented)
679 (props?: P, defaultRender?: (props?: P) => JSX.Element | null): JSX.Element | null;
680}
681
682// @public
683export function isControlled<P>(props: P, valueProp: keyof P): boolean;
684
685// @public
686export function isDirectionalKeyCode(which: number): boolean;
687
688// @public (undocumented)
689export interface ISelection<TItem = IObjectWithKey> {
690 // (undocumented)
691 canSelectItem: (item: TItem, index?: number) => boolean;
692 // (undocumented)
693 count: number;
694 // (undocumented)
695 getItemIndex?(key: string): number;
696 // (undocumented)
697 getItems(): TItem[];
698 // (undocumented)
699 getSelectedCount(): number;
700 // (undocumented)
701 getSelectedIndices(): number[];
702 // (undocumented)
703 getSelection(): TItem[];
704 // (undocumented)
705 isAllSelected(): boolean;
706 // (undocumented)
707 isIndexSelected(index: number): boolean;
708 // (undocumented)
709 isKeySelected(key: string): boolean;
710 // (undocumented)
711 isModal?(): boolean;
712 // (undocumented)
713 isRangeSelected(fromIndex: number, count: number): boolean;
714 // (undocumented)
715 mode: SelectionMode;
716 // (undocumented)
717 selectToIndex(index: number, clearSelection?: boolean): void;
718 // (undocumented)
719 selectToKey(key: string, clearSelection?: boolean): void;
720 // (undocumented)
721 selectToRange?(index: number, count: number, clearSelection?: boolean): void;
722 // (undocumented)
723 setAllSelected(isAllSelected: boolean): void;
724 // (undocumented)
725 setChangeEvents(isEnabled: boolean, suppressChange?: boolean): void;
726 // (undocumented)
727 setIndexSelected(index: number, isSelected: boolean, shouldAnchor: boolean): void;
728 // (undocumented)
729 setItems(items: TItem[], shouldClear: boolean): void;
730 // (undocumented)
731 setKeySelected(key: string, isSelected: boolean, shouldAnchor: boolean): void;
732 // (undocumented)
733 setModal?(isModal: boolean): void;
734 // (undocumented)
735 setRangeSelected?(fromIndex: number, count: number, isSelected: boolean, shouldAnchor: boolean): void;
736 // (undocumented)
737 toggleAllSelected(): void;
738 // (undocumented)
739 toggleIndexSelected(index: number): void;
740 // (undocumented)
741 toggleKeySelected(key: string): void;
742 // (undocumented)
743 toggleRangeSelected(fromIndex: number, count: number): void;
744}
745
746// @public (undocumented)
747export interface ISelectionOptions<TItem = IObjectWithKey> {
748 // (undocumented)
749 canSelectItem?: (item: TItem, index?: number) => boolean;
750 getKey?: (item: TItem, index?: number) => string | number;
751 // (undocumented)
752 items?: TItem[];
753 // (undocumented)
754 onItemsChanged?: () => void;
755 // (undocumented)
756 onSelectionChanged?: () => void;
757 // (undocumented)
758 selectionMode?: SelectionMode;
759}
760
761// @public
762export type ISelectionOptionsWithRequiredGetKey<TItem> = ISelectionOptions<TItem> & Required<Pick<ISelectionOptions<TItem>, 'getKey'>>;
763
764// @public
765export function isElementFocusSubZone(element?: HTMLElement): boolean;
766
767// @public
768export function isElementFocusZone(element?: HTMLElement): boolean;
769
770// @public
771export function isElementTabbable(element: HTMLElement, checkTabIndex?: boolean): boolean;
772
773// @public
774export function isElementVisible(element: HTMLElement | undefined | null): boolean;
775
776// Warning: (ae-internal-missing-underscore) The name "ISerializableObject" should be prefixed with an underscore because the declaration is marked as @internal
777//
778// @internal
779export interface ISerializableObject {
780 // (undocumented)
781 toString?: () => string;
782}
783
784// @public (undocumented)
785export type ISettings = {
786 [key: string]: any;
787};
788
789// @public (undocumented)
790export type ISettingsFunction = (settings: ISettings) => ISettings;
791
792// @public (undocumented)
793export type ISettingsMap<T> = {
794 [P in keyof T]?: string;
795};
796
797// @public (undocumented)
798export const IsFocusVisibleClassName = "ms-Fabric--isFocusVisible";
799
800// @public (undocumented)
801export const isIE11: () => boolean;
802
803// @public
804export const isIOS: () => boolean;
805
806// @public (undocumented)
807export interface ISize {
808 // (undocumented)
809 height: number;
810 // (undocumented)
811 width: number;
812}
813
814// @public
815export function isMac(reset?: boolean): boolean;
816
817export { IStyleFunction }
818
819export { IStyleFunctionOrObject }
820
821export { isVirtualElement }
822
823export { IVirtualElement }
824
825// @public (undocumented)
826export interface IWarnControlledUsageParams<P> {
827 componentId: string;
828 componentName: string;
829 defaultValueProp: keyof P;
830 oldProps?: P;
831 onChangeProp: keyof P;
832 props: P;
833 readOnlyProp?: keyof P;
834 valueProp: keyof P;
835}
836
837// @public
838export const KeyCodes: {
839 backspace: 8;
840 tab: 9;
841 enter: 13;
842 shift: 16;
843 ctrl: 17;
844 alt: 18;
845 pauseBreak: 19;
846 capslock: 20;
847 escape: 27;
848 space: 32;
849 pageUp: 33;
850 pageDown: 34;
851 end: 35;
852 home: 36;
853 left: 37;
854 up: 38;
855 right: 39;
856 down: 40;
857 insert: 45;
858 del: 46;
859 zero: 48;
860 one: 49;
861 two: 50;
862 three: 51;
863 four: 52;
864 five: 53;
865 six: 54;
866 seven: 55;
867 eight: 56;
868 nine: 57;
869 a: 65;
870 b: 66;
871 c: 67;
872 d: 68;
873 e: 69;
874 f: 70;
875 g: 71;
876 h: 72;
877 i: 73;
878 j: 74;
879 k: 75;
880 l: 76;
881 m: 77;
882 n: 78;
883 o: 79;
884 p: 80;
885 q: 81;
886 r: 82;
887 s: 83;
888 t: 84;
889 u: 85;
890 v: 86;
891 w: 87;
892 x: 88;
893 y: 89;
894 z: 90;
895 leftWindow: 91;
896 rightWindow: 92;
897 select: 93;
898 zero_numpad: 96;
899 one_numpad: 97;
900 two_numpad: 98;
901 three_numpad: 99;
902 four_numpad: 100;
903 five_numpad: 101;
904 six_numpad: 102;
905 seven_numpad: 103;
906 eight_numpad: 104;
907 nine_numpad: 105;
908 multiply: 106;
909 add: 107;
910 subtract: 109;
911 decimalPoint: 110;
912 divide: 111;
913 f1: 112;
914 f2: 113;
915 f3: 114;
916 f4: 115;
917 f5: 116;
918 f6: 117;
919 f7: 118;
920 f8: 119;
921 f9: 120;
922 f10: 121;
923 f11: 122;
924 f12: 123;
925 numlock: 144;
926 scrollLock: 145;
927 semicolon: 186;
928 equalSign: 187;
929 comma: 188;
930 dash: 189;
931 period: 190;
932 forwardSlash: 191;
933 graveAccent: 192;
934 openBracket: 219;
935 backSlash: 220;
936 closeBracket: 221;
937 singleQuote: 222;
938};
939
940// @public (undocumented)
941export type KeyCodes = number;
942
943// @public
944export const labelProperties: Record<string, number>;
945
946// @public
947export const liProperties: Record<string, number>;
948
949// @public
950export function mapEnumByName<T>(theEnum: any, callback: (name?: string, value?: string | number) => T | undefined): (T | undefined)[] | undefined;
951
952// @public
953export function memoize<T extends Function>(target: any, key: string, descriptor: TypedPropertyDescriptor<T>): {
954 configurable: boolean;
955 get(): T;
956};
957
958// @public
959export function memoizeFunction<T extends (...args: any[]) => RetType, RetType>(cb: T, maxCacheSize?: number, ignoreNullOrUndefinedResult?: boolean): T;
960
961// @public
962export function merge<T = {}>(target: Partial<T>, ...args: (Partial<T> | null | undefined | false)[]): T;
963
964// @public
965export function mergeAriaAttributeValues(...ariaAttributes: (string | undefined | false)[]): string | undefined;
966
967// @public
968export function mergeCustomizations(props: ICustomizerProps, parentContext: ICustomizerContext): ICustomizerContext;
969
970// @public (undocumented)
971export function mergeScopedSettings(oldSettings?: ISettings, newSettings?: ISettings | ISettingsFunction): ISettings;
972
973// @public
974export function mergeSettings(oldSettings?: ISettings, newSettings?: ISettings | ISettingsFunction): ISettings;
975
976// @public
977export function modalize(target: HTMLElement): () => void;
978
979// @public
980export function nullRender(): JSX.Element | null;
981
982// @public
983export const olProperties: Record<string, number>;
984
985export { Omit }
986
987// @public
988export function omit<TObj extends Record<string, any>>(obj: TObj, exclusions: (keyof TObj)[]): TObj;
989
990// @public (undocumented)
991export function on(element: Element | Window | Document, eventName: string, callback: (ev: Event) => void, options?: boolean): () => void;
992
993// @public (undocumented)
994export const optionProperties: Record<string, number>;
995
996// @public
997export interface Point {
998 // (undocumented)
999 left?: number;
1000 // (undocumented)
1001 top?: number;
1002 // @deprecated (undocumented)
1003 x?: number;
1004 // @deprecated (undocumented)
1005 y?: number;
1006}
1007
1008export { portalContainsElement }
1009
1010// @public
1011export function precisionRound(value: number, precision: number, base?: number): number;
1012
1013// @public
1014export function raiseClick(target: Element): void;
1015
1016// @public
1017export class Rectangle {
1018 constructor(left?: number, right?: number, top?: number, bottom?: number);
1019 // (undocumented)
1020 bottom: number;
1021 equals(rect: Rectangle): boolean;
1022 readonly height: number;
1023 // (undocumented)
1024 left: number;
1025 // (undocumented)
1026 right: number;
1027 // (undocumented)
1028 top: number;
1029 readonly width: number;
1030}
1031
1032// @public (undocumented)
1033export type RefObject<T> = {
1034 (component: T | null): void;
1035 current: T | null;
1036};
1037
1038// @public
1039export function removeIndex<T>(array: T[], index: number): T[];
1040
1041// @public
1042export function replaceElement<T>(array: T[], newElement: T, index: number): T[];
1043
1044// @public
1045export function resetControlledWarnings(): void;
1046
1047// @public
1048export function resetIds(counter?: number): void;
1049
1050// @public
1051export function resetMemoizations(): void;
1052
1053// @public
1054export const safeRequestAnimationFrame: (component: React.Component<{}, {}, any>) => (cb: Function) => void;
1055
1056// @public
1057export const safeSetTimeout: (component: React.Component<{}, {}, any>) => (cb: Function, duration: number) => void;
1058
1059// @public (undocumented)
1060export class Selection<TItem = IObjectWithKey> implements ISelection<TItem> {
1061 constructor(...options: TItem extends IObjectWithKey ? [] | [ISelectionOptions<TItem>] : [ISelectionOptionsWithRequiredGetKey<TItem>]);
1062 // (undocumented)
1063 canSelectItem(item: TItem, index?: number): boolean;
1064 count: number;
1065 // (undocumented)
1066 getItemIndex(key: string): number;
1067 // (undocumented)
1068 getItems(): TItem[];
1069 // (undocumented)
1070 getKey(item: TItem, index?: number): string;
1071 // (undocumented)
1072 getSelectedCount(): number;
1073 // (undocumented)
1074 getSelectedIndices(): number[];
1075 // (undocumented)
1076 getSelection(): TItem[];
1077 // (undocumented)
1078 isAllSelected(): boolean;
1079 // (undocumented)
1080 isIndexSelected(index: number): boolean;
1081 // (undocumented)
1082 isKeySelected(key: string): boolean;
1083 // (undocumented)
1084 isModal(): boolean;
1085 // (undocumented)
1086 isRangeSelected(fromIndex: number, count: number): boolean;
1087 // (undocumented)
1088 readonly mode: SelectionMode;
1089 // (undocumented)
1090 selectToIndex(index: number, clearSelection?: boolean): void;
1091 // (undocumented)
1092 selectToKey(key: string, clearSelection?: boolean): void;
1093 // (undocumented)
1094 selectToRange(fromIndex: number, count: number, clearSelection?: boolean): void;
1095 // (undocumented)
1096 setAllSelected(isAllSelected: boolean): void;
1097 // (undocumented)
1098 setChangeEvents(isEnabled: boolean, suppressChange?: boolean): void;
1099 // (undocumented)
1100 setIndexSelected(index: number, isSelected: boolean, shouldAnchor: boolean): void;
1101 setItems(items: TItem[], shouldClear?: boolean): void;
1102 // (undocumented)
1103 setKeySelected(key: string, isSelected: boolean, shouldAnchor: boolean): void;
1104 // (undocumented)
1105 setModal(isModal: boolean): void;
1106 // (undocumented)
1107 setRangeSelected(fromIndex: number, count: number, isSelected: boolean, shouldAnchor: boolean): void;
1108 // (undocumented)
1109 toggleAllSelected(): void;
1110 // (undocumented)
1111 toggleIndexSelected(index: number): void;
1112 // (undocumented)
1113 toggleKeySelected(key: string): void;
1114 // (undocumented)
1115 toggleRangeSelected(fromIndex: number, count: number): void;
1116 }
1117
1118// @public (undocumented)
1119export const SELECTION_CHANGE = "change";
1120
1121// @public (undocumented)
1122export const SELECTION_ITEMS_CHANGE = "items-change";
1123
1124// @public (undocumented)
1125export enum SelectionDirection {
1126 // (undocumented)
1127 horizontal = 0,
1128 // (undocumented)
1129 vertical = 1
1130}
1131
1132// @public (undocumented)
1133export enum SelectionMode {
1134 // (undocumented)
1135 multiple = 2,
1136 // (undocumented)
1137 none = 0,
1138 // (undocumented)
1139 single = 1
1140}
1141
1142// @public
1143export const selectProperties: Record<string, number>;
1144
1145// @public
1146export function setBaseUrl(baseUrl: string): void;
1147
1148// @public
1149export function setFocusVisibility(enabled: boolean, target?: Element): void;
1150
1151// @public
1152export function setLanguage(language: string, persistenceType?: 'localStorage' | 'sessionStorage' | 'none'): void;
1153
1154// @public @deprecated
1155export function setLanguage(language: string, avoidPersisting?: boolean): void;
1156
1157// Warning: (ae-internal-missing-underscore) The name "setMemoizeWeakMap" should be prefixed with an underscore because the declaration is marked as @internal
1158//
1159// @internal
1160export function setMemoizeWeakMap(weakMap: any): void;
1161
1162export { setPortalAttribute }
1163
1164// @public
1165export function setRTL(isRTL: boolean, persistSetting?: boolean): void;
1166
1167// @public
1168export function setSSR(isEnabled: boolean): void;
1169
1170// @public @deprecated (undocumented)
1171export type Settings = ISettings;
1172
1173// @public @deprecated (undocumented)
1174export type SettingsFunction = ISettingsFunction;
1175
1176export { setVirtualParent }
1177
1178// @public
1179export function setWarningCallback(warningCallback?: (message: string) => void): void;
1180
1181// @public
1182export function shallowCompare<TA extends any, TB extends any>(a: TA, b: TB): boolean;
1183
1184// @public
1185export function shouldWrapFocus(element: HTMLElement, noWrapDataAttribute: 'data-no-vertical-wrap' | 'data-no-horizontal-wrap'): boolean;
1186
1187// @public
1188export function styled<TComponentProps extends IPropsWithStyles<TStyleProps, TStyleSet>, TStyleProps, TStyleSet extends IStyleSet<TStyleSet>>(Component: React.ComponentClass<TComponentProps> | React.FunctionComponent<TComponentProps>, baseStyles: IStyleFunctionOrObject<TStyleProps, TStyleSet>, getProps?: (props: TComponentProps) => Partial<TComponentProps>, customizable?: ICustomizableProps, pure?: boolean): React.FunctionComponent<TComponentProps>;
1189
1190// @public (undocumented)
1191export function styled<TComponentProps extends IPropsWithStyles<TStyleProps, TStyleSet> & React.RefAttributes<TRef>, TStyleProps, TStyleSet extends IStyleSet<TStyleSet>, TRef = unknown>(Component: React.ComponentClass<TComponentProps> | React.FunctionComponent<TComponentProps>, baseStyles: IStyleFunctionOrObject<TStyleProps, TStyleSet>, getProps?: (props: TComponentProps) => Partial<TComponentProps>, customizable?: ICustomizableProps, pure?: boolean): React.ForwardRefExoticComponent<React.PropsWithoutRef<TComponentProps> & React.RefAttributes<TRef>>;
1192
1193// @public (undocumented)
1194export type StyleFunction<TStyleProps, TStyleSet> = IStyleFunctionOrObject<TStyleProps, TStyleSet> & {
1195 __cachedInputs__: (IStyleFunctionOrObject<TStyleProps, TStyleSet> | undefined)[];
1196 __noStyleOverride__: boolean;
1197};
1198
1199// @public
1200export const tableProperties: Record<string, number>;
1201
1202// @public
1203export const tdProperties: Record<string, number>;
1204
1205// @public
1206export const textAreaProperties: Record<string, number>;
1207
1208// @public
1209export const thProperties: Record<string, number>;
1210
1211// @public
1212export function toMatrix<T>(items: T[], columnCount: number): T[][];
1213
1214// @public
1215export const trProperties: Record<string, number>;
1216
1217// @public
1218export function unhoistMethods(source: any, methodNames: string[]): void;
1219
1220// @public
1221export function useCustomizationSettings(properties: string[], scopeName?: string): ISettings;
1222
1223// @public
1224export function useFocusRects(rootRef?: React.RefObject<HTMLElement>): void;
1225
1226// @public
1227export function values<T>(obj: any): T[];
1228
1229// @public
1230export const videoProperties: Record<string, number>;
1231
1232// @public
1233export function warn(message: string): void;
1234
1235// @public
1236export function warnConditionallyRequiredProps<P>(componentName: string, props: P, requiredProps: string[], conditionalPropName: string, condition: boolean): void;
1237
1238// @public
1239export function warnControlledUsage<P>(params: IWarnControlledUsageParams<P>): void;
1240
1241// @public
1242export function warnDeprecations<P>(componentName: string, props: P, deprecationMap: ISettingsMap<P>): void;
1243
1244// @public
1245export function warnMutuallyExclusive<P>(componentName: string, props: P, exclusiveMap: ISettingsMap<P>): void;
1246
1247
1248// (No @packageDocumentation comment for this package)
1249
1250```