//Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. /** * Office UI Fabric JS 1.5.0 * The JavaScript front-end framework for building experiences for Office 365. **/ declare namespace fabric { class Animate { private static _transformProps; private static _filters; private static _timeProps; private static _callbackProps; private static _animationObjects; /** * @param {HTMLElement} element * @param {object} props Transition properties * @param {number} props.duration The duration of the transition in seconds * @param {number} props.delay A delay in seconds that occurs before the transition starts * @param {string} props.ease An easing equation applied to the transition * @param {function} props.onEnd A function that is called when the transition ends * @param {array} props.onEndArgs An array of parameters applied to the onEnd function * @param {number} props.x props.y props.left, props.opacity etc... CSS values to transition to */ static transition(element: HTMLElement, props: any): void; /** * @param {HTMLElement} element * @param {string} keyframes A name of a keyframe animation * @param {object} props Animation properties * @param {number} props.duration The duration of the animation in seconds * @param {number} props.delay A delay in seconds that occurs before the animation starts * @param {string} props.ease An easing equation applied to the animation * @param {function} props.onEnd A function that is called when the animation ends * @param {array} props.onEndArgs An array of parameters applied to the onEnd function */ static animation(element: HTMLElement, keyframes: string, props: any): void; /** * @param {HTMLElement} element * @param {object} props Scroll animation properties * @param {number} props.duration The duration of the transition in seconds * @param {number} props.top The end scroll position of the element * @param {number} props.delay A delay in seconds that occurs before the scroll starts * @param {function} props.onEnd A function that is called when the scrolling animation ends * @param {array} props.onEndArgs An array of parameters applied to the onEnd function */ static scrollTo(element: HTMLElement, props: any): void; private static _setScrollProperties(obj); private static _parseProperties(obj); private static _animateScroll(obj); private static _createTransition(obj); private static _createAnimation(obj); private static _getTransitionProperties(obj); private static _setProperties(obj); private static _setRegularValues(obj, key); private static _setFilterValues(obj, key); private static _setTransformValues(obj, key); private static _setTransformations(obj); private static _setCallback(obj); private static _complete(event); private static _getAnimationObjByElement(element); private static _removeAnimationObject(obj); private static _executeCallback(obj); private static _contains(array, value); private static _camelCaseToDash(value); private static _easeOutExpo(time, begin, change, duration); } } declare namespace fabric { class Ease { static QUAD_EASE_IN: string; static CUBIC_EASE_IN: string; static QUART_EASE_IN: string; static QUINT_EASE_IN: string; static SINE_EASE_IN: string; static EXPO_EASE_IN: string; static CIRC_EASE_IN: string; static BACK_EASE_IN: string; static QUAD_EASE_OUT: string; static CUBIC_EASE_OUT: string; static QUART_EASE_OUT: string; static QUINT_EASE_OUT: string; static SINE_EASE_OUT: string; static EXPO_EASE_OUT: string; static CIRC_EASE_OUT: string; static BACK_EASE_OUT: string; static QUAD_EASE_IN_OUT: string; static CUBIC_EASE_IN_OUT: string; static QUART_EASE_IN_OUT: string; static QUINT_EASE_IN_OUT: string; static SINE_EASE_IN_OUT: string; static EXPO_EASE_IN_OUT: string; static CIRC_EASE_IN_OUT: string; static BACK_EASE_IN_OUT: string; private static CB; } } interface Window { CustomEvent: Object; } /** * @namespace fabric */ declare namespace fabric { /** * Breadcrumb component * * Shows the user"s current location in a hierarchy and provides a means of navigating upward. * */ class Breadcrumb { private static MEDIUM; container: HTMLElement; private _breadcrumb; private _listItems; private _contextMenu; private _overflowButton; private _overflowMenu; private _breadcrumbList; private _currentMaxItems; private _itemCollection; private _tabIndex; /** * * @param {HTMLElement} container - the target container for an instance of Breadcrumb * @constructor * * If dynamically populating a list run the constructor after the list has been populated * in the DOM. */ constructor(container: HTMLElement); /** * removes focus outlines so they don"t linger after click */ removeOutlinesOnClick(): void; /** * Adds a breadcrumb item to a breadcrumb * @param itemLabel {String} the item's text label * @param itemLink {String} the item's href link */ addItem(itemLabel: string, itemLink: string): void; /** * Removes a breadcrumb item by item label in the breadcrumbs list * @param itemLabel {String} the item's text label */ removeItemByLabel(itemLabel: string): void; /** * removes a breadcrumb item by position in the breadcrumb's list * index starts at 0 * @param value {number} the item's index */ removeItemByPosition(value: number): void; /** * initializes component */ init(): void; /** * create internal model of list items from DOM */ private _createItemCollection(); /** * Re-render lists on resize * */ private _onResize(); /** * render breadcrumbs and overflow menus */ private _renderList(); /** * updates the breadcrumbs and overflow menu */ private _updateBreadcrumbs(); /** * creates the overflow menu */ private _addItemsToOverflow(maxItems); /** * creates the breadcrumbs */ private _addBreadcrumbItems(maxItems); /** * resets a list by removing its children */ private _resetList(list); /** * opens the overflow menu */ private _openOverflow(event); private _overflowKeyPress(event); /** * closes the overflow menu */ private _closeOverflow(event); /** * caches elements and values of the component */ private _cacheDOM(); /** * sets handlers for resize and button click events */ private _setListeners(); } } /** * Button * * Mostly just a click handler * */ declare namespace fabric { class Button { private _container; private _clickHandler; constructor(container: Element, clickHandler?: EventListener); disposeEvents(): void; private _setClick(); } } interface IButton { container?: Element; label?: string; icon?: string; modifier?: string; tag?: string; } /** * ContextualHost * * Hosts contextual menus and callouts * NOTE: Position bottom only works if html is set to max-height 100%, overflow hidden * and body is set to overflow scroll, body is set to height 100% * */ /** * @namespace fabric */ declare namespace fabric { class ContextualHost { static hosts: Array; private _contextualHost; private _modalWidth; private _modalHeight; private _teWidth; private _teHeight; private _direction; private _container; private _disposalCallback; private _targetElement; private _matchTargetWidth; private _contextualHostMain; private _children; private _hasArrow; private _arrow; constructor(content: HTMLElement, direction: string, targetElement: Element, hasArrow?: boolean, modifiers?: Array, matchTargetWidth?: boolean, disposalCallback?: Function); disposeModal(): void; setChildren(value: ContextualHost): void; contains(value: HTMLElement): boolean; private createContainer(); private _openModal(); private _findAvailablePosition(); private _showModal(); private _positionOk(pos1, pos2, pos3?, pos4?); private _calcLeft(mWidth, teWidth, teLeft); private _calcTop(mHeight, teHeight, teTop); private _setPosition(curDirection?); private _tryPosModalLeft(); private _tryPosModalRight(); private _tryPosModalBottom(); private _tryPosModalTop(); private _copyModalToBody(); private _saveModalSize(); private _dismissAction(e); private _setDismissClick(); private _handleKeyUpDismiss(e); private _resizeAction(); private _setResizeDisposal(); } } /// /// /// /** * Callout * * Add callouts to things and stuff * */ declare const STATE_HIDDEN: string; declare const CLOSE_BUTTON_CLASS: string; declare const MODIFIER_OOBE_CLASS: string; declare namespace fabric { class Callout { private _container; private _addTarget; private _closeButton; private _position; private _contextualHost; constructor(container: Element, addTarget: Element, position: string); private _setOpener(); private _openContextMenu(); private _hasModifier(modifierClass); private _closeHandler(e); private _clickHandler(e); private _keyupHandler(event); } } declare namespace fabric { /** * CheckBox Plugin * * Adds basic demonstration functionality to .ms-CheckBox components. * */ class CheckBox { protected _choiceField: HTMLElement; protected _choiceInput: HTMLInputElement; private _container; /** * * @param {HTMLElement} container - the target container for an instance of CheckBox * @constructor */ constructor(container: HTMLElement); getValue(): boolean; toggle(): void; check(): void; unCheck(): void; removeListeners(): void; protected _addListeners(events?: any): void; private _FocusHandler(); private _BlurHandler(); private _ClickHandler(event); private _KeydownHandler(event); } } /// declare namespace fabric { /** * RadioButton Plugin * * Adds basic demonstration functionality to .ms-RadioButton components. * */ class RadioButton { protected _choiceField: HTMLElement; protected _choiceInput: HTMLInputElement; private _container; /** * * @param {HTMLElement} container - the target container for an instance of RadioButton * @constructor */ constructor(container: HTMLElement); getValue(): boolean; toggle(): void; check(): void; unCheck(): void; removeListeners(): void; protected _addListeners(): void; private _RadioClickHandler(event); private _dispatchSelectEvent(); private _RadioKeydownHandler(event); private _FocusHandler(); private _BlurHandler(); } } /// declare namespace fabric { /** * ChoiceFieldGroup Plugin * * Adds basic demonstration functionality to .ms-ChoiceFieldGroup components. * */ class ChoiceFieldGroup { private _choiceFieldGroup; private _choiceFieldComponents; /** * * @param {HTMLElement} container - the target container for an instance of ChoiceFieldGroup * @constructor */ constructor(container: HTMLElement); removeListeners(): void; private _initalSetup(); private _addListeners(); private _ChoiceFieldHandler(event); } } /** * SearchBox component * * Allows you to search the world. * */ /** * @namespace fabric */ declare namespace fabric { class SearchBox { private _searchBoxField; private _searchBox; private _searchBoxClearButton; private _searchBoxExitButton; private _container; private _boundExpandSearchHandler; private _boundEnableClose; private _boundCollapseSearchBox; private _boundClearSearchBox; private _boundHandleBlur; private _boundExitSearchBox; private _clearOnly; constructor(container: HTMLElement); setCollapsedListeners(): void; getInputField(): Element; private _saveDOMRefs(context); private _disposeListeners(); private _exitSearchBox(event); private _collapseSearchBox(); private _expandSearchHandler(); private _enableClose(); private _setHasText(); private _setFocusAction(context); private _clearSearchBox(event?); private _setClearButtonAction(); private _handleBlur(event); private _setBlurAction(); private _checkState(); private _addAnimation(); } } /// /** * CommandButton * * Buttons used primarily in the command bar * */ /** * @namespace fabric */ declare namespace fabric { class CommandButton { private _command; private _commandButton; private _splitButton; private _modalHostView; private _container; private _contextualMenu; constructor(container: HTMLElement, contextMenu?: HTMLElement); private _createModalHostView(); private _setClick(); private _checkForMenu(); } } /// /// /// /** * CommandBar * * Commanding and navigational surface * */ declare namespace fabric { class CommandBar { private responsiveSizes; private visibleCommands; private commandWidths; private overflowCommands; private itemCollection; private _sideAreaCollection; private contextualItemContainerRef; private contextualItemLink; private contextualItemIcon; private breakpoint; private _elements; private activeCommand; private searchBoxInstance; private _container; private _commandButtonInstance; constructor(container: Element); private _runsSearchBox(state?); private _runOverflow(); private _initOverflow(); private _hasClass(element, cls); private _onSearchExpand(); private _onSearchCollapse(); private _getScreenSize(); private _setBreakpoint(); private _createSearchInstance(); private _changeSearchState(state, action); private _setElements(); private _createItemCollection(iCollection, areaClass); private _createContextualRef(); private _getElementWidth(element); private _saveCommandWidths(); private _updateCommands(); private _drawCommands(); private _setWindowEvent(); private _processCollapsedClasses(type); private _setUIState(); private _checkOverflow(); private _redrawMenu(); private _drawOverflowMenu(left); private _doResize(); } } /// /// declare namespace fabric { class ContextualMenu { private _container; private _hostTarget; private _position; private _host; private _isOpen; constructor(container: Element, hostTarget: Element, position?: string); getHost(): ContextualHost; private _init(); private _onDocumentClick(event); private _onContextualMenuClick(event); private _multiSelect(target); private _singleSelect(target); private _toggleMenu(event); private _setOpener(hostTarget); private _openContextMenu(event); private _checkForSubmenus(container); private _createModalHostView(container, position, hostTarget); } } export interface IContextualMenuItem { title: string; state: string; } export interface IContextualMenu { items: Array; state?: string; } /// /// declare namespace fabric { /** * DatePicker Plugin */ class DatePicker { private picker; constructor(container: any, options: any); /** * After the Pickadate plugin starts, this function * adds additional controls to the picker view. */ initCustomView($datePicker: any): void; /** Change the highlighted date. */ changeHighlightedDate(dateArr: any): void; /** Whenever the picker renders, do our own rendering on the custom controls. */ updateCustomView($datePicker: any): void; private setDateAttributes(dateArr); } } declare namespace fabric { class Overlay { overlayElement: HTMLElement; constructor(overlayElement?: HTMLElement); remove(): void; show(): void; hide(): void; } } /// declare namespace fabric { class Dialog { private _dialog; private _overlay; private _closeButtonElement; private _actionButtonElements; constructor(dialog: HTMLElement); close(): void; open(): void; } } declare namespace fabric { /** * DialogHost class */ class DialogHost { } } /// declare namespace fabric { class PanelHost { panelHost: Element; overlay: Overlay; private _layer; private _callBack; private _overlayContainer; /** * * @param {HTMLElement} container - the target container for an instance of Panel * @constructor */ constructor(layer: Node, callBack?: Function); dismiss(): void; update(layer: Node, callBack?: Function): void; private _renderElements(); private _createElements(); } } /// declare namespace fabric { class Panel { panelHost: PanelHost; private _panel; private _direction; private _animateOverlay; private _closeButton; private _clickHandler; /** * * @param {HTMLElement} container - the target container for an instance of Panel * @constructor */ constructor(panel: Element, direction?: string, animateOverlay?: boolean); dismiss(callBack?: Function): void; private _setEvents(); private _animateInPanel(layer); } } /// declare namespace fabric { /** * Dropdown Plugin * * Given .ms-Dropdown containers with generic