Skip to content

TypeScriptPlayground/custom-event-target

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Event Target

Run Linter Run Unit Tests

This package contains a class and types for a CustomEventTarget.

Example

import { CustomEventTarget, type CustomEventListenerOrCustomEventListenerObject } from '@typescriptplayground/custom-event-target'

class MyClass<MyEvents extends 'foo' | 'bar' | 'baz'> extends CustomEventTarget {
  override addEventListener(
    type : MyEvents,
    listener : CustomEventListenerOrCustomEventListenerObject<MyEvents> | null,
    options? : boolean | AddEventListenerOptions
  ) : void {

  }

  override removeEventListener(
    type : MyEvents,
    listener : CustomEventListenerOrCustomEventListenerObject<MyEvents> | null,
    options? : boolean | EventListenerOptions
  ) : void {
    
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published