mirror of
https://github.com/material-components/material-web.git
synced 2024-10-27 06:04:44 +03:00
Merge pull request #306 from material-components/7E1FDE825C66D4C8576C11688CA33F11
Fix some type annotations
This commit is contained in:
commit
5ef4a25707
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,4 @@ declare global {
|
||||
@customElement('mwc-tab-bar' as any)
|
||||
export class TabBar extends TabBarBase {
|
||||
static styles = style;
|
||||
}
|
||||
}
|
||||
|
@ -164,4 +164,4 @@ export class TabBase extends BaseElement {
|
||||
this.mdcRoot.focus();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,4 @@ declare global {
|
||||
@customElement('mwc-tab' as any)
|
||||
export class Tab extends TabBase {
|
||||
static styles = style;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user