Merge pull request #306 from material-components/7E1FDE825C66D4C8576C11688CA33F11

Fix some type annotations
This commit is contained in:
Alexander Marks 2019-07-22 10:47:47 -07:00 committed by GitHub
commit 5ef4a25707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 9 deletions

View File

@ -25,8 +25,8 @@ import 'blocking-elements/blocking-elements.js';
declare global {
interface Document {
$blockingElements: {
push(HTMLElement): void;
remove(HTMLElement): Boolean;
push(element: HTMLElement): void;
remove(element: HTMLElement): Boolean;
}
}
@ -146,4 +146,4 @@ export class DrawerBase extends BaseElement {
this.createFoundation();
}
}
}
}

View File

@ -85,7 +85,17 @@ export class LinearProgressBase extends BaseElement {
...addHasRemoveClass(this.mdcRoot),
getPrimaryBar: () => this.primaryBar,
getBuffer: () => this.bufferElement,
setStyle: (el: HTMLElement, property: string, value: string) => el.style[property] = value,
setStyle: (el: HTMLElement, property: string, value: string) =>
el.style
// TODO(aomarks) Consider moving this type to the
// MDCLinearProgressAdapter parameter type, but note that the
// "-webkit" prefixed CSS properties are not declared in
// CSSStyleDeclaration.
//
// Exclude read-only properties.
[property as
Exclude<keyof CSSStyleDeclaration, 'length'|'parentRule'>] =
value,
};
}

View File

@ -78,7 +78,7 @@ export class TabBarBase extends BaseElement {
return this.tabsSlot.assignedNodes({flatten: true}).filter((e: Node) => e instanceof Tab) as Tab[];
}
private _getTab(index) {
private _getTab(index: number) {
return this._getTabs()[index];
}
@ -169,4 +169,4 @@ export class TabBarBase extends BaseElement {
this.mdcFoundation.scrollIntoView(index);
}
}
}

View File

@ -27,4 +27,4 @@ declare global {
@customElement('mwc-tab-bar' as any)
export class TabBar extends TabBarBase {
static styles = style;
}
}

View File

@ -164,4 +164,4 @@ export class TabBase extends BaseElement {
this.mdcRoot.focus();
}
}
}

View File

@ -28,4 +28,4 @@ declare global {
@customElement('mwc-tab' as any)
export class Tab extends TabBase {
static styles = style;
}
}