Skip to content

Commit

Permalink
WIP: Add types.ts for public exports
Browse files Browse the repository at this point in the history
  • Loading branch information
acdvorak committed Feb 13, 2019
1 parent 6b6f7fb commit 78e0b7f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 33 deletions.
35 changes: 2 additions & 33 deletions packages/mdc-auto-init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,7 @@

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

export type MDCAutoInitKey = (
'MDCCheckbox' |
'MDCChip' |
'MDCChipSet' |
'MDCDialog' |
'MDCDrawer' |
'MDCFloatingLabel' |
'MDCFormField' |
'MDCGridList' |
'MDCIconButtonToggle' |
'MDCIconToggle' |
'MDCLineRipple' |
'MDCLinearProgress' |
'MDCList' |
'MDCMenu' |
'MDCMenuSurface' |
'MDCNotchedOutline' |
'MDCRadio' |
'MDCRipple' |
'MDCSelect' |
'MDCSlider' |
'MDCSnackbar' |
'MDCSwitch' |
'MDCTabBar' |
'MDCTextField' |
'MDCToolbar' |
'MDCTopAppBar'
);

export type MDCAutoInitElement = HTMLElement & {
[K in MDCAutoInitKey]?: string;
};
import {MDCAutoInitElement, MDCAutoInitKey} from './types';

interface ComponentClass {
// tslint:disable-next-line:no-any a component can pass in anything it needs to the constructor
Expand Down Expand Up @@ -152,3 +120,4 @@ mdcAutoInit.deregisterAll = function() {
};

export {mdcAutoInit as default, mdcAutoInit};
export * from './types';
55 changes: 55 additions & 0 deletions packages/mdc-auto-init/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* @license
* 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
* 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.
*/

export type MDCAutoInitKey = (
'MDCCheckbox' |
'MDCChip' |
'MDCChipSet' |
'MDCDialog' |
'MDCDrawer' |
'MDCFloatingLabel' |
'MDCFormField' |
'MDCGridList' |
'MDCIconButtonToggle' |
'MDCIconToggle' |
'MDCLineRipple' |
'MDCLinearProgress' |
'MDCList' |
'MDCMenu' |
'MDCMenuSurface' |
'MDCNotchedOutline' |
'MDCRadio' |
'MDCRipple' |
'MDCSelect' |
'MDCSlider' |
'MDCSnackbar' |
'MDCSwitch' |
'MDCTabBar' |
'MDCTextField' |
'MDCToolbar' |
'MDCTopAppBar'
);

export type MDCAutoInitElement = HTMLElement & {
[K in MDCAutoInitKey]?: string;
};

0 comments on commit 78e0b7f

Please sign in to comment.