This file contains hidden or 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
export class TypedStorage<Items> { | |
private prefix: string; | |
constructor(prefix: string) { | |
this.prefix = prefix; | |
} | |
public delete<Key extends keyof Items>(key: Key) { | |
const value = this.get(key); | |
const prefixedKey = this.getPrefixedKey(key); |
This file contains hidden or 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
import { customElement, LitElement } from 'lit-element'; | |
type UnpackCustomEvent<T> = T extends CustomEvent<infer U> ? U : never; | |
// Define custom event types and details here | |
interface CustomEventMap { | |
/** | |
* Dispatched when an error occurs. | |
*/ | |
'my-error': CustomEvent<{ error: Error }>; |