Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[labs/virtualizer] Export event classes through a new events.js (#3430)
* Added an events.js to export the RangeChangedEvent and VisibilityChangedEvent classes. * Point to events.js to get the event classes now and moved the custom Range interface into there. * Added events.js files to package.json's files property and the wireit outputs for build:ts.
- Loading branch information
Showing
9 changed files
with
65 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lit-labs/virtualizer': patch | ||
--- | ||
|
||
Added an events.js to enable exporting of RangeChangedEvent and VisibilityChangedEvent classes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @license | ||
* Copyright 2021 Google LLC | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
export class RangeChangedEvent extends Event { | ||
static eventName = 'rangeChanged'; | ||
|
||
first: number; | ||
last: number; | ||
|
||
constructor(range: Range) { | ||
super(RangeChangedEvent.eventName, {bubbles: true}); | ||
this.first = range.first; | ||
this.last = range.last; | ||
} | ||
} | ||
|
||
export class VisibilityChangedEvent extends Event { | ||
static eventName = 'visibilityChanged'; | ||
|
||
first: number; | ||
last: number; | ||
|
||
constructor(range: Range) { | ||
super(VisibilityChangedEvent.eventName, {bubbles: true}); | ||
this.first = range.first; | ||
this.last = range.last; | ||
} | ||
} | ||
|
||
export class UnpinnedEvent extends Event { | ||
static eventName = 'unpinned'; | ||
|
||
constructor() { | ||
super(UnpinnedEvent.eventName, {bubbles: false}); | ||
} | ||
} | ||
|
||
interface Range { | ||
first: number; | ||
last: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters