{"id":20563873,"url":"https://github.com/worker-tools/typed-event-target","last_synced_at":"2025-10-20T02:59:23.428Z","repository":{"id":65700215,"uuid":"597653602","full_name":"worker-tools/typed-event-target","owner":"worker-tools","description":"This is the Typed Event Target library you are looking for","archived":false,"fork":false,"pushed_at":"2024-07-24T03:46:17.000Z","size":8,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T15:46:10.335Z","etag":null,"topics":["event-target","types","typescript"],"latest_commit_sha":null,"homepage":"https://workers.tools/typed-event-target","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worker-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-05T07:54:32.000Z","updated_at":"2024-08-21T08:03:53.000Z","dependencies_parsed_at":"2025-08-15T15:25:41.697Z","dependency_job_id":"9f68c674-9b49-42f6-b2b6-cf4b1fa7c40b","html_url":"https://github.com/worker-tools/typed-event-target","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/worker-tools/typed-event-target","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Ftyped-event-target","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Ftyped-event-target/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Ftyped-event-target/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Ftyped-event-target/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worker-tools","download_url":"https://codeload.github.com/worker-tools/typed-event-target/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker-tools%2Ftyped-event-target/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279992093,"owners_count":26255853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["event-target","types","typescript"],"created_at":"2024-11-16T04:21:57.468Z","updated_at":"2025-10-20T02:59:23.403Z","avatar_url":"https://github.com/worker-tools.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typed Event Target\nThis is the Typed Event Target library you are looking for.\n\n## Usage\n\n```ts\nimport { TypedEventTarget } from \"@worker-tools/typed-event-target\";\n\n// Can use custom event maps:\nclass Foo extends TypedEventTarget\u003c{ \n  \"error\": ErrorEvent\n  \"custom\": CustomEvent\u003cstring\u003e\n}\u003e {\n  /* ... */\n}\n\n// Enjoy correctly typed event here:\nconst foo = new Foo()\nfoo.addEventListener(\"error\", ev =\u003e { /* ev: ErrorEvent */ })\nfoo.addEventListener(\"custom\", ev =\u003e { /* ev: CustomEvent\u003cstring\u003e */ })\nfoo.addEventListener(\"unknown\", ev =\u003e { /* ev: Event */})\n\n// Can use built-in event maps from e.g. lib.dom.d.ts:\nclass WorkerLike extends TypedEventTarget\u003cWorkerEventMap\u003e { /* ... */ }\n\n// Can be used as a type:\ntype WindowLike = TypedEventTarget\u003cWindowEventMap\u003e;\n\n// Uses built-in EventTarget:\nfoo instanceof EventTarget // =\u003e true\n\n// No intermediate classes:\nObject.getPrototypeOf(Foo.prototype) === EventTarget.prototype // =\u003e true\n\n// Exports helper types in case you need them:\nimport type { \n  TypedEventListener, \n  TypedEventListenerObject, \n  TypedEventListenerOrEventListenerObject\n} from \"@worker-tools/typed-event-target\"\n```\n\n\u003cbr/\u003e\n\n--------\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://workers.tools\"\u003e\u003cimg src=\"https://workers.tools/assets/img/logo.svg\" width=\"100\" height=\"100\" /\u003e\u003c/a\u003e\n\u003cp align=\"center\"\u003eThis module is part of the Worker Tools collection\u003cbr/\u003e⁕\n\n[Worker Tools](https://workers.tools) are a collection of TypeScript libraries for writing web servers in [Worker Runtimes](https://workers.js.org) such as Cloudflare Workers, Deno Deploy and Service Workers in the browser. \n\nIf you liked this module, you might also like:\n\n- 🧭 [__Worker Router__][router] --- Complete routing solution that works across CF Workers, Deno and Service Workers\n- 🔋 [__Worker Middleware__][middleware] --- A suite of standalone HTTP server-side middleware with TypeScript support\n- 📄 [__Worker HTML__][html] --- HTML templating and streaming response library\n- 📦 [__Storage Area__][kv-storage] --- Key-value store abstraction across [Cloudflare KV][cloudflare-kv-storage], [Deno][deno-kv-storage] and browsers.\n- 🆗 [__Response Creators__][response-creators] --- Factory functions for responses with pre-filled status and status text\n- 🎏 [__Stream Response__][stream-response] --- Use async generators to build streaming responses for SSE, etc...\n- 🥏 [__JSON Fetch__][json-fetch] --- Drop-in replacements for Fetch API classes with first class support for JSON.\n- 🦑 [__JSON Stream__][json-stream] --- Streaming JSON parser/stingifier with first class support for web streams.\n\nWorker Tools also includes a number of polyfills that help bridge the gap between Worker Runtimes:\n- ✏️ [__HTML Rewriter__][html-rewriter] --- Cloudflare's HTML Rewriter for use in Deno, browsers, etc...\n- 📍 [__Location Polyfill__][location-polyfill] --- A `Location` polyfill for Cloudflare Workers.\n- 🦕 [__Deno Fetch Event Adapter__][deno-fetch-event-adapter] --- Dispatches global `fetch` events using Deno’s native HTTP server.\n\n[router]: https://workers.tools/router\n[middleware]: https://workers.tools/middleware\n[html]: https://workers.tools/html\n[kv-storage]: https://workers.tools/kv-storage\n[cloudflare-kv-storage]: https://workers.tools/cloudflare-kv-storage\n[deno-kv-storage]: https://workers.tools/deno-kv-storage\n[kv-storage-polyfill]: https://workers.tools/kv-storage-polyfill\n[response-creators]: https://workers.tools/response-creators\n[stream-response]: https://workers.tools/stream-response\n[json-fetch]: https://workers.tools/json-fetch\n[json-stream]: https://workers.tools/json-stream\n[request-cookie-store]: https://workers.tools/request-cookie-store\n[extendable-promise]: https://workers.tools/extendable-promise\n[html-rewriter]: https://workers.tools/html-rewriter\n[location-polyfill]: https://workers.tools/location-polyfill\n[deno-fetch-event-adapter]: https://workers.tools/deno-fetch-event-adapter\n\nFore more visit [workers.tools](https://workers.tools).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker-tools%2Ftyped-event-target","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworker-tools%2Ftyped-event-target","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker-tools%2Ftyped-event-target/lists"}