Skip to content

Commit

Permalink
Move event declarations to the elements that emit them, remove unneed…
Browse files Browse the repository at this point in the history
…ed async
  • Loading branch information
ObsidianSnoo committed May 24, 2024
1 parent 5e2faea commit 4295cd1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/elements/play-assets-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import './play-assets/play-assets-local-archive.js'
import './play-dialog/play-dialog.js'

declare global {
interface HTMLElementEventMap {
'assets-filesystem-change': CustomEvent<AssetsFilesystemChange>
}
interface HTMLElementTagNameMap {
'play-assets-dialog': PlayAssetsDialog
}
Expand Down
3 changes: 3 additions & 0 deletions src/elements/play-assets/play-assets-local-archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {
import {Bubble} from '../../utils/bubble.js'

declare global {
interface HTMLElementEventMap {
'assets-filesystem-change': CustomEvent<AssetsFilesystemChange>
}
interface HTMLElementTagNameMap {
'play-assets-local-archive': PlayAssetsLocalArchive
}
Expand Down
3 changes: 3 additions & 0 deletions src/elements/play-assets/play-assets-local-directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {
import {Bubble} from '../../utils/bubble.js'

declare global {
interface HTMLElementEventMap {
'assets-filesystem-change': CustomEvent<AssetsFilesystemChange>
}
interface HTMLElementTagNameMap {
'play-assets-local-directory': PlayAssetsLocalDirectory
}
Expand Down
3 changes: 3 additions & 0 deletions src/elements/play-assets/play-assets-virtual-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import '../play-icon/play-icon.js'
import './file-upload-dropper.js'

declare global {
interface HTMLElementEventMap {
'assets-virtual-file-change': CustomEvent<AssetsVirtualFileChange>
}
interface HTMLElementTagNameMap {
'play-assets-virtual-fs': PlayAssetsVirtualFilesystem
}
Expand Down
2 changes: 0 additions & 2 deletions src/elements/play-assets/play-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import {Bubble} from '../../utils/bubble.js'

declare global {
interface HTMLElementEventMap {
'assets-filesystem-change': CustomEvent<AssetsFilesystemChange>
'assets-updated': CustomEvent<AssetsState>
'assets-virtual-file-change': CustomEvent<AssetsVirtualFileChange>
}
interface HTMLElementTagNameMap {
'play-assets': PlayAssets
Expand Down
2 changes: 1 addition & 1 deletion src/elements/play-pen/play-pen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export class PlayPen extends LitElement {
}

/** Throttled changes after updating sources. */
#setSrcSideEffects = throttle(async (save: boolean): Promise<void> => {
#setSrcSideEffects = throttle((save: boolean): void => {
this.#version++
this._bundle = link(
compile(this.#env),
Expand Down

0 comments on commit 4295cd1

Please sign in to comment.