{"_id":"@dao3fun/typed-emitter","_rev":"8-0f2369b6c43503f7dc2dbdf23ad5e107","name":"@dao3fun/typed-emitter","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@dao3fun/typed-emitter","version":"1.0.0","author":{"name":"surfish"},"license":"MIT","_id":"@dao3fun/typed-emitter@1.0.0","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"}],"dist":{"shasum":"7871f131f22b129a5e04cc6afff38b2722a8fa5b","tarball":"https://registry.npmjs.org/@dao3fun/typed-emitter/-/typed-emitter-1.0.0.tgz","fileCount":7,"integrity":"sha512-TQEz6eTe1v6av8GG13o+JGZgpVZJvtY5hPK9Ce/kH14GH/SNLdLNNHT5+UEvb6M8mpkuCysg7nMntuJdCYZ+EQ==","signatures":[{"sig":"MEQCIDF5fUwgjiXil3xIPbc2r9HdJv/hq+Ah2G+dwNIlQZmMAiBqBCZVkpGc3FP+Y4Yz3qK3RsqwcqXUSfsxTD5LpAvr3Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4830},"main":"index.js","type":"commonjs","types":"./index.d.ts","scripts":{"build":"tsc","prepare":"tsc"},"_npmUser":{"name":"surfish","email":"surfish.fun@outlook.com"},"_npmVersion":"11.0.0","description":"Typed Emitter","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typed-emitter_1.0.0_1737799222180_0.25985922832016306","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dao3fun/typed-emitter","version":"1.0.1","author":{"name":"surfish"},"license":"MIT","_id":"@dao3fun/typed-emitter@1.0.1","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"5d1c29630f70497405b84fddb0b293916c54ae56","tarball":"https://registry.npmjs.org/@dao3fun/typed-emitter/-/typed-emitter-1.0.1.tgz","fileCount":7,"integrity":"sha512-Sx01LsW7N20TUvp8kh8vBQDQCx1uJHAxy06IL6srGV4HZdu45RKKJ/e/c61uY2vuCpSShlIUey93bbZ4wBGc/A==","signatures":[{"sig":"MEYCIQDRfhiVTM7WqsxyEjF98FXbiS8NtnScvlpYe+IsR5CqjgIhAMXsBiIDfB1DxzOJxkD/sLgZEw/agcG4NK+wE01smZ3C","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4808},"main":"index.js","types":"./index.d.ts","gitHead":"54672a19bff626b0503351ec7ad306e82939fc7f","scripts":{"build":"tsc","prepare":"tsc"},"_npmUser":{"name":"surfish","email":"surfish.fun@outlook.com"},"_npmVersion":"11.0.0","description":"Typed Emitter","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typed-emitter_1.0.1_1738159589202_0.0017625413437456494","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dao3fun/typed-emitter","version":"1.0.2","author":{"name":"surfish"},"license":"MIT","_id":"@dao3fun/typed-emitter@1.0.2","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"2a1da3ad40043b7c15640b7bdb47f0b2a294d332","tarball":"https://registry.npmjs.org/@dao3fun/typed-emitter/-/typed-emitter-1.0.2.tgz","fileCount":7,"integrity":"sha512-65xrprE/O5ozNhoegpg6corF480aUpV4RD3VNDRmvfNC8vnQC4lIqW8yQD388c/4eJnl9t+bcABubNrir7giHQ==","signatures":[{"sig":"MEQCIBBtB8+Vbtlk+KP3sKKScChrUyDs1M0/XQ/lpFJuNjc3AiBSu+DfkXZIqprPjkHMQZH8FUrkm1js+944Z6/zudQDBA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4799},"main":"index.js","types":"./index.d.ts","gitHead":"54672a19bff626b0503351ec7ad306e82939fc7f","scripts":{"build":"tsc","prepare":"tsc"},"_npmUser":{"name":"surfish","email":"surfish.fun@outlook.com"},"_npmVersion":"11.0.0","description":"Typed Emitter","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typed-emitter_1.0.2_1738159697997_0.272500598323137","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@dao3fun/typed-emitter","version":"1.0.3","author":{"name":"surfish"},"license":"MIT","_id":"@dao3fun/typed-emitter@1.0.3","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"}],"dist":{"shasum":"ff3d58a5f7f6091f0759dd301c12ea65e8fe7572","tarball":"https://registry.npmjs.org/@dao3fun/typed-emitter/-/typed-emitter-1.0.3.tgz","fileCount":7,"integrity":"sha512-aLnZW9ygadvbKfS6pPHWmHlVsLKNl5eF1u2/9Yl/67bT66xm8iCBAkngA+7iPrw8MWecB5NH+bYthyBiADIS5A==","signatures":[{"sig":"MEUCIGQo4rL74tCzjyZjfxlxZZhokgbffvD9zoElIZYJN7ZwAiEAxp5+1N3LGgQ/3/CFEQchfHibkG2R3CImkrTJOTyZTi8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4783},"main":"index.js","types":"./index.d.ts","gitHead":"d301ebec8e88b82df55d3b80ea48a396fcaf1ae6","scripts":{"build":"tsc","prepare":"tsc"},"_npmUser":{"name":"surfish","email":"surfish.fun@outlook.com"},"_npmVersion":"11.0.0","description":"Typed Emitter","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typed-emitter_1.0.3_1738159816379_0.5835904213131937","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@dao3fun/typed-emitter","version":"2.0.0","description":"A simple event emitter with zero dependency, type safety and auto completion support.","license":"MIT","author":{"name":"surfish"},"main":"index.js","scripts":{"build":"tsc","prepare":"tsc"},"dependencies":{"typescript":"^5.9.2"},"_id":"@dao3fun/typed-emitter@2.0.0","gitHead":"c116a3c3708ac434bf301acc1fad9924e0774906","types":"./index.d.ts","_nodeVersion":"24.7.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-FDKGuDsQHEbjr5lhXfUfObYaRTSC7DmvockA2z1CUjd/m7g0sPGnDMjJdKHsMqap80TlpO5uFUgmPE41ZNlyeA==","shasum":"12d5c11f14c7e9d5b5cb9c58e9fa2978614922da","tarball":"https://registry.npmjs.org/@dao3fun/typed-emitter/-/typed-emitter-2.0.0.tgz","fileCount":7,"unpackedSize":3450,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDsPg3QLKxN5/MHV5kBQxczLxKD3TyzYzf/JMJLocn5aQIgU6UwiO3Yc8N9PtwkDi22B9d0Bqrd/LGYmE7CKIOs0mU="}]},"_npmUser":{"name":"surfish","email":"surfish.fun@outlook.com"},"directories":{},"maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"},{"name":"syhdarkforest","email":"863489539@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typed-emitter_2.0.0_1757239015237_0.7999857092420957"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-25T10:00:22.044Z","modified":"2025-09-07T09:56:56.077Z","1.0.0":"2025-01-25T10:00:22.367Z","1.0.1":"2025-01-29T14:06:29.390Z","1.0.2":"2025-01-29T14:08:18.185Z","1.0.3":"2025-01-29T14:10:16.652Z","2.0.0":"2025-09-07T09:56:55.444Z"},"author":{"name":"surfish"},"license":"MIT","description":"A simple event emitter with zero dependency, type safety and auto completion support.","maintainers":[{"name":"viyrs","email":"2991883280@qq.com"},{"name":"surfish","email":"surfish.fun@outlook.com"},{"name":"tobylai","email":"toby_lai@126.com"},{"name":"studentnumber2","email":"pzh123gxy2023@163.com"},{"name":"l.w.kevin0wvf","email":"Qck320923@163.com"},{"name":"onloading","email":"605952607@qq.com"},{"name":"whale303","email":"little_whale303@outlook.com"},{"name":"syhdarkforest","email":"863489539@qq.com"}],"readme":"# Typed Emitter\n\nA simple event emitter with zero dependency, type safety and auto completion support.\n\n## Usage\n\nExample code\n\n```ts\nimport { Emitter } from \"@dao3fun/typed-emitter\";\n\n// Events\nexport enum Events {\n  MouseDown,\n  MouseMove,\n}\n\n// Types\nexport type ServerEventType = {\n  [Events.MouseDown]: {\n    x: number;\n    y: number;\n  };\n  [Events.MouseMove]: {\n    dx: number;\n    dy: number;\n  };\n};\n\n// event emitter\nconst emitter = new Emitter<\n  typeof Events,\n  ServerEventType\n>();\n\n// register listener\nconst listener = emitter.on(Events.MouseDown, ({x, y}) => {\n  console.log(`Mouse down at (${x}, ${y})`);\n})\n\n// emit event\nemitter.emit(Events.MouseMove, {dx: 1, dy: 2});\n\n// unregister listener\nlistener.cancel();\n```","readmeFilename":"README.md"}