File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
export { LitNotify } from './notify' ;
2
+ export { LitSync } from './sync' ;
Original file line number Diff line number Diff line change
1
+ import { LitElement , UpdatingElement } from 'lit-element' ;
2
+
3
+ type Constructor < T = LitElement > = new ( ...args : any [ ] ) => T ;
4
+
5
+ declare class SyncElement {
6
+ sync ( property : string , eventName ?: string ) : void
7
+ }
8
+
9
+ export function LitSync < T extends UpdatingElement > ( baseElement : Constructor < T > ) : T & SyncElement
Original file line number Diff line number Diff line change 1
1
import { directive } from "lit-html/lib/directive.js" ;
2
2
import { eventNameForProperty } from "./notify.js" ;
3
3
4
+ // eslint-disable-next-line valid-jsdoc
4
5
/**
5
6
* Mixin that provides a lit-html directive to sync a property to a child property
6
7
*
7
- * @param {LitElement } baseElement - the LitElement to extend
8
+ * @template TBase
9
+ * @param {Constructor<TBase> } baseElement
8
10
*/
9
11
export const LitSync = ( baseElement ) => class extends baseElement {
10
12
constructor ( ) {
You can’t perform that action at this time.
0 commit comments