Skip to content
Open
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
16 changes: 7 additions & 9 deletions notify.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { PropertyDeclaration, LitElement, UpdatingElement } from 'lit-element';
import { LitElement, UpdatingElement } from 'lit-element';

type Constructor<T = LitElement> = new (...args: any[]) => T;

interface AugmentedPropertyDeclaration extends PropertyDeclaration {
/** When true will notify. Pass a string to define the event name to fire. */
notify: string|Boolean
declare module 'lit-element/lib/updating-element' {
export interface PropertyDeclaration {
/** When true will notify. Pass a string to define the event name to fire. */
notify?: string|Boolean
}
}

declare class NotifyingElement {
static createProperty(name: string, options: AugmentedPropertyDeclaration): void
}

export function LitNotify<T extends UpdatingElement>(baseElement: Constructor<T>): T & NotifyingElement
export function LitNotify<T extends Constructor<UpdatingElement>>(baseElement: T): T