Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typings for legacy elements #5357

Merged
merged 3 commits into from
Sep 15, 2018
Merged
Changes from all commits
Commits
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
19 changes: 18 additions & 1 deletion interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,28 @@ export interface PolymerInit {
extends?: string;
properties?: PolymerElementProperties;
observers?: string[];
template?: HTMLTemplateElement|string;
_template?: HTMLTemplateElement;
hostAttributes?: {[key: string]: any};
listeners?: {[key: string]: string};
behaviors?: BehaviorInit | BehaviorInit[];

// Lifecycle methods
registered?(): void;
created?(): void;
attached?(): void;
detached?(): void;
ready?(): void;
attributeChanged?(name: string, old?: string, value?: string): void;

// Allow any other user-defined properties
[others: string]: any;
}

export type BehaviorInit = Pick<
PolymerInit,
Exclude<keyof PolymerInit, "is" | "extends" | "_template">
>;

// Types from "externs/polymer-internal-shared-types.js"

export interface StampedTemplate extends DocumentFragment {
Expand Down