Skip to content

Commit

Permalink
Merge pull request #5357 from a-xin/improve-legacy-typings
Browse files Browse the repository at this point in the history
Improve typings for legacy elements
  • Loading branch information
aomarks authored Sep 15, 2018
2 parents b39a091 + 239e99a commit 4f11628
Showing 1 changed file with 18 additions and 1 deletion.
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

0 comments on commit 4f11628

Please sign in to comment.