mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
merging material-components
This commit is contained in:
+75
@@ -0,0 +1,75 @@
|
||||
// Type definitions for Material Components Web 0.43
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>, Collin Kostichuk <https://github.com/ckosti>, Arthur Groupp <https://github.com/agroupp>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import autoInit from 'material__auto-init';
|
||||
import * as base from 'material__base';
|
||||
import * as checkbox from 'material__checkbox';
|
||||
import * as chips from 'material__chips';
|
||||
import * as dialog from 'material__dialog';
|
||||
import * as dom from 'material__dom';
|
||||
import * as drawer from 'material__drawer';
|
||||
import * as floatingLabel from 'material__floating-label';
|
||||
import * as formField from 'material__form-field';
|
||||
import * as gridList from 'material__grid-list';
|
||||
import * as iconToggle from 'material__icon-toggle';
|
||||
import * as linearProgress from 'material__linear-progress';
|
||||
import * as lineRipple from 'material__line-ripple';
|
||||
import * as list from 'material__list';
|
||||
import * as menu from 'material__menu';
|
||||
import * as notchedOutline from 'material__notched-outline';
|
||||
import * as radio from 'material__radio';
|
||||
import * as ripple from 'material__ripple';
|
||||
import * as select from 'material__select';
|
||||
import * as selectionControl from 'material__selection-control';
|
||||
import * as slider from 'material__slider';
|
||||
import * as snackbar from 'material__snackbar';
|
||||
import * as tabs from 'material__tabs';
|
||||
import * as textField from 'material__textfield';
|
||||
import * as toolbar from 'material__toolbar';
|
||||
import * as topAppBar from 'material__top-app-bar';
|
||||
// Export all components.
|
||||
export {
|
||||
autoInit,
|
||||
base,
|
||||
checkbox,
|
||||
chips,
|
||||
dialog,
|
||||
drawer,
|
||||
floatingLabel,
|
||||
formField,
|
||||
gridList,
|
||||
iconToggle,
|
||||
lineRipple,
|
||||
linearProgress,
|
||||
menu,
|
||||
notchedOutline,
|
||||
radio,
|
||||
ripple,
|
||||
select,
|
||||
selectionControl,
|
||||
slider,
|
||||
snackbar,
|
||||
tabs,
|
||||
textField,
|
||||
toolbar,
|
||||
topAppBar
|
||||
};
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
// Type definitions for Material Components Web 0.43
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>, Collin Kostichuk <https://github.com/ckosti>, Arthur Groupp <https://github.com/agroupp>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
import { MDCDismissibleDrawerFoundation } from './dismissible/foundation';
|
||||
import { MDCModalDrawerFoundation } from './modal/foundation';
|
||||
import { MDCDrawerAdapter } from './adapter';
|
||||
import { MDCList, MDCListFoundation } from 'material__list/index';
|
||||
import { strings } from './constants';
|
||||
import * as util from './util';
|
||||
import createFocusTrap, { FocusTrap } from './focus-trap';
|
||||
|
||||
export class MDCDrawer extends MDCComponent<MDCDrawer, MDCDismissibleDrawerFoundation | MDCModalDrawerFoundation> {
|
||||
constructor(...args: any[]);
|
||||
static attachTo(root: Element): MDCDrawer;
|
||||
|
||||
/**
|
||||
* Returns true if drawer is in the open position.
|
||||
*/
|
||||
open: boolean;
|
||||
|
||||
initialize(focusTrapFactory: FocusTrap, listFactory: MDCList): void;
|
||||
|
||||
initialSyncWithDOM(): void;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
getDefaultFoundation(): MDCDismissibleDrawerFoundation | MDCModalDrawerFoundation;
|
||||
}
|
||||
|
||||
export { MDCDismissibleDrawerFoundation, MDCModalDrawerFoundation, util };
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-drawer--persistent';
|
||||
OPEN: 'mdc-drawer--open';
|
||||
ANIMATING: 'mdc-drawer--animating';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
DRAWER_SELECTOR: '.mdc-drawer--persistent .mdc-drawer__drawer';
|
||||
FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]';
|
||||
OPEN_EVENT: 'MDCPersistentDrawer:open';
|
||||
CLOSE_EVENT: 'MDCPersistentDrawer:close';
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MDCSlidableDrawerAdapter, MDCSlidableDrawerFoundation } from '../slidable';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export default class MDCPersistentDrawerFoundation extends MDCSlidableDrawerFoundation {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCSlidableDrawerAdapter;
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import MDCPersistentDrawerFoundation from './foundation';
|
||||
import { MDCSlidableDrawerAdapter } from '../slidable';
|
||||
import * as util from '../util';
|
||||
|
||||
export {MDCSlidableDrawerAdapter, MDCPersistentDrawerFoundation, util};
|
||||
|
||||
export class MDCPersistentDrawer extends MDCComponent<MDCSlidableDrawerAdapter, MDCPersistentDrawerFoundation> {
|
||||
static attachTo(root: Element): MDCPersistentDrawer;
|
||||
|
||||
open: boolean;
|
||||
|
||||
// Return the drawer element inside the component.
|
||||
readonly drawer: Element | null;
|
||||
}
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export interface MDCSlidableDrawerAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
hasClass(className: string): void;
|
||||
|
||||
hasNecessaryDom(): boolean;
|
||||
|
||||
registerInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
registerDrawerInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
deregisterDrawerInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
registerTransitionEndHandler(handler: EventListener): void;
|
||||
|
||||
deregisterTransitionEndHandler(handler: EventListener): void;
|
||||
|
||||
registerDocumentKeydownHandler(handler: EventListener): void;
|
||||
|
||||
deregisterDocumentKeydownHandler(handler: EventListener): void;
|
||||
|
||||
setTranslateX(value: number | null): void;
|
||||
|
||||
getFocusableElements(): NodeList;
|
||||
|
||||
saveElementTabState(el: Element): void;
|
||||
|
||||
restoreElementTabState(el: Element): void;
|
||||
|
||||
makeElementUntabbable(el: Element): void;
|
||||
|
||||
notifyOpen(): void;
|
||||
|
||||
notifyClose(): void;
|
||||
|
||||
isRtl(): boolean;
|
||||
|
||||
getDrawerWidth(): number;
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MDCFoundation } from 'material__base';
|
||||
import { MDCSlidableDrawerAdapter } from './adapter';
|
||||
|
||||
export class MDCSlidableDrawerFoundation extends MDCFoundation<MDCSlidableDrawerAdapter> {
|
||||
static readonly defaultAdapter: MDCSlidableDrawerAdapter;
|
||||
|
||||
constructor(adapter: MDCSlidableDrawerAdapter, rootCssClass: string, animatingCssClass: string, openCssClass: string);
|
||||
|
||||
open(): void;
|
||||
|
||||
close(): void;
|
||||
|
||||
isOpen(): boolean;
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { FOCUSABLE_ELEMENTS } from './constants';
|
||||
export { MDCSlidableDrawerFoundation } from './foundation';
|
||||
export { MDCSlidableDrawerAdapter } from './adapter';
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-drawer--temporary';
|
||||
OPEN: 'mdc-drawer--open';
|
||||
ANIMATING: 'mdc-drawer--animating';
|
||||
SCROLL_LOCK: 'mdc-drawer-scroll-lock';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
DRAWER_SELECTOR: '.mdc-drawer--temporary .mdc-drawer__drawer';
|
||||
OPACITY_VAR_NAME: '--mdc-temporary-drawer-opacity';
|
||||
FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]';
|
||||
OPEN_EVENT: 'MDCTemporaryDrawer:open';
|
||||
CLOSE_EVENT: 'MDCTemporaryDrawer:close';
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MDCSlidableDrawerFoundation, MDCSlidableDrawerAdapter } from '../slidable';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export default class MDCTemporaryDrawerFoundation extends MDCSlidableDrawerFoundation {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCSlidableDrawerAdapter;
|
||||
|
||||
open(): void;
|
||||
|
||||
close(): void;
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import MDCTemporaryDrawerFoundation from './foundation';
|
||||
import { MDCSlidableDrawerAdapter } from '../slidable';
|
||||
import * as util from '../util';
|
||||
|
||||
export {MDCSlidableDrawerAdapter, MDCTemporaryDrawerFoundation, util};
|
||||
|
||||
export class MDCTemporaryDrawer extends MDCComponent<MDCSlidableDrawerAdapter, MDCTemporaryDrawerFoundation> {
|
||||
static attachTo(root: Element): MDCTemporaryDrawer;
|
||||
|
||||
open: boolean;
|
||||
|
||||
/* Return the drawer element inside the component. */
|
||||
readonly drawer: Element | null;
|
||||
}
|
||||
+3
-1
@@ -14,4 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const FOCUSABLE_ELEMENTS: string;
|
||||
import { FocusTrap } from './focus-trap';
|
||||
|
||||
export function createFocusTrapInstance(surfaceEl: Element, focusTrapFactory: () => FocusTrap): FocusTrap;
|
||||
Reference in New Issue
Block a user