@uifabric/utilities
Version:
Fluent UI React utilities for building components.
1,251 lines (1,023 loc) • 40.4 kB
Markdown
## API Report File for "@uifabric/utilities"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { DATA_PORTAL_ATTRIBUTE } from '@fluentui/dom-utilities';
import { elementContains } from '@fluentui/dom-utilities';
import { elementContainsAttribute } from '@fluentui/dom-utilities';
import { findElementRecursive } from '@fluentui/dom-utilities';
import { getChildren } from '@fluentui/dom-utilities';
import { getParent } from '@fluentui/dom-utilities';
import { getVirtualParent } from '@fluentui/dom-utilities';
import { IProcessedStyleSet } from '@uifabric/merge-styles';
import { IStyleFunction } from '@uifabric/merge-styles';
import { IStyleFunctionOrObject } from '@uifabric/merge-styles';
import { IStyleSet } from '@uifabric/merge-styles';
import { isVirtualElement } from '@fluentui/dom-utilities';
import { IVirtualElement } from '@fluentui/dom-utilities';
import { Omit } from '@uifabric/merge-styles';
import { portalContainsElement } from '@fluentui/dom-utilities';
import * as React from 'react';
import { setPortalAttribute } from '@fluentui/dom-utilities';
import { setVirtualParent } from '@fluentui/dom-utilities';
// @public
export function addDirectionalKeyCode(which: number): void;
// @public
export function addElementAtIndex<T>(array: T[], index: number, itemToAdd: T): T[];
// @public
export const allowOverscrollOnElement: (element: HTMLElement | null, events: EventGroup) => void;
// @public
export const allowScrollOnElement: (element: HTMLElement | null, events: EventGroup) => void;
// @public
export const anchorProperties: Record<string, number>;
// @public
export function appendFunction(parent: any, ...functions: any[]): () => void;
// @public
export function arraysEqual<T>(array1: T[], array2: T[]): boolean;
// @public
export function asAsync<TProps>(options: IAsAsyncOptions<TProps>): React.ForwardRefExoticComponent<React.PropsWithoutRef<TProps & {
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;
}> & React.RefAttributes<React.ElementType<TProps>>>;
// @public
export function assertNever(x: never): never;
// @public
export function assign(target: any, ...args: any[]): any;
// @public
export class Async {
constructor(parent?: object, onError?: (e: any) => void);
// (undocumented)
cancelAnimationFrame(id: number, targetElement?: Element | null): void;
clearImmediate(id: number, targetElement?: Element | null): void;
clearInterval(id: number): void;
clearTimeout(id: number): void;
debounce<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
leading?: boolean;
maxWait?: number;
trailing?: boolean;
}): ICancelable<T> & T;
dispose(): void;
// (undocumented)
protected _logError(e: any): void;
// (undocumented)
requestAnimationFrame(callback: () => void, targetElement?: Element | null): number;
setImmediate(callback: () => void, targetElement?: Element | null): number;
setInterval(callback: () => void, duration: number): number;
setTimeout(callback: () => void, duration: number): number;
throttle<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
leading?: boolean;
trailing?: boolean;
}): T;
}
// @public
export const audioProperties: Record<string, number>;
// @public
export class AutoScroll {
constructor(element: HTMLElement);
// (undocumented)
dispose(): void;
}
// @public @deprecated
export class BaseComponent<TProps extends IBaseProps = {}, TState = {}> extends React.Component<TProps, TState> {
constructor(props: TProps, context?: any);
protected readonly _async: Async;
readonly className: string;
componentDidMount(): void;
componentDidUpdate(prevProps: TProps, prevState: TState): void;
componentWillUnmount(): void;
protected readonly _disposables: IDisposable[];
protected readonly _events: EventGroup;
// @deprecated (undocumented)
static onError: (errorMessage?: string, ex?: any) => void;
// @deprecated
protected _resolveRef(refName: string): (ref: React.ReactNode) => React.ReactNode;
protected _skipComponentRefResolution: boolean;
protected _updateComponentRef(currentProps: IBaseProps, newProps?: IBaseProps): void;
protected _warnConditionallyRequiredProps(requiredProps: string[], conditionalPropName: string, condition: boolean): void;
protected _warnDeprecations(deprecationMap: ISettingsMap<TProps>): void;
protected _warnMutuallyExclusive(mutuallyExclusiveMap: ISettingsMap<TProps>): void;
}
// @public
export const baseElementEvents: Record<string, number>;
// @public
export const baseElementProperties: Record<string, number>;
// @public
export const buttonProperties: Record<string, number>;
// @public
export function calculatePrecision(value: number | string): number;
// @public
export function classNamesFunction<TStyleProps extends {}, TStyleSet extends IStyleSet<TStyleSet>>(options?: IClassNamesFunctionOptions): (getStyles: IStyleFunctionOrObject<TStyleProps, TStyleSet> | undefined, styleProps?: TStyleProps) => IProcessedStyleSet<TStyleSet>;
// @public (undocumented)
export const colGroupProperties: Record<string, number>;
// @public (undocumented)
export const colProperties: Record<string, number>;
// @public
export function composeComponentAs<TProps>(outer: IComponentAs<TProps>, inner: IComponentAs<TProps>): IComponentAs<TProps>;
// @public
export function composeRenderFunction<TProps>(outer: IRenderFunction<TProps>, inner: IRenderFunction<TProps>): IRenderFunction<TProps>;
// @public
export function createArray<T>(size: number, getItem: (index: number) => T): T[];
// @public
export function createMemoizer<F extends (input: any) => any>(getValue: F): F;
// @public
export 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;
// Warning: (ae-incompatible-release-tags) The symbol "css" is marked as @public, but its signature references "ICssInput" which is marked as @internal
//
// @public
export function css(...args: ICssInput[]): string;
// @public (undocumented)
export function customizable(scope: string, fields: string[], concatStyles?: boolean): <P>(ComposedComponent: React.ComponentType<P>) => any;
// @public (undocumented)
export class Customizations {
static applyBatchedUpdates(code: () => void, suppressUpdate?: boolean): void;
static applyScopedSettings(scopeName: string, settings: ISettings): void;
static applySettings(settings: ISettings): void;
// (undocumented)
static getSettings(properties: string[], scopeName?: string, localSettings?: ICustomizations): any;
// (undocumented)
static observe(onChange: () => void): void;
// (undocumented)
static reset(): void;
// (undocumented)
static unobserve(onChange: () => void): void;
}
// @public
export class Customizer extends React.Component<ICustomizerProps> {
// (undocumented)
componentDidMount(): void;
// (undocumented)
componentWillUnmount(): void;
// (undocumented)
render(): React.ReactElement<{}>;
}
// @public (undocumented)
export const CustomizerContext: React.Context<ICustomizerContext>;
// @public
export const DATA_IS_SCROLLABLE_ATTRIBUTE = "data-is-scrollable";
export { DATA_PORTAL_ATTRIBUTE }
// Warning: (ae-incompatible-release-tags) The symbol "DelayedRender" is marked as @public, but its signature references "IDelayedRenderState" which is marked as @internal
//
// @public
export class DelayedRender extends React.Component<IDelayedRenderProps, IDelayedRenderState> {
constructor(props: IDelayedRenderProps);
// (undocumented)
componentDidMount(): void;
// (undocumented)
componentWillUnmount(): void;
// (undocumented)
static defaultProps: {
delay: number;
};
// (undocumented)
render(): React.ReactElement<{}> | null;
}
// @public
export function disableBodyScroll(): void;
// @public
export const divProperties: Record<string, number>;
// @public
export function doesElementContainFocus(element: HTMLElement): boolean;
export { elementContains }
export { elementContainsAttribute }
// @public
export function enableBodyScroll(): void;
// @public
export class EventGroup {
constructor(parent: any);
declare(event: string | string[]): void;
// (undocumented)
dispose(): void;
static isDeclared(target: any, eventName: string): boolean;
// (undocumented)
static isObserved(target: any, eventName: string): boolean;
// (undocumented)
off(target?: any, eventName?: string, callback?: (args?: any) => void, options?: boolean | AddEventListenerOptions): void;
on(target: any, eventName: string, callback: (args?: any) => void, options?: boolean | AddEventListenerOptions): void;
onAll(target: any, events: {
[key: string]: (args?: any) => void;
}, useCapture?: boolean): void;
static raise(target: any, eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined;
raise(eventName: string, eventArgs?: any, bubbleEvent?: boolean): boolean | undefined;
// (undocumented)
static stopPropagation(event: any): void;
}
// @public
export function extendComponent<T extends React.Component>(parent: T, methods: {
[key in keyof T]?: T[key];
}): void;
// @public
export class FabricPerformance {
static measure(name: string, func: () => void): void;
// (undocumented)
static reset(): void;
// (undocumented)
static setPeriodicReset(): void;
// Warning: (ae-incompatible-release-tags) The symbol "summary" is marked as @public, but its signature references "IPerfSummary" which is marked as @internal
//
// (undocumented)
static summary: IPerfSummary;
}
// @public
export function filteredAssign(isAllowed: (propName: string) => boolean, target: any, ...args: any[]): any;
// @public
export function find<T>(array: T[], cb: (item: T, index: number) => boolean): T | undefined;
export { findElementRecursive }
// @public
export function findIndex<T>(array: T[], cb: (item: T, index: number) => boolean, fromIndex?: number): number;
// @public
export function findScrollableParent(startingElement: HTMLElement | null): HTMLElement | Window | undefined | null;
// @public
export function fitContentToBounds(options: IFitContentToBoundsOptions): ISize;
// @public
export type FitMode = 'contain' | 'cover';
// @public
export function flatten<T>(array: (T | T[])[]): T[];
// @public
export function focusAsync(element: HTMLElement | {
focus: () => void;
} | undefined | null): void;
// @public
export function focusFirstChild(rootElement: HTMLElement): boolean;
// @public
export const FocusRects: React.FunctionComponent<{
rootRef?: React.RefObject<HTMLElement>;
}>;
// @public
export function format(s: string, ...values: any[]): string;
// @public
export const formProperties: Record<string, number>;
export { getChildren }
// @public
export function getDistanceBetweenPoints(point1: Point, point2: Point): number;
// @public
export function getDocument(rootElement?: HTMLElement | null): Document | undefined;
// @public
export function getElementIndexPath(fromElement: HTMLElement, toElement: HTMLElement): number[];
// @public
export function getFirstFocusable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean): HTMLElement | null;
// @public
export function getFirstTabbable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean, checkNode?: boolean): HTMLElement | null;
// @public
export function getFocusableByIndexPath(parent: HTMLElement, path: number[]): HTMLElement | undefined;
// @public
export function getId(prefix?: string): string;
// @public
export function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
// @public
export function getLanguage(persistenceType?: 'localStorage' | 'sessionStorage' | 'none'): string | null;
// @public
export function getLastFocusable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean): HTMLElement | null;
// @public
export function getLastTabbable(rootElement: HTMLElement, currentElement: HTMLElement, includeElementsInFocusZones?: boolean, checkNode?: boolean): HTMLElement | null;
// @public
export function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(tagName: string, props: {}, excludedPropNames?: string[]): TAttributes;
// @public
export function getNativeProps<T extends Record<string, any>>(props: Record<string, any>, allowedPropNames: string[] | Record<string, number>, excludedPropNames?: string[]): T;
// @public
export function getNextElement(rootElement: HTMLElement, currentElement: HTMLElement | null, checkNode?: boolean, suppressParentTraversal?: boolean, suppressChildTraversal?: boolean, includeElementsInFocusZones?: boolean, allowFocusRoot?: boolean, tabbable?: boolean): HTMLElement | null;
export { getParent }
// @public
export function getPreviousElement(rootElement: HTMLElement, currentElement: HTMLElement | null, checkNode?: boolean, suppressParentTraversal?: boolean, traverseChildren?: boolean, includeElementsInFocusZones?: boolean, allowFocusRoot?: boolean, tabbable?: boolean): HTMLElement | null;
// @public
export function getPropsWithDefaults<TProps extends {}>(defaultProps: Partial<TProps>, propsWithoutDefaults: TProps): TProps;
// @public
export function getRect(element: HTMLElement | Window | null): IRectangle | undefined;
// @public
export function getResourceUrl(url: string): string;
// @public
export function getRTL(theme?: {
rtl?: boolean;
}): boolean;
// @public
export function getRTLSafeKeyCode(key: number, theme?: {
rtl?: boolean;
}): number;
// @public
export function getScrollbarWidth(): number;
export { getVirtualParent }
// @public
export function getWindow(rootElement?: Element | null): Window | undefined;
// @public
export class GlobalSettings {
// (undocumented)
static addChangeListener(cb: IChangeEventCallback): void;
// (undocumented)
static getValue<T>(key: string, defaultValue?: T | (() => T)): T;
// (undocumented)
static removeChangeListener(cb: IChangeEventCallback): void;
// (undocumented)
static setValue<T>(key: string, value: T): T;
}
// @public
export function hasHorizontalOverflow(element: HTMLElement): boolean;
// @public
export function hasOverflow(element: HTMLElement): boolean;
// @public
export function hasVerticalOverflow(element: HTMLElement): boolean;
// @public
export function hoistMethods(destination: any, source: any, exclusions?: string[]): string[];
// @public
export function hoistStatics<TSource extends Object, TDest>(source: TSource, dest: TDest): TDest;
// @public
export const htmlElementProperties: Record<string, number>;
// @public (undocumented)
export interface IAsAsyncOptions<TProps> {
load: () => Promise<React.ElementType<TProps>>;
onError?: (error: Error) => void;
onLoad?: () => void;
}
// @public
export interface IBaseProps<T = any> {
// (undocumented)
componentRef?: IRefObject<T>;
}
// @public (undocumented)
export type ICancelable<T extends (...args: any[]) => any> = {
flush: () => ReturnType<T>;
cancel: () => void;
pending: () => boolean;
};
// @public
export interface IChangeDescription {
// (undocumented)
key: string;
// (undocumented)
oldValue: any;
// (undocumented)
value: any;
}
// @public
export interface IChangeEventCallback {
// (undocumented)
(changeDescription?: IChangeDescription): void;
// (undocumented)
__id__?: string;
}
// @public @deprecated (undocumented)
export type IClassNames<T> = {
[key in keyof T]: string;
};
// @public (undocumented)
export interface IClassNamesFunctionOptions {
cacheSize?: number;
disableCaching?: boolean;
useStaticStyles?: boolean;
}
// @public
export type IComponentAs<T> = React.ComponentType<IComponentAsProps<T>>;
// @public
export type IComponentAsProps<T> = T & {
defaultRender?: React.ComponentType<T>;
};
// Warning: (ae-internal-missing-underscore) The name "ICssInput" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export type ICssInput = string | ISerializableObject | IDictionary | null | undefined | boolean;
// @public (undocumented)
export interface ICustomizableProps {
fields?: string[];
scope: string;
}
// @public (undocumented)
export interface ICustomizations {
// (undocumented)
inCustomizerContext?: boolean;
// (undocumented)
scopedSettings: {
[key: string]: ISettings;
};
// (undocumented)
settings: ISettings;
}
// @public (undocumented)
export interface ICustomizerContext {
// (undocumented)
customizations: ICustomizations;
}
// @public (undocumented)
export type ICustomizerProps = IBaseProps & Partial<{
settings: ISettings | ISettingsFunction;
scopedSettings: ISettings | ISettingsFunction;
}> & {
contextTransform?: (context: Readonly<ICustomizerContext>) => ICustomizerContext;
};
// Warning: (ae-internal-missing-underscore) The name "IDeclaredEventsByName" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export interface IDeclaredEventsByName {
// (undocumented)
[eventName: string]: boolean;
}
// @public
export interface IDelayedRenderProps extends React.Props<{}> {
delay?: number;
}
// Warning: (ae-internal-missing-underscore) The name "IDelayedRenderState" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface IDelayedRenderState {
isRendered: boolean;
}
// Warning: (ae-internal-missing-underscore) The name "IDictionary" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface IDictionary {
// (undocumented)
[className: string]: boolean;
}
// @public
export interface IDisposable {
// (undocumented)
dispose: () => void;
}
// Warning: (ae-internal-missing-underscore) The name "IEventRecord" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export interface IEventRecord {
// (undocumented)
callback: (args?: any) => void;
// (undocumented)
elementCallback?: (...args: any[]) => void;
// (undocumented)
eventName: string;
// (undocumented)
objectCallback?: (args?: any) => void;
// (undocumented)
options?: boolean | AddEventListenerOptions;
// (undocumented)
parent: any;
// (undocumented)
target: any;
}
// Warning: (ae-internal-missing-underscore) The name "IEventRecordList" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export interface IEventRecordList {
// (undocumented)
[id: string]: IEventRecord[] | number;
// (undocumented)
count: number;
}
// Warning: (ae-internal-missing-underscore) The name "IEventRecordsByName" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal (undocumented)
export interface IEventRecordsByName {
// (undocumented)
[eventName: string]: IEventRecordList;
}
// @public
export interface IFitContentToBoundsOptions {
boundsSize: ISize;
contentSize: ISize;
maxScale?: number;
mode: FitMode;
}
// @public
export const iframeProperties: Record<string, number>;
// @public @deprecated (undocumented)
export const imageProperties: Record<string, number>;
// @public
export const imgProperties: Record<string, number>;
// @public
export function initializeComponentRef<TProps extends IBaseProps, TState>(obj: React.Component<TProps, TState>): void;
// @public @deprecated
export function initializeFocusRects(window?: Window): void;
// @public
export const inputProperties: Record<string, number>;
// @public (undocumented)
export interface IObjectWithKey {
// (undocumented)
key?: string | number;
}
// Warning: (ae-internal-missing-underscore) The name "IPerfData" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface IPerfData {
// (undocumented)
duration: number;
// (undocumented)
timeStamp: number;
}
// Warning: (ae-internal-missing-underscore) The name "IPerfMeasurement" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface IPerfMeasurement {
// (undocumented)
all: IPerfData[];
// (undocumented)
count: number;
// (undocumented)
totalDuration: number;
}
// Warning: (ae-internal-missing-underscore) The name "IPerfSummary" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface IPerfSummary {
// (undocumented)
[key: string]: IPerfMeasurement;
}
// @public @deprecated
export interface IPoint extends Point {
}
// @public (undocumented)
export interface IPropsWithStyles<TStyleProps, TStyleSet extends IStyleSet<TStyleSet>> {
// (undocumented)
styles?: IStyleFunctionOrObject<TStyleProps, TStyleSet>;
}
// @public
export interface IRectangle {
// (undocumented)
bottom?: number;
// (undocumented)
height: number;
// (undocumented)
left: number;
// (undocumented)
right?: number;
// (undocumented)
top: number;
// (undocumented)
width: number;
}
// @public (undocumented)
export type IRefObject<T> = React.RefObject<T> | RefObject<T> | ((ref: T | null) => void);
// @public
export interface IRenderComponent<TProps> {
children: (props: TProps) => JSX.Element;
}
// @public
export interface IRenderFunction<P> {
// (undocumented)
(props?: P, defaultRender?: (props?: P) => JSX.Element | null): JSX.Element | null;
}
// @public
export function isControlled<P>(props: P, valueProp: keyof P): boolean;
// @public
export function isDirectionalKeyCode(which: number): boolean;
// @public (undocumented)
export interface ISelection<TItem = IObjectWithKey> {
// (undocumented)
canSelectItem: (item: TItem, index?: number) => boolean;
// (undocumented)
count: number;
// (undocumented)
getItemIndex?(key: string): number;
// (undocumented)
getItems(): TItem[];
// (undocumented)
getSelectedCount(): number;
// (undocumented)
getSelectedIndices(): number[];
// (undocumented)
getSelection(): TItem[];
// (undocumented)
isAllSelected(): boolean;
// (undocumented)
isIndexSelected(index: number): boolean;
// (undocumented)
isKeySelected(key: string): boolean;
// (undocumented)
isModal?(): boolean;
// (undocumented)
isRangeSelected(fromIndex: number, count: number): boolean;
// (undocumented)
mode: SelectionMode;
// (undocumented)
selectToIndex(index: number, clearSelection?: boolean): void;
// (undocumented)
selectToKey(key: string, clearSelection?: boolean): void;
// (undocumented)
selectToRange?(index: number, count: number, clearSelection?: boolean): void;
// (undocumented)
setAllSelected(isAllSelected: boolean): void;
// (undocumented)
setChangeEvents(isEnabled: boolean, suppressChange?: boolean): void;
// (undocumented)
setIndexSelected(index: number, isSelected: boolean, shouldAnchor: boolean): void;
// (undocumented)
setItems(items: TItem[], shouldClear: boolean): void;
// (undocumented)
setKeySelected(key: string, isSelected: boolean, shouldAnchor: boolean): void;
// (undocumented)
setModal?(isModal: boolean): void;
// (undocumented)
setRangeSelected?(fromIndex: number, count: number, isSelected: boolean, shouldAnchor: boolean): void;
// (undocumented)
toggleAllSelected(): void;
// (undocumented)
toggleIndexSelected(index: number): void;
// (undocumented)
toggleKeySelected(key: string): void;
// (undocumented)
toggleRangeSelected(fromIndex: number, count: number): void;
}
// @public (undocumented)
export interface ISelectionOptions<TItem = IObjectWithKey> {
// (undocumented)
canSelectItem?: (item: TItem, index?: number) => boolean;
getKey?: (item: TItem, index?: number) => string | number;
// (undocumented)
items?: TItem[];
// (undocumented)
onItemsChanged?: () => void;
// (undocumented)
onSelectionChanged?: () => void;
// (undocumented)
selectionMode?: SelectionMode;
}
// @public
export type ISelectionOptionsWithRequiredGetKey<TItem> = ISelectionOptions<TItem> & Required<Pick<ISelectionOptions<TItem>, 'getKey'>>;
// @public
export function isElementFocusSubZone(element?: HTMLElement): boolean;
// @public
export function isElementFocusZone(element?: HTMLElement): boolean;
// @public
export function isElementTabbable(element: HTMLElement, checkTabIndex?: boolean): boolean;
// @public
export function isElementVisible(element: HTMLElement | undefined | null): boolean;
// Warning: (ae-internal-missing-underscore) The name "ISerializableObject" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export interface ISerializableObject {
// (undocumented)
toString?: () => string;
}
// @public (undocumented)
export type ISettings = {
[key: string]: any;
};
// @public (undocumented)
export type ISettingsFunction = (settings: ISettings) => ISettings;
// @public (undocumented)
export type ISettingsMap<T> = {
[P in keyof T]?: string;
};
// @public (undocumented)
export const IsFocusVisibleClassName = "ms-Fabric--isFocusVisible";
// @public (undocumented)
export const isIE11: () => boolean;
// @public
export const isIOS: () => boolean;
// @public (undocumented)
export interface ISize {
// (undocumented)
height: number;
// (undocumented)
width: number;
}
// @public
export function isMac(reset?: boolean): boolean;
export { IStyleFunction }
export { IStyleFunctionOrObject }
export { isVirtualElement }
export { IVirtualElement }
// @public (undocumented)
export interface IWarnControlledUsageParams<P> {
componentId: string;
componentName: string;
defaultValueProp: keyof P;
oldProps?: P;
onChangeProp: keyof P;
props: P;
readOnlyProp?: keyof P;
valueProp: keyof P;
}
// @public
export const KeyCodes: {
backspace: 8;
tab: 9;
enter: 13;
shift: 16;
ctrl: 17;
alt: 18;
pauseBreak: 19;
capslock: 20;
escape: 27;
space: 32;
pageUp: 33;
pageDown: 34;
end: 35;
home: 36;
left: 37;
up: 38;
right: 39;
down: 40;
insert: 45;
del: 46;
zero: 48;
one: 49;
two: 50;
three: 51;
four: 52;
five: 53;
six: 54;
seven: 55;
eight: 56;
nine: 57;
a: 65;
b: 66;
c: 67;
d: 68;
e: 69;
f: 70;
g: 71;
h: 72;
i: 73;
j: 74;
k: 75;
l: 76;
m: 77;
n: 78;
o: 79;
p: 80;
q: 81;
r: 82;
s: 83;
t: 84;
u: 85;
v: 86;
w: 87;
x: 88;
y: 89;
z: 90;
leftWindow: 91;
rightWindow: 92;
select: 93;
zero_numpad: 96;
one_numpad: 97;
two_numpad: 98;
three_numpad: 99;
four_numpad: 100;
five_numpad: 101;
six_numpad: 102;
seven_numpad: 103;
eight_numpad: 104;
nine_numpad: 105;
multiply: 106;
add: 107;
subtract: 109;
decimalPoint: 110;
divide: 111;
f1: 112;
f2: 113;
f3: 114;
f4: 115;
f5: 116;
f6: 117;
f7: 118;
f8: 119;
f9: 120;
f10: 121;
f11: 122;
f12: 123;
numlock: 144;
scrollLock: 145;
semicolon: 186;
equalSign: 187;
comma: 188;
dash: 189;
period: 190;
forwardSlash: 191;
graveAccent: 192;
openBracket: 219;
backSlash: 220;
closeBracket: 221;
singleQuote: 222;
};
// @public (undocumented)
export type KeyCodes = number;
// @public
export const labelProperties: Record<string, number>;
// @public
export const liProperties: Record<string, number>;
// @public
export function mapEnumByName<T>(theEnum: any, callback: (name?: string, value?: string | number) => T | undefined): (T | undefined)[] | undefined;
// @public
export function memoize<T extends Function>(target: any, key: string, descriptor: TypedPropertyDescriptor<T>): {
configurable: boolean;
get(): T;
};
// @public
export function memoizeFunction<T extends (...args: any[]) => RetType, RetType>(cb: T, maxCacheSize?: number, ignoreNullOrUndefinedResult?: boolean): T;
// @public
export function merge<T = {}>(target: Partial<T>, ...args: (Partial<T> | null | undefined | false)[]): T;
// @public
export function mergeAriaAttributeValues(...ariaAttributes: (string | undefined | false)[]): string | undefined;
// @public
export function mergeCustomizations(props: ICustomizerProps, parentContext: ICustomizerContext): ICustomizerContext;
// @public (undocumented)
export function mergeScopedSettings(oldSettings?: ISettings, newSettings?: ISettings | ISettingsFunction): ISettings;
// @public
export function mergeSettings(oldSettings?: ISettings, newSettings?: ISettings | ISettingsFunction): ISettings;
// @public
export function modalize(target: HTMLElement): () => void;
// @public
export function nullRender(): JSX.Element | null;
// @public
export const olProperties: Record<string, number>;
export { Omit }
// @public
export function omit<TObj extends Record<string, any>>(obj: TObj, exclusions: (keyof TObj)[]): TObj;
// @public (undocumented)
export function on(element: Element | Window | Document, eventName: string, callback: (ev: Event) => void, options?: boolean): () => void;
// @public (undocumented)
export const optionProperties: Record<string, number>;
// @public
export interface Point {
// (undocumented)
left?: number;
// (undocumented)
top?: number;
// @deprecated (undocumented)
x?: number;
// @deprecated (undocumented)
y?: number;
}
export { portalContainsElement }
// @public
export function precisionRound(value: number, precision: number, base?: number): number;
// @public
export function raiseClick(target: Element): void;
// @public
export class Rectangle {
constructor(left?: number, right?: number, top?: number, bottom?: number);
// (undocumented)
bottom: number;
equals(rect: Rectangle): boolean;
readonly height: number;
// (undocumented)
left: number;
// (undocumented)
right: number;
// (undocumented)
top: number;
readonly width: number;
}
// @public (undocumented)
export type RefObject<T> = {
(component: T | null): void;
current: T | null;
};
// @public
export function removeIndex<T>(array: T[], index: number): T[];
// @public
export function replaceElement<T>(array: T[], newElement: T, index: number): T[];
// @public
export function resetControlledWarnings(): void;
// @public
export function resetIds(counter?: number): void;
// @public
export function resetMemoizations(): void;
// @public
export const safeRequestAnimationFrame: (component: React.Component<{}, {}, any>) => (cb: Function) => void;
// @public
export const safeSetTimeout: (component: React.Component<{}, {}, any>) => (cb: Function, duration: number) => void;
// @public (undocumented)
export class Selection<TItem = IObjectWithKey> implements ISelection<TItem> {
constructor(...options: TItem extends IObjectWithKey ? [] | [ISelectionOptions<TItem>] : [ISelectionOptionsWithRequiredGetKey<TItem>]);
// (undocumented)
canSelectItem(item: TItem, index?: number): boolean;
count: number;
// (undocumented)
getItemIndex(key: string): number;
// (undocumented)
getItems(): TItem[];
// (undocumented)
getKey(item: TItem, index?: number): string;
// (undocumented)
getSelectedCount(): number;
// (undocumented)
getSelectedIndices(): number[];
// (undocumented)
getSelection(): TItem[];
// (undocumented)
isAllSelected(): boolean;
// (undocumented)
isIndexSelected(index: number): boolean;
// (undocumented)
isKeySelected(key: string): boolean;
// (undocumented)
isModal(): boolean;
// (undocumented)
isRangeSelected(fromIndex: number, count: number): boolean;
// (undocumented)
readonly mode: SelectionMode;
// (undocumented)
selectToIndex(index: number, clearSelection?: boolean): void;
// (undocumented)
selectToKey(key: string, clearSelection?: boolean): void;
// (undocumented)
selectToRange(fromIndex: number, count: number, clearSelection?: boolean): void;
// (undocumented)
setAllSelected(isAllSelected: boolean): void;
// (undocumented)
setChangeEvents(isEnabled: boolean, suppressChange?: boolean): void;
// (undocumented)
setIndexSelected(index: number, isSelected: boolean, shouldAnchor: boolean): void;
setItems(items: TItem[], shouldClear?: boolean): void;
// (undocumented)
setKeySelected(key: string, isSelected: boolean, shouldAnchor: boolean): void;
// (undocumented)
setModal(isModal: boolean): void;
// (undocumented)
setRangeSelected(fromIndex: number, count: number, isSelected: boolean, shouldAnchor: boolean): void;
// (undocumented)
toggleAllSelected(): void;
// (undocumented)
toggleIndexSelected(index: number): void;
// (undocumented)
toggleKeySelected(key: string): void;
// (undocumented)
toggleRangeSelected(fromIndex: number, count: number): void;
}
// @public (undocumented)
export const SELECTION_CHANGE = "change";
// @public (undocumented)
export const SELECTION_ITEMS_CHANGE = "items-change";
// @public (undocumented)
export enum SelectionDirection {
// (undocumented)
horizontal = 0,
// (undocumented)
vertical = 1
}
// @public (undocumented)
export enum SelectionMode {
// (undocumented)
multiple = 2,
// (undocumented)
none = 0,
// (undocumented)
single = 1
}
// @public
export const selectProperties: Record<string, number>;
// @public
export function setBaseUrl(baseUrl: string): void;
// @public
export function setFocusVisibility(enabled: boolean, target?: Element): void;
// @public
export function setLanguage(language: string, persistenceType?: 'localStorage' | 'sessionStorage' | 'none'): void;
// @public @deprecated
export function setLanguage(language: string, avoidPersisting?: boolean): void;
// Warning: (ae-internal-missing-underscore) The name "setMemoizeWeakMap" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
export function setMemoizeWeakMap(weakMap: any): void;
export { setPortalAttribute }
// @public
export function setRTL(isRTL: boolean, persistSetting?: boolean): void;
// @public
export function setSSR(isEnabled: boolean): void;
// @public @deprecated (undocumented)
export type Settings = ISettings;
// @public @deprecated (undocumented)
export type SettingsFunction = ISettingsFunction;
export { setVirtualParent }
// @public
export function setWarningCallback(warningCallback?: (message: string) => void): void;
// @public
export function shallowCompare<TA extends any, TB extends any>(a: TA, b: TB): boolean;
// @public
export function shouldWrapFocus(element: HTMLElement, noWrapDataAttribute: 'data-no-vertical-wrap' | 'data-no-horizontal-wrap'): boolean;
// @public
export 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>;
// @public (undocumented)
export 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>>;
// @public (undocumented)
export type StyleFunction<TStyleProps, TStyleSet> = IStyleFunctionOrObject<TStyleProps, TStyleSet> & {
__cachedInputs__: (IStyleFunctionOrObject<TStyleProps, TStyleSet> | undefined)[];
__noStyleOverride__: boolean;
};
// @public
export const tableProperties: Record<string, number>;
// @public
export const tdProperties: Record<string, number>;
// @public
export const textAreaProperties: Record<string, number>;
// @public
export const thProperties: Record<string, number>;
// @public
export function toMatrix<T>(items: T[], columnCount: number): T[][];
// @public
export const trProperties: Record<string, number>;
// @public
export function unhoistMethods(source: any, methodNames: string[]): void;
// @public
export function useCustomizationSettings(properties: string[], scopeName?: string): ISettings;
// @public
export function useFocusRects(rootRef?: React.RefObject<HTMLElement>): void;
// @public
export function values<T>(obj: any): T[];
// @public
export const videoProperties: Record<string, number>;
// @public
export function warn(message: string): void;
// @public
export function warnConditionallyRequiredProps<P>(componentName: string, props: P, requiredProps: string[], conditionalPropName: string, condition: boolean): void;
// @public
export function warnControlledUsage<P>(params: IWarnControlledUsageParams<P>): void;
// @public
export function warnDeprecations<P>(componentName: string, props: P, deprecationMap: ISettingsMap<P>): void;
// @public
export function warnMutuallyExclusive<P>(componentName: string, props: P, exclusiveMap: ISettingsMap<P>): void;
// (No @packageDocumentation comment for this package)
```