Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

feat: Convert packages to TypeScript #4451

Merged
merged 74 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
8bcf546
feat(infrastructure): add tsconfig, tslint, and build setup (#4241)
Jan 18, 2019
1600b54
docs: Update closure-compiler.md to reflect TypeScript conversion (#4…
kfranqueiro Jan 18, 2019
66c8d81
feat(dom): Convert JS to TypeScript (#4269)
acdvorak Jan 19, 2019
87a5e8e
feat(animation): Convert JS to TypeScript (#4271)
acdvorak Jan 23, 2019
8addf4d
Merge remote-tracking branch 'origin' into feat/typescript
acdvorak Jan 23, 2019
6b958de
feat(linear-progress): Convert JS to TypeScript (#4272)
acdvorak Jan 23, 2019
c649de5
fix: add strict true to tsconfig (#4286)
Jan 24, 2019
47a9c38
feat(ripple): convert to ts (#4300)
Jan 29, 2019
54d25c1
Merge remote-tracking branch 'origin/master' into feat/typescript
Jan 31, 2019
aeb3f87
feat(form-field): ts convert (#4327)
Jan 31, 2019
8abbb53
Merge remote-tracking branch 'origin/master' into feat/typescript
acdvorak Jan 31, 2019
13d169d
feat(switch): Convert JS to TypeScript (#4320)
mmalerba Jan 31, 2019
869e44c
refactor(animation): Replace enums with string literal type aliases (…
acdvorak Jan 31, 2019
a2ac8bc
feat(menu-surface): Convert JS to TypeScript (#4273)
acdvorak Feb 5, 2019
0f8a271
Merge remote-tracking branch 'origin/master' into feat/typescript
acdvorak Feb 5, 2019
2befa88
feat(checkbox): typescript conversion (#4319)
Feb 5, 2019
90f5f05
feat(radio): ts conversion (#4329)
Feb 6, 2019
0f354ae
feat(base): Add generic type signatures to listen/unlisten/emit (#4358)
acdvorak Feb 6, 2019
f595a99
feat(icon-button): Convert to TypeScript (#4325)
abhiomkar Feb 6, 2019
0b28992
feat(list): ts conversion (#4334)
Feb 6, 2019
dc4e92c
feat(menu): Convert JS to TypeScript (#4342)
acdvorak Feb 6, 2019
33e26d7
feat(dialog): ts conversion (#4333)
Feb 7, 2019
3279cc9
style: Make TS import and export syntax consistent (#4360)
acdvorak Feb 7, 2019
1c7335b
feat(chips): ts conversion (#4332)
Feb 7, 2019
ed7f8d7
feat(grid-list): ts conversion (#4337)
Feb 7, 2019
d4250ca
docs: update best coding practices with typescript lessons learned (#…
Feb 7, 2019
9936f01
feat(ripple): updated ripple ts rewrite to remove extraneous code/typ…
Feb 7, 2019
77e8bab
Merge remote-tracking branch 'origin/master' into feat/typescript
acdvorak Feb 7, 2019
5407ada
feat(floating-label): Convert JS to TypeScript (#4374)
acdvorak Feb 8, 2019
50eb8c7
feat(line-ripple): Convert JS to TypeScript (#4373)
acdvorak Feb 8, 2019
197f7fe
feat(notched-outline): Convert JS to TypeScript (#4375)
acdvorak Feb 8, 2019
08fb283
feat(slider): Convert JS to TypeScript (#4378)
acdvorak Feb 8, 2019
e95ff8a
feat(snackbar): Convert JS to TypeScript (#4363)
acdvorak Feb 9, 2019
b859440
chore: Remove Object.assign from TS files (#4389)
acdvorak Feb 11, 2019
e8c947c
Merge branch 'master' into feat/typescript
acdvorak Feb 11, 2019
6fce645
Merge remote-tracking branch 'origin/master' into feat/typescript
acdvorak Feb 11, 2019
9526da2
Merge branch 'feat/typescript' of github.com:material-components/mate…
acdvorak Feb 11, 2019
667aeee
feat(tab-scroller): Convert JS to TypeScript (#4392)
acdvorak Feb 12, 2019
5f50d60
feat(tab-indicator): Convert JS to TypeScript (#4391)
acdvorak Feb 12, 2019
ab9879d
feat(tab): Convert JS to TypeScript (#4393)
acdvorak Feb 12, 2019
b2fa9a5
feat(tab-bar): Convert JS to TypeScript (#4394)
acdvorak Feb 12, 2019
976352c
feat(text-field): Convert JS to TypeScript (#4377)
acdvorak Feb 13, 2019
5052ada
feat(select): Convert JS to TypeScript (#4386)
acdvorak Feb 13, 2019
f8ba48f
feat(drawer): Convert JS to TypeScript (#4390)
acdvorak Feb 14, 2019
b8b1988
feat(top-app-bar): Convert JS to TypeScript (#4397)
acdvorak Feb 14, 2019
4675c95
feat(auto-init): Convert JS to TypeScript (#4395)
acdvorak Feb 14, 2019
6136db3
feat(toolbar): Convert JS to TypeScript (#4410)
acdvorak Feb 14, 2019
db6fc6d
Merge remote-tracking branch 'origin/master' into feat/typescript
acdvorak Feb 14, 2019
6d6bff8
WIP: Fix borked merge
acdvorak Feb 14, 2019
ebefb78
feat(package): Convert JS to TypeScript (#4396)
acdvorak Feb 14, 2019
ff5ad6a
chore: Fix broken TypeScript rewrite script (#4398)
acdvorak Feb 14, 2019
96afbb1
WIP: Remove `icon-toggle` from `npm run test:dependency`
acdvorak Feb 14, 2019
36ce7b9
WIP: Fix GitHub authentication issue for screenshot tests on Travis CI
acdvorak Feb 15, 2019
03b791d
fix(chips): Reference ripple/index in types for consistency (#4417)
kfranqueiro Feb 15, 2019
409a6a6
feat(tabs): Convert JS to TypeScript (#4412)
acdvorak Feb 15, 2019
1ec12b6
chore: remove icon-toggle (#4415)
Feb 15, 2019
72e8b66
refactor: Make TS easier to wrap (#4407)
acdvorak Feb 21, 2019
c487445
WIP: Add comment
acdvorak Feb 22, 2019
f441f8f
Merge remote-tracking branch 'origin/master' into feat/typescript
acdvorak Feb 22, 2019
cabeabc
chore(package): Remove need for selection-control (#4442)
kfranqueiro Feb 22, 2019
b6b6983
chore: Fix internal tslint errors (#4440)
acdvorak Feb 22, 2019
6faaabe
chore: Fix regression in `MDCChipFoundation.getDimensions()` (#4443)
acdvorak Feb 23, 2019
2bbcfea
WIP: Fix internal tslint error
acdvorak Feb 23, 2019
c6b609c
feat(infrastructure): add esmodules support for treeshaking (#4409)
Feb 26, 2019
ad96947
style: Add explanations to `tslint:disable` comments (#4448)
acdvorak Feb 26, 2019
21b2403
WIP: Update `.ts` file paths in READMEs
acdvorak Feb 26, 2019
c54310c
WIP: Export `MDCComponentClass` in `mdc-auto-init`
acdvorak Feb 26, 2019
cbb0fe6
WIP: Change `any` to `unknown` and remove `tslint:disable` comment
acdvorak Feb 26, 2019
f3a09a1
Merge remote-tracking branch 'origin/master' into feat/typescript
acdvorak Feb 26, 2019
216d975
WIP: Revert changes to logging
acdvorak Feb 20, 2019
d349fea
style: grammar mistakes on script comments (#4452)
Feb 26, 2019
8cd8b26
WIP autoinit: MDCComponentClass -> MDCAttachable
Feb 27, 2019
60c9498
WIP Remove object-assign polyfill
Feb 27, 2019
2abfb30
WIP Revert "WIP Remove object-assign polyfill"
Feb 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Make TS easier to wrap (#4407)
### Goal

Make it easier for frameworks to wrap our TypeScript code.

Refs #4225

### How

**Isolate framework-specific code from framework-agnostic code.**

Specifically, this PR:

* Maintains full backward compatibility with existing code
* Moves all component definitions from `index.ts` to `component.ts`
    - `index.ts` is now purely re-exporting other files
* Moves component-dependent types from `types.ts` to `component.ts`
    - Framework-related types are now quarantined in a single file: `component.ts`
    - All other files are now purely framework-agnostic, and can be safely wrapped by frameworks that don't use our components
* Makes `import` paths more specific by switching from `@material/foo/index` to e.g. `@material/foo/foundation` or `@material/foo/types`
    - The only exception is `component.ts` files: Since they're basically our default "framework", they can safely import _other_ "framework" types via `@material/foo/index`
* Updates class & interface export syntax to isolate the `default` export line for future removal if necessary:
    ```ts
    export class MDCFooFoundation {
      // ...
    }
    export default MDCFooFoundation;
    ```
* Combines `typings/custom.d.ts` and `typings/dom.ie.d.ts` into `packages/mdc-dom/externs.d.ts` so the types will be publicly visible
* Adds `MDCFooFactory` types for components that need them (e.g., `MDCRipple`, `MDCList`)

### Packages

* [x] `animation`
* [x] `checkbox`
* [x] `chips`
* [x] `dialog`
* [x] `dom`
* [x] `drawer`
* [x] `floating-label`
* [x] `form-field`
* [x] `grid-list`
* [x] `icon-button`
* [x] `icon-toggle` _(deprecated)_
* [x] `line-ripple`
* [x] `linear-progress`
* [x] `list`
* [x] `menu`
* [x] `menu-surface`
* [x] `notched-outline`
* [x] `radio`
* [x] `ripple`
* [x] `select`
* [x] `selection-control`
* [x] `slider`
* [x] `snackbar`
* [x] `switch`
* [x] `tab`
* [x] `tab-bar`
* [x] `tab-indicator`
* [x] `tab-scroller`
* [x] `tab-tabs` _(deprecated)_
* [x] `textfield`
* [x] `toolbar` _(deprecated)_
* [x] `top-app-bar`
  • Loading branch information
acdvorak authored Feb 21, 2019
commit 72e8b66b4d2102b200aa6025a6402bdb5f31845f
29 changes: 19 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
node_modules
# macOS filesystem
.DS_Store
/build
/coverage
packages/*/dist
out

# Editors and IDEs
.idea/
.vscode/

# Generated files
*.log
.idea
*.sw*
.closure-tmp
.site-generator-tmp
.typescript-tmp
.vscode
node_modules/

# Build output
/build/
/coverage/
packages/*/dist

# Material.io site generator test (`npm run test:site`)
.site-generator-tmp/

# Used by internal sync & rewrite scripts
.rewrite-tmp/
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build:demos": "npm run clean && mkdirp build && webpack --config=demos/webpack.config.js --progress --colors",
"build:min": "mkdirp build && cross-env MDC_ENV=production webpack -p --progress --colors",
"changelog": "standard-changelog -i CHANGELOG.md -k packages/material-components-web/package.json",
"clean": "del-cli build/** build .typescript-tmp/** .typescript-tmp",
"clean": "del-cli build/** build .rewrite-tmp/** .rewrite-tmp",
"clean:site": "del-cli .site-generator-tmp/** .site-generator-tmp",
"dist": "npm run build && npm run build:min",
"dev": "npm run clean && cross-env MDC_ENV=development webpack-dev-server --config=demos/webpack.config.js --progress --inline --hot --host 0.0.0.0",
Expand All @@ -16,7 +16,7 @@
"fix:css": "stylelint --fix \"packages/**/*.scss\"; stylelint --fix --config=test/screenshot/.stylelintrc.yaml \"test/screenshot/**/*.scss\"",
"fix": "npm-run-all --parallel fix:*",
"lint:css": "stylelint \"packages/**/*.scss\" && stylelint --config=test/screenshot/.stylelintrc.yaml \"test/screenshot/**/*.scss\"",
"lint:js": "eslint packages test scripts webpack.config.js demos/webpack.config.js karma.conf.js",
"lint:js": "eslint test scripts webpack.config.js demos/webpack.config.js karma.conf.js",
"lint:ts": "tslint --exclude \"test/**/*.d.ts\" \"packages/**/*.ts\" \"test/**/*.ts\" \"scripts/**/*.ts\"",
"lint:html": "find test/screenshot/spec/ -name '*.html' | grep -v 'index.html$' | xargs htmllint",
"lint:imports": "node scripts/check-imports.js",
Expand Down
104 changes: 5 additions & 99 deletions packages/mdc-animation/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright 2016 Google Inc.
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,102 +21,8 @@
* THE SOFTWARE.
*/

type StandardCssPropertyName = (
'animation' | 'transform' | 'transition'
);
type PrefixedCssPropertyName = (
'-webkit-animation' | '-webkit-transform' | '-webkit-transition'
);
type StandardJsEventType = (
'animationend' | 'animationiteration' | 'animationstart' | 'transitionend'
);
type PrefixedJsEventType = (
'webkitAnimationEnd' | 'webkitAnimationIteration' | 'webkitAnimationStart' | 'webkitTransitionEnd'
);
import * as util from './util';

type CssVendorPropertyMap = { [K in StandardCssPropertyName]: CssVendorProperty };
type JsVendorPropertyMap = { [K in StandardJsEventType]: JsVendorProperty };

interface CssVendorProperty {
prefixed: PrefixedCssPropertyName;
standard: StandardCssPropertyName;
}

interface JsVendorProperty {
cssProperty: StandardCssPropertyName;
prefixed: PrefixedJsEventType;
standard: StandardJsEventType;
}

const cssPropertyNameMap: CssVendorPropertyMap = {
animation: {
prefixed: '-webkit-animation',
standard: 'animation',
},
transform: {
prefixed: '-webkit-transform',
standard: 'transform',
},
transition: {
prefixed: '-webkit-transition',
standard: 'transition',
},
};

const jsEventTypeMap: JsVendorPropertyMap = {
animationend: {
cssProperty: 'animation',
prefixed: 'webkitAnimationEnd',
standard: 'animationend',
},
animationiteration: {
cssProperty: 'animation',
prefixed: 'webkitAnimationIteration',
standard: 'animationiteration',
},
animationstart: {
cssProperty: 'animation',
prefixed: 'webkitAnimationStart',
standard: 'animationstart',
},
transitionend: {
cssProperty: 'transition',
prefixed: 'webkitTransitionEnd',
standard: 'transitionend',
},
};

function isWindow(windowObj: Window): boolean {
return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';
}

function getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName):
StandardCssPropertyName | PrefixedCssPropertyName {
if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
const el = windowObj.document.createElement('div');
const {standard, prefixed} = cssPropertyNameMap[cssProperty];
const isStandard = standard in el.style;
return isStandard ? standard : prefixed;
}
return cssProperty;
}

function getCorrectEventName(windowObj: Window, eventType: StandardJsEventType):
StandardJsEventType | PrefixedJsEventType {
if (isWindow(windowObj) && eventType in jsEventTypeMap) {
const el = windowObj.document.createElement('div');
const {standard, prefixed, cssProperty} = jsEventTypeMap[eventType];
const isStandard = cssProperty in el.style;
return isStandard ? standard : prefixed;
}
return eventType;
}

export {
PrefixedCssPropertyName,
StandardCssPropertyName,
PrefixedJsEventType,
StandardJsEventType,
getCorrectEventName,
getCorrectPropertyName,
};
export {util}; // New namespace
export * from './types';
export * from './util'; // Old namespace for backward compatibility
30 changes: 23 additions & 7 deletions packages/mdc-drawer/types.ts → packages/mdc-animation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,28 @@
* THE SOFTWARE.
*/

import {MDCList} from '@material/list/index';
import * as FocusTrapLib from 'focus-trap';
export type StandardCssPropertyName =
'animation' | 'transform' | 'transition';

export type FocusTrapFactory = (
element: HTMLElement | string,
userOptions?: FocusTrapLib.Options,
) => FocusTrapLib.FocusTrap;
export type PrefixedCssPropertyName =
'-webkit-animation' | '-webkit-transform' | '-webkit-transition';

export type ListFactory = (el: Element) => MDCList;
export type StandardJsEventType =
'animationend' | 'animationiteration' | 'animationstart' | 'transitionend';

export type PrefixedJsEventType =
'webkitAnimationEnd' | 'webkitAnimationIteration' | 'webkitAnimationStart' | 'webkitTransitionEnd';

export interface CssVendorProperty {
prefixed: PrefixedCssPropertyName;
standard: StandardCssPropertyName;
}

export interface JsVendorProperty {
cssProperty: StandardCssPropertyName;
prefixed: PrefixedJsEventType;
standard: StandardJsEventType;
}

export type CssVendorPropertyMap = { [K in StandardCssPropertyName]: CssVendorProperty };
export type JsVendorPropertyMap = { [K in StandardJsEventType]: JsVendorProperty };
92 changes: 92 additions & 0 deletions packages/mdc-animation/util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/**
* @license
* Copyright 2016 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

import {
CssVendorPropertyMap, JsVendorPropertyMap,
PrefixedCssPropertyName, PrefixedJsEventType,
StandardCssPropertyName, StandardJsEventType,
} from './types';

const cssPropertyNameMap: CssVendorPropertyMap = {
animation: {
prefixed: '-webkit-animation',
standard: 'animation',
},
transform: {
prefixed: '-webkit-transform',
standard: 'transform',
},
transition: {
prefixed: '-webkit-transition',
standard: 'transition',
},
};

const jsEventTypeMap: JsVendorPropertyMap = {
animationend: {
cssProperty: 'animation',
prefixed: 'webkitAnimationEnd',
standard: 'animationend',
},
animationiteration: {
cssProperty: 'animation',
prefixed: 'webkitAnimationIteration',
standard: 'animationiteration',
},
animationstart: {
cssProperty: 'animation',
prefixed: 'webkitAnimationStart',
standard: 'animationstart',
},
transitionend: {
cssProperty: 'transition',
prefixed: 'webkitTransitionEnd',
standard: 'transitionend',
},
};

function isWindow(windowObj: Window): boolean {
return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';
}

export function getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName):
StandardCssPropertyName | PrefixedCssPropertyName {
if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
const el = windowObj.document.createElement('div');
const {standard, prefixed} = cssPropertyNameMap[cssProperty];
const isStandard = standard in el.style;
return isStandard ? standard : prefixed;
}
return cssProperty;
}

export function getCorrectEventName(windowObj: Window, eventType: StandardJsEventType):
StandardJsEventType | PrefixedJsEventType {
if (isWindow(windowObj) && eventType in jsEventTypeMap) {
const el = windowObj.document.createElement('div');
const {standard, prefixed, cssProperty} = jsEventTypeMap[eventType];
const isStandard = cssProperty in el.style;
return isStandard ? standard : prefixed;
}
return eventType;
}
11 changes: 7 additions & 4 deletions packages/mdc-auto-init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@

// tslint:disable:only-arrow-functions

import {MDCComponent, MDCFoundation} from '@material/base/index';
import {MDCComponent} from '@material/base/component';
import {MDCFoundation} from '@material/base/foundation';

interface ComponentClass {
kfranqueiro marked this conversation as resolved.
Show resolved Hide resolved
// tslint:disable-next-line:no-any a component can pass in anything it needs to the constructor
new<F extends MDCFoundation>(root: Element, foundation?: F, ...args: any[]): MDCComponent<F>;

attachTo<F extends MDCFoundation>(root: Element): MDCComponent<F>;
}

Expand Down Expand Up @@ -58,6 +60,7 @@ function _emit<T extends object>(evtType: string, evtData: T, shouldBubble = fal
/**
* Auto-initializes all MDC components on a page.
*/

export function mdcAutoInit(root = document, warn = CONSOLE_WARN) {
const components = [];
const nodes: Element[] = [].slice.call(root.querySelectorAll('[data-mdc-auto-init]'));
Expand All @@ -71,7 +74,7 @@ export function mdcAutoInit(root = document, warn = CONSOLE_WARN) {
const Constructor = registry[ctorName]; // tslint:disable-line:variable-name
if (typeof Constructor !== 'function') {
throw new Error(
`(mdc-auto-init) Could not find constructor in registry for ${ctorName}`);
`(mdc-auto-init) Could not find constructor in registry for ${ctorName}`);
}

if (Object.getOwnPropertyDescriptor(node, ctorName)) {
Expand Down Expand Up @@ -103,8 +106,8 @@ mdcAutoInit.register = function(componentName: string, Constructor: ComponentCla
}
if (registry[componentName]) {
warn(
`(mdc-auto-init) Overriding registration for ${componentName} with ${Constructor}. ` +
`Was: ${registry[componentName]}`);
`(mdc-auto-init) Overriding registration for ${componentName} with ${Constructor}. ` +
`Was: ${registry[componentName]}`);
}
registry[componentName] = Constructor;
};
Expand Down
14 changes: 7 additions & 7 deletions packages/mdc-base/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import {MDCFoundation} from './foundation';
import {CustomEventListener, EventType, SpecificEventListener} from './types';

class MDCComponent<FoundationType extends MDCFoundation> {
export class MDCComponent<FoundationType extends MDCFoundation> {
static attachTo(root: Element): MDCComponent<MDCFoundation<{}>> {
// Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
// returns an instantiated component with its root set to that element. Also note that in the cases of
Expand All @@ -37,10 +37,10 @@ class MDCComponent<FoundationType extends MDCFoundation> {
protected foundation_: FoundationType;

constructor(
root: Element,
foundation?: FoundationType,
// tslint:disable-next-line:no-any a component can pass in anything it needs to the constructor
...args: any[]
root: Element,
foundation?: FoundationType,
// tslint:disable-next-line:no-any a component can pass in anything it needs to the constructor
...args: any[]
) {
this.root_ = root;
this.initialize(...args);
Expand All @@ -63,7 +63,7 @@ class MDCComponent<FoundationType extends MDCFoundation> {
// Subclasses must override this method to return a properly configured foundation class for the
// component.
throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' +
'foundation class');
'foundation class');
}

initialSyncWithDOM() {
Expand Down Expand Up @@ -118,4 +118,4 @@ class MDCComponent<FoundationType extends MDCFoundation> {
}
}

export {MDCComponent as default, MDCComponent};
export default MDCComponent;
4 changes: 4 additions & 0 deletions typings/dom.ie.d.ts → packages/mdc-base/externs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@
declare interface Element {
msMatchesSelector?: (selector: string) => boolean;
}

declare interface Window {
CSS: CSS;
}
Loading