Skip to content

Commit

Permalink
Add specific type for behaviors
Browse files Browse the repository at this point in the history
  • Loading branch information
a-xin committed Sep 14, 2018
1 parent d6d3c82 commit bf02bd3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface PolymerInit {
_template?: HTMLTemplateElement;
hostAttributes?: {[key: string]: any};
listeners?: {[key: string]: string};
behaviors?: PolymerInit | PolymerInit[];
behaviors?: BehaviorInit | BehaviorInit[];

// Lifecycle methods
registered?(): void;
Expand All @@ -43,6 +43,11 @@ export interface PolymerInit {
[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 bf02bd3

Please sign in to comment.