{"_id":"ts-typed-events","_rev":"13-68a4dcfce511f6c5a93fab45cb55ba7d","name":"ts-typed-events","description":"Zero dependency strongly typed event emitters for TypeScript","dist-tags":{"latest":"3.0.0","next":"3.0.0-rc.5"},"versions":{"1.0.0":{"name":"ts-typed-events","version":"1.0.0","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"./js/event.js","types":"./js/event.d.ts","dependencies":{},"devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.43","chai":"^4.1.2","mocha":"^3.5.3","rimraf":"^2.6.2","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typedoc":"^0.8.0","typescript":"^2.5.2"},"engines":{"node":"8.5.0"},"scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"npm run clean:js && npm run clean:docs","clean:docs":"rimraf docs/","clean:js":"rimraf js/","docs":"typedoc --mode file --out docs/ --exclude test/* --includes src/","lint":"tslint -c tslint.json 'src/**/*.ts'","fix":"tslint -c tslint.json 'src/**/*.ts' --fix --force","test":"npm run build && mocha js/test --reporter spec"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"ccdbca00220f5f8837c5485ce75a62903548657d","_id":"ts-typed-events@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"dist":{"integrity":"sha512-8dQnXMwg/K/fHITsgegRXGbbr+1JXQYWbhWaL5+59JpzRRVRV4XZ7jHR0LJ3CxINafGFskxM76EwTxX56Uf5HQ==","shasum":"fa51afcd1da790727d11f080a803a883a71978ff","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVI6iHUQjhM+ZcAf9g8iF4L6o2g2lLC46k6CmuK1fFdAiAWtT/n4vXaKNUcnhEHtkCCLzYpjQG9e5jqz/sh513gYQ=="}]},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events-1.0.0.tgz_1505945137761_0.7267561620101333"},"directories":{}},"1.0.1":{"name":"ts-typed-events","version":"1.0.1","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"./js/src/event.js","types":"./js/src/event.d.ts","dependencies":{},"devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.43","chai":"^4.1.2","mocha":"^3.5.3","rimraf":"^2.6.2","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typedoc":"^0.8.0","typescript":"^2.5.2"},"engines":{"node":"8.5.0"},"scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"npm run clean:js && npm run clean:docs","clean:docs":"rimraf docs/","clean:js":"rimraf js/","docs":"typedoc --mode file --out docs/ --exclude test/* --includes src/","lint":"tslint -c tslint.json 'src/**/*.ts'","fix":"tslint -c tslint.json 'src/**/*.ts' --fix --force","test":"npm run build && mocha js/test --reporter spec"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"d26259cd73dfa311085b6a5c2fe2e245d1f44e93","_id":"ts-typed-events@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"dist":{"integrity":"sha512-TMMwl5rf0CFqPqyO38MVntTDuYVWD6EKVa/JOTtFl6P3O3LrpaFqcl2p5jB9C7qu8rvutmW6n0Wxzhioq21f5Q==","shasum":"36f0d2b5c67e4446558e6065831285e7bc7aa913","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6JDX1wWhO/v6esuRG4D/3GH4yhMTdVNghLoFQd/UWiwIgeJkP9ETTtDnsKHdh4eLS3XsjlnupiC3Tw/hrXNQOjOE="}]},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events-1.0.1.tgz_1505949574355_0.31430590711534023"},"directories":{}},"1.0.2":{"name":"ts-typed-events","version":"1.0.2","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"./js/src/index.js","types":"./js/src/index.d.ts","dependencies":{},"devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.43","chai":"^4.1.2","mocha":"^3.5.3","rimraf":"^2.6.2","shx":"^0.2.2","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typedoc":"^0.8.0","typescript":"^2.5.2"},"scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"npm run clean:js && npm run clean:docs","clean:docs":"rimraf docs/","clean:js":"rimraf js/","docs":"typedoc --mode file --out docs/ --exclude test/* --includes src/","docs:predeploy":"shx touch docs/.nojekyll","lint":"tslint -c tslint.json 'src/**/*.ts'","fix":"tslint -c tslint.json 'src/**/*.ts' --fix --force","test":"npm run build && npm run test:nobuild","test:nobuild":"mocha js/test --reporter spec"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"ece77800cb6e79e9434f97f11181ca3a06393ab4","_id":"ts-typed-events@1.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"dist":{"integrity":"sha512-/KdS5XSLrGjSUlEtS2gzcksr7iVh/oCkCWRs15UsEHVJoD698KHxofohOzs0HsuoDWFDOBPq2hH0dX8TC/xy4A==","shasum":"95e9e2e0045e7d6f96f1009d9dd95a1202697375","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0hOpvPtAAwiT16kQew6GW9agZWSS0KUi2Tu3y8r9c+AiEAgMzHGot2zZwkSX3lTVS0jrRNs+TEbDVBEdyjpdTJSyg="}]},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events-1.0.2.tgz_1514769648797_0.5965731635224074"},"directories":{}},"1.1.0":{"name":"ts-typed-events","version":"1.1.0","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"./js/src/index.js","types":"./js/src/index.d.ts","dependencies":{},"devDependencies":{"@types/chai":"^4.0.4","@types/mocha":"^2.2.43","chai":"^4.1.2","mocha":"^3.5.3","rimraf":"^2.6.2","shx":"^0.2.2","tslint":"^5.7.0","tslint-eslint-rules":"^4.1.1","typedoc":"^0.8.0","typescript":"^2.5.2"},"scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"npm run clean:js && npm run clean:docs","clean:docs":"rimraf docs/","clean:js":"rimraf js/","docs":"typedoc --mode file --out docs/ --exclude test/* --includes src/","docs:predeploy":"shx touch docs/.nojekyll","lint":"tslint -c tslint.json 'src/**/*.ts'","fix":"tslint -c tslint.json 'src/**/*.ts' --fix --force","test":"npm run build && npm run test:nobuild","test:nobuild":"mocha js/test --reporter spec"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"8d0709a91c9179165d4645421b4f16bac3850d53","_id":"ts-typed-events@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"dist":{"integrity":"sha512-MjISC6pNicSGmnBkMxWt+bKaWcB4K/kogVMO/1RcMETh5GETdvW2pX6hqNhJVM4XOqn35iBTo5fi4z2orIzitA==","shasum":"2b5bd5345c495e036301150c7b2640d4cbb7dccc","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbwo0fLJ8fHyfSlUmPRXEmQ7fXqM1IvTQDD6CTP6x3nQIgdJWll4jUcqt/O0G67Cs3rUSxOEro7HFxjKAKXWEr1/A="}]},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events-1.1.0.tgz_1514773021436_0.7771701454184949"},"directories":{}},"1.1.1":{"name":"ts-typed-events","version":"1.1.1","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"./js/src/index.js","types":"./js/src/index.d.ts","dependencies":{},"devDependencies":{"@types/chai":"^4.1.0","@types/mocha":"^2.2.46","chai":"^4.1.2","mocha":"^4.1.0","shx":"^0.2.2","tslint":"^5.8.0","tslint-eslint-rules":"^4.1.1","typedoc":"^0.9.0","typescript":"^2.6.2"},"scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"npm run clean:js && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:js":"shx rm -rf js/","docs":"typedoc --mode file --out docs/ --exclude test/* --includes src/","docs:predeploy":"shx touch docs/.nojekyll","lint":"tslint -c tslint.json 'src/**/*.ts'","fix":"tslint -c tslint.json 'src/**/*.ts' --fix --force","test":"npm run build && npm run test:nobuild","test:nobuild":"mocha js/test --reporter spec"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"515980215daa010a2294331a2d28eddb3dd3cb3e","_id":"ts-typed-events@1.1.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"dist":{"integrity":"sha512-jftubiJvjHWcHIFUgLOGB1NjybQwKpAWX1Rb9FeVGw9R6LvqjdBdkowFQUTTjcpaVmmJXXvuwjZFhDuqnr9xQQ==","shasum":"9736c79c008cdd61fc536b98a806e85bf25053cf","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-1.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlHxaO9Z/y3cpfiwpFR1qCEOQUdTmb+8HXGXl7AriaSwIhALW1qjQ7opLNDt0nwWYIElHLBiW78jSnDVr+I/MAVMqz"}]},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events-1.1.1.tgz_1515217158540_0.5166073848959059"},"directories":{}},"2.0.0":{"name":"ts-typed-events","version":"2.0.0","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"6.8.1","@types/jest":"25.2.3","@typescript-eslint/eslint-plugin":"2.34.0","eslint":"7.0.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#100a1965c78f7f928204b1b5dc613f9ef1adb9f1","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#a00ba9efe989f30e990c74f115ff2762f66a4bff","eslint-plugin-import":"2.20.2","eslint-plugin-import-order-alphabetical":"1.0.0","eslint-plugin-jest":"23.13.1","eslint-plugin-jsdoc":"25.4.2","eslint-plugin-prettier":"3.1.3","jest":"26.0.1","jest-cli":"26.0.1","npm-check-updates":"6.0.1","prettier":"2.0.5","shx":"0.3.2","ts-jest":"26.0.0","ts-node":"8.10.1","typedoc":"0.17.7","typescript":"3.9.3"},"scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc --mode file --out docs/ --exclude test/* --includes src/","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"f92b2f926956861161a80a95432d37e3e6f7fa85","_id":"ts-typed-events@2.0.0","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+3ztYHLJQZSBpwbymLJGquAanJvZgzrfFnO7AFK7JSRds4FhkY+hA52jINM57Dpo5kI6uv5SmkrQ5Vn+5yZypw==","shasum":"1a80c9a6c33d30c0de69805f0a9591ac5e581f2c","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-2.0.0.tgz","fileCount":10,"unpackedSize":24121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexHWFCRA9TVsSAnZWagAA6LYP/jGzSUieZEsI8QaRnTQz\nLsKQq6sgO9oEzCqmLJEa2ZNvn+j2PFTtvIxPeJy+i+6COI0ICYxMOevJSvH7\npWfzejO4IzNX5+K4seBwRSDNxgeHNabZIOJZOJHBbmKoN3PumZTNJSuefCIp\nMykuZPsLEGaVjeTadDAbTjsHxX6JSkn+7ZqsFNamUMXp7iONUM8bxwMrUw6U\nD3NfOgh6UJ0OStGbGHjD9b15KdpDMnyy00AdTcU2AuT0TtD/9e+tYqkxfjja\nM+Ln5JmON/d9XbsbzS9Qb4RXvuAKnRQJyhJqxXCkVtRipiAHXLGj1iguMIuq\nmyFtsKhXXHbwza8iiAlbpN01916Bd3tjspl4YeMVi4O/xtmVr1e3B2x043dB\n93KToIIJYuBr3wyI8pg/7EIfdpnuyJb87jDKc5Wy04ewcZSizTnvV5bAP2xY\nmYlKjpSOqkZNkobgAQpyB1gFCo92PAL3BVEERKmGcEvqar7ehxuITVRowHjQ\ntj5X6Zc10irWjoFhEP1jGaBY3BBV/4QdIsy0GPvD9Etdq68HKjyCGiJXWJMn\nbB6ecq1X2R+fzqpM8SPW4iqvE6UVOwaaQMmLGlArwQJBhK3jcNC4094FYKHL\nCQ9CpfeSj/ABvWRqo83rZqqZviGa+/lQPy9jx/5HLuP6PkjOxFtuEhuZaG0O\n1kEY\r\n=HVSe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbUtzC4UFsjtkjN2IMImw8BXNs4qS0fuN/L+JtBaaVUAiEA96jAs38Ez/l1r0F/X7TJeZ9jD02kqLGVY2gDdMoLwBg="}]},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_2.0.0_1589933444641_0.631027624175271"},"_hasShrinkwrap":false},"3.0.0-rc.1":{"name":"ts-typed-events","version":"3.0.0-rc.1","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"7.2.6","@types/jest":"26.0.20","@typescript-eslint/eslint-plugin":"4.14.0","eslint":"7.18.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#d2068a3680e5932b61f197a9c0d5d00741dd4130","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#4cbb83846d4e1a29e95b406ed5d957bdab6b0824","eslint-plugin-import":"2.22.1","eslint-plugin-import-order-alphabetical":"1.0.1","eslint-plugin-jest":"24.1.3","eslint-plugin-jsdoc":"31.0.8","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","jest-cli":"26.6.3","npm-check-updates":"10.2.5","prettier":"2.2.1","shx":"0.3.3","ts-jest":"26.4.4","ts-node":"9.1.1","typedoc":"0.20.16","typescript":"4.1.3"},"scripts":{"build":"tsc --project ./tsconfig.build.json","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc --out docs/ --exclude test/* --entryPoints src/index.ts","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"54eee264d54baf89c1896fb736c655b901cababb","_id":"ts-typed-events@3.0.0-rc.1","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-gOUoKfUrxCNBGqh+C9pNmRUkYAs2PO7ib7oMQSHacHjHh1QfbqvL1uMfBQ1GeNX0nvSjt1NuA/ZP/tTt2rlRaQ==","shasum":"ed369fd9faec8cfdae1d35174e76ca9d9799d04a","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0-rc.1.tgz","fileCount":6,"unpackedSize":25196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDL2mCRA9TVsSAnZWagAAq4YP/j+DrVr8C/J8CCGU2zKg\nxBGAhTjqAhpHWhdU+1CYuBfEE/vwFvKdZrSpPV5y2bZDpKRaG2dVb1IcX6N+\n2pGn4CPFjKCAArKZwmS6uZLmuDuY6a2vZcO90O+7kMhMR/jH7XWu8oGl7Kio\nsQKj8lZ/TaIGxZChK4PzetAMfUyMMDvnElCyVuk8XgV2X3cDjfd7qADWyHRp\nkaVesgH7v/4sMgwqYx/0/98V//Qyle7QXzCGsYtCZxj14gI1FhjCc0I5YQ6/\nQDAWBxBGMg+LY8pIvJVdi1FtXZukcaVRrxaS24bfj5RLlu5UsE9pCfgGCcYu\nOSqRHXk98ORZaisiNXt6fbjUixR6347dvRBVu8nJZRU5vOFMgADWdD3Kn4mJ\nb7JdqaBNuprn0IIPFswx00PqWu7tZjg/U/i/pl0SyNYCDeDjs2XBTH8sxOjk\nAhVealMbrE9Lt+qlt0wfHmJnckWCHSl+/Q1rYIs3exyqdhwn+k/CHeBWmvLT\nXwVmjJoTCjaDA4XRvmVSZRS3xstsC35tFrkeAKR6QFn4FWySwoc4U9RrJHH1\nFfARKy/kg4BntKd7s2Waj0EN5syJgAtWMhFKIj3DEadvYLH3jSOq1k4XYLj1\nzKoW6uBxetSlUQYg/rxvQ4XmzWTT6n2C+eAJQ+TsB4uUeyQiA0qlZZFbs6MP\n8B/d\r\n=asN+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBeXD197rOlEFm6JyAlaQ8biZ5kZSSyetXkR0uSfqEypAiEAkaLGu0+bAbYrjys4ZVNapJSO65nmNA9KucHDIfmJCk0="}]},"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_3.0.0-rc.1_1611447718128_0.39268312616395873"},"_hasShrinkwrap":false},"2.0.1":{"name":"ts-typed-events","version":"2.0.1","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"7.2.0","@types/jest":"26.0.4","@typescript-eslint/eslint-plugin":"3.6.0","eslint":"7.4.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#6b88f6d5e01a31b4d750c39fb8c5eeaf6c77177b","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#a00ba9efe989f30e990c74f115ff2762f66a4bff","eslint-plugin-import":"2.22.0","eslint-plugin-import-order-alphabetical":"1.0.0","eslint-plugin-jest":"23.18.0","eslint-plugin-jsdoc":"29.1.2","eslint-plugin-prettier":"3.1.4","jest":"26.1.0","jest-cli":"26.1.0","npm-check-updates":"7.0.1","prettier":"2.0.5","shx":"0.3.2","ts-jest":"26.1.1","ts-node":"8.10.2","typedoc":"0.17.8","typescript":"3.9.6"},"scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc --mode file --out docs/ --exclude test/* --includes src/","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"4d9408a87d7453bb68665067d6cdaa87500f1c6c","_id":"ts-typed-events@2.0.1","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-7V+vCn52mZVSe+udf0L2SRkvs8BquF7xOtVktJsiyz3IGgcAhHwp3aetPcrxT5Xq23Bb/tBX0azQ6BBvPVytZg==","shasum":"8718e41ee6d38a6f1586224b3f7015c769cf0da9","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-2.0.1.tgz","fileCount":10,"unpackedSize":23675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDhhkCRA9TVsSAnZWagAA+UMP/j6S8aqmZKYR+2HwbgkY\nNLb3JLD06V69SSZhZEpcwkmYCJhb5RKs2MP7f2A/PQwpNyToH5htDqjisTJk\n9zieMx98mr/erf8id35snbNC/N8PWwpF1/k28IWvlT/aWFavj81U0Bk5oO5h\nIt5vmUzHt5fSA9PK6S9UMrMXZbvs0Z+jdxu4wI04J0RkpOACliWWCdSNvgQO\nSEVKd82FByOMxaa1JUqZhkEK7n9qTKvIx7qXZLLC0oFHzcGjZeCNVsKs8JoH\n8nuTVJ9sWCDZmS1GbIC7BNn1U/T7n+RgiAvIGYs8JW5jfOo/d7RB2SiD7m3l\nsNgxCnRZtyFq1gD0UqtRd6+UL+Pedoq/dNvKJbBeaIFP0GgPQC5Di0gsrmnD\nGkm2Kgib1zMEEU/3Fpkk8JwZbGnidTzh7PySBu1fh3D3ReMRp5qu+JMyhUWe\nRmO8Gwq/Jxvj9szPRnWVHwLz1/eObKUVrEoBnhxGsKVe3Ne8juGwZRgZfYMs\n0Jx5Ew4mn1onAYtF2FzAP8tMi/7A8izBJKLggG7vYCrxvsYpgu1xnpLy1Yq7\nBZQ2Gaa4vKeGhbMlNbGj4v+Tj++E+T5gDf9dAD14FbfaAzVnFM6KlMfn29AP\nDa67haZFWU1SkEAEbxj5I+mBu199IEXH44lm/CoFssdQEmmL7STbwV/BjZKB\nrIUD\r\n=he8y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtI7VHAonjnbvL9dUheonYrNwRvlwunET8qymSH/xYawIhAM66vuj3ZQ8n5y3fBNMIa50TI9NP6TWxsXByMNTmVAKq"}]},"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_2.0.1_1611536484020_0.4534352341115444"},"_hasShrinkwrap":false},"3.0.0-rc.2":{"name":"ts-typed-events","version":"3.0.0-rc.2","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"7.2.6","@types/jest":"26.0.20","@typescript-eslint/eslint-plugin":"4.14.0","eslint":"7.18.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#d2068a3680e5932b61f197a9c0d5d00741dd4130","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#4cbb83846d4e1a29e95b406ed5d957bdab6b0824","eslint-plugin-import":"2.22.1","eslint-plugin-import-order-alphabetical":"1.0.1","eslint-plugin-jest":"24.1.3","eslint-plugin-jsdoc":"31.0.8","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","jest-cli":"26.6.3","npm-check-updates":"10.2.5","prettier":"2.2.1","shx":"0.3.3","ts-jest":"26.4.4","ts-node":"9.1.1","typedoc":"0.20.16","typescript":"4.1.3"},"scripts":{"build":"tsc --project ./tsconfig.build.json","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc --out docs/ --exclude test/* --entryPoints src/index.ts","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"8b172c4c842df74c2c5645d5b1cd4e547c39c137","readme":"# ts-typed-events - v3.0 Release Candidate 2\n\nStrongly typed event emitters for [TypeScript](https://www.typescriptlang.org/).\n\nThis is a TypeScript project, although the compiled source is available in the\nnpm package, it is solely designed around the purpose of making events easier to\nwork with _in TypeScript_.\n\n## Purpose\n\nUsing Node's [EventEmitter](https://nodejs.org/api/events.html) class is nice;\nit's a useful software engineering paradigm. However in TypeScript you lose out\non TypeScript's robust type checking when publishing and subscribing to events.\n\nThe aim of this is to leverage TypeScript's generic types to allow for compile-\ntime type checking. We also move the events into their own class, so you don't\nhave to inherit or mixin any of our classes, just use these single Event\nemitters. It is also un-opinionated, exposing functional and object oriented\nbuild blocks in this library so you can use it best works in your project.\n\n## Examples\n\n### Importing\n\n```ts\nimport { createEventEmitter } from \"ts-typed-events\";\n```\n\n### Simple Usage\n\n```ts\nconst { event, emit } = createEventEmitter<string>();\n\nevent.on((str) => {\n    console.log(\"hey we got the string:\", str);\n});\n\nemit(\"some string\"); // prints `hey we got the string: some string`\n```\n\n### Events without types (signals)\n\n```ts\nconst { event: signal, emit } = createEventEmitter<string>();\n\nsignal.on(() => {\n    console.log(\"The event triggered!\");\n});\n\nemit(); // prints: `The event triggered!`\n```\n\n### async/await usage\n\n```ts\nconst { event, emit } = createEventEmitter<number>();\n\n// emit the event in 1 second\nsetTimeout(() => emit(1337), 1000);\n\nconst emitted = await event.once();\nconsole.log(\"1 sec later we got\", emitted);\n// printed: `1 sec later we got 1337`\n```\n\n_Note_: async only works with `once`, not `on` as that can trigger multiple\ntimes.\n\n### Multiple callbacks\n\n```ts\nconst { event, emit } = createEventEmitter<\"pizza\" | \"ice cream\">();\n\nevent.on((food) => console.log(\"I like\", food));\nevent.on((badFood) => console.log(badFood, \"is bad for me!\"));\n\nemit(\"pizza\");\n// printed: `I like pizza` followed by `pizza is bad for me!`\n```\n\n### Removing callbacks\n\n```ts\nconst { event, emit } = createEventEmitter();\n\nconst callback = () => { throw new Error(\"I don't want to be called\"); };\nevent.on(callback);\nevent.off(callback);\n\n// The callback was removed, so the Error in the callback is not thrown\nconst emitted = emit();\nconsole.log(\"were any callbacks invoked during the emit?\", emitted);\n// printed: `were any callbacks invoked during the emit? false`\n```\n\n### Alternative Syntax\n\nThe main method, `createEventEmitter`, returns the emitter function, with\nthe event and itself as properties. This makes the above examples when used\nwith destructuring look clean. However you can choose not to destructure it\nas well:\n\n```ts\nconst emit = createEventEmitter<\"something\" | undefined>();\n\nemit.event.on((something) => {\n    console.log(\"did we get something?:\", something);\n});\n\nemit(); // prints `did we get something?: undefined`\n\n// the emitter has access to itself via the `emit` key as well\nconsole.log(emit === emit.emit); // print `true`\n```\n\n### Public Events\n\nIn the above examples, the `event` and `emit` are two separate constructs.\nThis is to separate the callback and invocation logic. However there are some\ntimes when you could want an event to be able to be triggered by anything with\naccess to it.\n\n```ts\nimport { PublicEvent } from \"ts-typed-events\";\n\nconst publicEvent = new PublicEvent();\n\npublicEvent.on(() => console.log(\"someone triggered this!\"));\n\npublicEvent.emit(); // prints: `someone triggered this!`\n```\n\nYou can also use it functionally if you want to avoid classes/OOP.\n\n```ts\nimport { createPublicEventAndEmit } from \"ts-typed-events\";\n\nconst { event, emit } = createPublicEventEmitter<string>();\n\nevent.on((emitted) => console.log(`someone emitted: '${emitted}'!`));\n\nevent.emit(\"first\"); // prints: `someone emitted 'first'!`\n\n// you still can use the \"normal\" emitter too\nemit(\"second\"); // prints: `someone emitted 'second'!`\n```\n\n### Classes\n\n```ts\nclass Dog {\n    private timesBarked = 0;\n    // By keeping reference to the tuple, we have wrapped the emit function\n    // in a private variable, and only exposed the public event.\n    // This allows us to decide inside our class instances when we want to\n    // emit events.\n    private emitBarked = createEventEmit();\n    public barked = this.emitBarked.event;\n\n    public bark() {\n        this.timesBarked += 1;\n        this.emitBarked();\n    }\n}\n\nconst dog = new Dog();\ndog.barked.on(() => console.log(\"The dog barked!\"));\ndog.bark(); // prints: `The dog barked!`;\n```\n\n## Other Notes\n\nThis library leverages TypeScript's interfaces and generics very heavily to do\ntype checking at every point. If you plan to use this with regular JavaScript\nmost of this library's features are lost to you, so you'd probably be best off\nsticking to the built-in EventEmitter class.\n\n## Docs\n\nAll the functions are documented using jsdoc style comments, so your\nfavorite IDE should pick up the documentation cleanly.\n\nHowever, if you prefer external docs, they are available online here:\nhttps://jacobfischer.github.io/ts-typed-events/\n","readmeFilename":"README.md","_id":"ts-typed-events@3.0.0-rc.2","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-SfQ0oB3Yi1Y2zs03t+nevWy5BsW57H43+QPq3yodvU1LEAS2wblGLwuCUUzGNFfdTxAAAwYZwsgc71W/re0zmg==","shasum":"14a28c37f3856e9785ecdb49c15c21db3db1e2d6","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0-rc.2.tgz","fileCount":6,"unpackedSize":24031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDkc+CRA9TVsSAnZWagAAEYwP/3WZRsGgciDHYJIhcu6i\nDULjR4Ca8+S80zi56/UtmwzX/IhlbvIEY+OkJ5WbA/JPq8lxNgGprMbI1Z8n\nHECJxad/wP5hZ417Ex7nv+id5EPWvYo3SWCwT2SZX6ruAPmQmnu3iPl16WF3\nnBTDlx4focSvwayDeLGfK0+JICMtpyAIuBNNQ5JhmZQlKV0G+TdTECmufe9s\nKnVNjigiW749jbc8PKw8h4poXzyAikKeFYSSLH/ecDPcSc3UjMIFU7wUC4eR\niGEgb29QHOAYspurOeTm/dbyZ7vXMM/S84eLYElYWw7sRISCwmXJeUGsxYML\nvkClCFqO9eLgd0j/TqahVe9+i4tzQutxENzdiY1OMLgpHtPWajIIidJh5tdN\nBZTPTQ3sfLIqcDnfjZblzZHvuw0mcIpQxKifKkNwnzn30RPekjgYuG4YsGff\nuaRcFKPIp1z5H5eEp1EG48CKJd/9Oym00Gbj5cS5yf4byxJURbN47KxnVEEO\nkFISY99B2dwkQxs5GYdkJlIBNmMG8aFzE/I22aZS+1ETO45GB2JKXUKIkg1l\nMRB5j3o086UeElyOBRyRf9IlDqPLzr0S7XRllhLkGNU3po+YffUOaVU85Q8H\nHnvZ+cyQcmzYoMlTgGMdxaStZzBP2WTKQeCkEtZCIKrEMG34EZUmpTnHCCUC\n9j5h\r\n=ZepI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLexMx4bdggib+Ztp6+xnMQA3CgiETTxYB4xa9tmAK8AiEAwCs7S+bYoNqZVyRVT8VgEBYLIWQ86nFOU9SY+6CmYjs="}]},"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_3.0.0-rc.2_1611548477910_0.6112751198721065"},"_hasShrinkwrap":false},"3.0.0-rc.3":{"name":"ts-typed-events","version":"3.0.0-rc.3","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"A simple TypeScript module intended to replace EventEmitters with strongly typed events","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"7.2.6","@types/jest":"26.0.20","@typescript-eslint/eslint-plugin":"4.14.0","eslint":"7.18.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#d2068a3680e5932b61f197a9c0d5d00741dd4130","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#4cbb83846d4e1a29e95b406ed5d957bdab6b0824","eslint-plugin-import":"2.22.1","eslint-plugin-import-order-alphabetical":"1.0.1","eslint-plugin-jest":"24.1.3","eslint-plugin-jsdoc":"31.0.8","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","jest-cli":"26.6.3","npm-check-updates":"10.2.5","prettier":"2.2.1","shx":"0.3.3","ts-jest":"26.4.4","ts-node":"9.1.1","typedoc":"0.20.16","typescript":"4.1.3"},"scripts":{"build":"tsc --project ./tsconfig.build.json","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc --out docs/ --exclude test/* --entryPoints src/index.ts","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"896b18bdcc625a106c05e922cb28bcc7e8f4a411","readme":"# ts-typed-events - v3.0 Release Candidate 2\n\nStrongly typed event emitters for [TypeScript](https://www.typescriptlang.org/).\n\nThis is a TypeScript project, although the compiled source is available in the\nnpm package without any runtime dependencies, it is solely designed around the\npurpose of making events easier to work with _in TypeScript_ via the included\ndefinitions.\n\n## Purpose\n\nUsing Node's [EventEmitter](https://nodejs.org/api/events.html) class is nice;\nit's a useful software engineering paradigm. However in TypeScript you lose out\non TypeScript's robust type checking when publishing and subscribing to events.\n\nThe aim of this is to leverage TypeScript's generic types to allow for compile-\ntime type checking. We also move the events into their own class, so you don't\nhave to inherit or mixin any of our classes, just use these single Event\nemitters. It is also un-opinionated, exposing functional and object oriented\nbuild blocks in this library so you can use it best works in your project.\n\n## Examples\n\n### Importing\n\n```ts\nimport { createEventEmitter } from \"ts-typed-events\";\n```\n\n### Simple usage\n\n```ts\nconst { event, emit } = createEventEmitter();\n\nsignal.on(() => {\n    console.log(\"The event triggered!\");\n});\n\nemit(); // prints: `The event triggered!`\n```\n\n### Strongly typed events\n\n```ts\nconst { event, emit } = createEventEmitter<string>();\n\nevent.on((str) => {\n    console.log(\"hey we got the string:\", str);\n});\n\nemit(\"some string\"); // prints `hey we got the string: some string`\n```\n\n### async/await usage\n\n```ts\nconst { event, emit } = createEventEmitter<number>();\n\n// emit the event in 1 second\nsetTimeout(() => emit(1337), 1000);\n\nconst emitted = await event.once();\nconsole.log(\"1 sec later we got\", emitted);\n// printed: `1 sec later we got 1337`\n```\n\n_Note_: async only works with `once`, not `on` as that can trigger multiple\ntimes.\n\n### Multiple callbacks\n\n```ts\nconst { event, emit } = createEventEmitter<\"pizza\" | \"ice cream\">();\n\nevent.on((food) => console.log(\"I like\", food));\nevent.on((badFood) => console.log(badFood, \"is bad for me!\"));\n\nemit(\"pizza\");\n// printed: `I like pizza` followed by `pizza is bad for me!`\n```\n\n### Removing callbacks\n\n```ts\nconst { event, emit } = createEventEmitter();\n\nconst callback = () => { throw new Error(\"I don't want to be called\"); };\nevent.on(callback);\nevent.off(callback);\n\n// The callback was removed, so the Error in the callback is not thrown\nconst emitted = emit();\nconsole.log(\"were any callbacks invoked during the emit?\", emitted);\n// printed: `were any callbacks invoked during the emit? false`\n```\n\n### Alternative Syntax\n\nThe main method, `createEventEmitter`, returns the emitter function, with\nthe event and itself as properties. This makes the above examples when used\nwith destructuring look clean. However you can choose not to destructure it\nas well:\n\n```ts\nconst emit = createEventEmitter<\"something\" | undefined>();\n\nemit.event.on((something) => {\n    console.log(\"did we get something?:\", something);\n});\n\nemit(); // prints `did we get something?: undefined`\n\n// the emitter has access to itself via the `emit` key as well\nconsole.log(emit === emit.emit); // print `true`\n```\n\n### Public Events\n\nIn the above examples, the `event` and `emit` are two separate constructs.\nThis is to separate the callback and invocation logic. However there are some\ntimes when you could want an event to be able to be triggered by anything with\naccess to it.\n\n```ts\nimport { PublicEvent } from \"ts-typed-events\";\n\nconst publicEvent = new PublicEvent();\n\npublicEvent.on(() => console.log(\"someone triggered this!\"));\n\npublicEvent.emit(); // prints: `someone triggered this!`\n```\n\nYou can also use it functionally if you want to avoid classes/OOP.\n\n```ts\nimport { createPublicEventAndEmit } from \"ts-typed-events\";\n\nconst { event, emit } = createPublicEventEmitter<string>();\n\nevent.on((emitted) => console.log(`someone emitted: '${emitted}'!`));\n\nevent.emit(\"first\"); // prints: `someone emitted 'first'!`\n\n// you still can use the \"normal\" emitter too\nemit(\"second\"); // prints: `someone emitted 'second'!`\n```\n\n### Classes\n\n```ts\nclass Dog {\n    private timesBarked = 0;\n    // By keeping reference to the tuple, we have wrapped the emit function\n    // in a private variable, and only exposed the public event.\n    // This allows us to decide inside our class instances when we want to\n    // emit events.\n    private emitBarked = createEventEmit();\n    public barked = this.emitBarked.event;\n\n    public bark() {\n        this.timesBarked += 1;\n        this.emitBarked();\n    }\n}\n\nconst dog = new Dog();\ndog.barked.on(() => console.log(\"The dog barked!\"));\ndog.bark(); // prints: `The dog barked!`;\n```\n\n## Other Notes\n\nThis library leverages TypeScript's interfaces and generics very heavily to do\ntype checking at every point. If you plan to use this with regular JavaScript\nmost of this library's features are lost to you, so you'd probably be best off\nsticking to the built-in EventEmitter class.\n\n## Docs\n\nAll the functions are documented using jsdoc style comments, so your\nfavorite IDE should pick up the documentation cleanly.\n\nHowever, if you prefer external docs, they are available online here:\nhttps://jacobfischer.github.io/ts-typed-events/\n","readmeFilename":"README.md","_id":"ts-typed-events@3.0.0-rc.3","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-vjzVN3DSqeB9rDPV5cx8OGh5UOIURs/kh6gEXOqMRicyCxcKxpCKzyCQoHXmz4j7Q4l9kroBljYBaTqcfWNzIg==","shasum":"e689c5a63cd5323a624f6450fdc89335e681f7d6","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0-rc.3.tgz","fileCount":6,"unpackedSize":24744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFkC/CRA9TVsSAnZWagAAEOoP/jhoeh4XTvnho2mWSJ4g\n10qfQrFgzG8ntYzWXSP2F3UUFbCjbSeVq9I5t94Ti+eZDGnnV07CeazXu+9U\nHyybF/oBCu8CVL/kwM5oIUqlzF4yLlW24GxUT5N8oliTYqabmYTFElcw0rkx\n8l5Ie1/kXfIxM79DAkHcgW9s2TnDC2XiUtwskLAf8wJM05+jL/jZYCNWmI2d\nssW6memDeONiyXtIu8YjB2xaut/hLbXBxOmhnUMm3yZXYzdawEmaAEzXJwpG\nWD77Tm+DAwmgym63LeZCSAy5stDYAszYZATR6jrWZURsZb9u8gqSRcGwn0vY\n3UPTdJDBMbKosMbfp5wEvg1DgKZ9Mqu141oJLwcP/ncw6GK0zjbaGl/q+Bev\n9JROGhU+pLdHO/F3BfQVBDR3vh+tHpK6uLThZMFv4ipx4IfMjEXYPFPJCsKv\n3Fs7RGo0JH4rXs85+t4yDGpRZmrVhdUFadjtoaIVY4Tv/+uMRKjpUSCHd6vV\na6XRjALorMuU4cyLAO9JS4OI8AwLgsT3qQdQ3N1bfEuuWL/hjn4yoQclkmuf\nyi+ZKNX3PcrGPsrErmCWLuk92NmcOLhx9dClayb0u+1Rrnz/82Kpoq0jB7wi\nGUOpW0wxx40B6vS+ryZ4vZDn/pjO+069o++cZIx7IAkW/YDvJbYrjG+IclkJ\nWWoJ\r\n=mu6M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvbTaSz8x09JYq/9WeqOF9al0zdMmDvRouOrRQ5DySBQIhANC7UvJvGdWdSAyxiEl1Cd59r9lEOaLL9wJCNzDF/h8+"}]},"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_3.0.0-rc.3_1612071102798_0.26704060382530237"},"_hasShrinkwrap":false},"3.0.0-rc.4":{"name":"ts-typed-events","version":"3.0.0-rc.4","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"Strongly typed event emitters for TypeScript","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"7.2.6","@types/jest":"26.0.20","@typescript-eslint/eslint-plugin":"4.14.0","eslint":"7.18.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#d2068a3680e5932b61f197a9c0d5d00741dd4130","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#4cbb83846d4e1a29e95b406ed5d957bdab6b0824","eslint-plugin-import":"2.22.1","eslint-plugin-import-order-alphabetical":"1.0.1","eslint-plugin-jest":"24.1.3","eslint-plugin-jsdoc":"31.0.8","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","jest-cli":"26.6.3","npm-check-updates":"10.2.5","prettier":"2.2.1","shx":"0.3.3","ts-jest":"26.4.4","ts-node":"9.1.1","typedoc":"0.20.16","typescript":"4.1.3"},"scripts":{"build":"tsc --project ./tsconfig.build.json","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc --out docs/ --exclude test/* --entryPoints src/index.ts","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"986a7e8ba80e9e5784d25f803a3253ff1e062186","readme":"# ts-typed-events\n\nStrongly typed event emitters for [TypeScript](https://www.typescriptlang.org/).\n\nThis is a TypeScript project, although the built code is available in the\npackage without any runtime dependencies, it is solely designed around the\npurpose of making events easier to work with _in TypeScript_ via the included\ndefinitions.\n\n## Purpose\n\nUsing Node's [EventEmitter](https://nodejs.org/api/events.html) class is nice;\nit's a useful software engineering paradigm. However in TypeScript you lose out\non TypeScript's robust type checking when publishing and subscribing to events.\n\nThe aim of this is to leverage TypeScript's generic types to allow for compile-\ntime type checking. We also move the events into their own class, so you don't\nhave to inherit or mixin any of our classes, just use these single Event\nemitters. It is also un-opinionated, exposing functional and object oriented\nbuild blocks in this library so you can use it best works in your project.\n\n## Examples\n\n### Importing\n\n```ts\nimport { createEventEmitter } from \"ts-typed-events\";\n```\n\n### Simple usage\n\n```ts\nconst { event, emit } = createEventEmitter();\n\nsignal.on(() => {\n    console.log(\"The event triggered!\");\n});\n\nemit(); // prints: `The event triggered!`\n```\n\n### Strongly typed events\n\n```ts\nconst { event, emit } = createEventEmitter<string>();\n\nevent.on((str) => {\n    console.log(\"hey we got the string:\", str);\n});\n\nemit(\"some string\"); // prints `hey we got the string: some string`\n```\n\n### async/await usage\n\n```ts\nconst { event, emit } = createEventEmitter<number>();\n\n// emit the event in 1 second\nsetTimeout(() => emit(1337), 1000);\n\nconst emitted = await event.once();\nconsole.log(\"1 sec later we got\", emitted);\n// printed: `1 sec later we got 1337`\n```\n\n_Note_: async only works with `once`, not `on` as that can trigger multiple\ntimes.\n\n### Multiple callbacks\n\n```ts\nconst { event, emit } = createEventEmitter<\"pizza\" | \"ice cream\">();\n\nevent.on((food) => console.log(\"I like\", food));\nevent.on((badFood) => console.log(badFood, \"is bad for me!\"));\n\nemit(\"pizza\");\n// printed: `I like pizza` followed by `pizza is bad for me!`\n```\n\n### Removing callbacks\n\n```ts\nconst { event, emit } = createEventEmitter();\n\nconst callback = () => { throw new Error(\"I don't want to be called\"); };\nevent.on(callback);\nevent.off(callback);\n\n// The callback was removed, so the Error in the callback is not thrown\nconst emitted = emit();\nconsole.log(\"were any callbacks invoked during the emit?\", emitted);\n// printed: `were any callbacks invoked during the emit? false`\n```\n\n### Alternative Syntax\n\nThe main method, `createEventEmitter`, returns the emitter function, with\nthe event and itself as properties. This makes the above examples when used\nwith destructuring look clean. However you can choose not to destructure it\nas well:\n\n```ts\nconst emit = createEventEmitter<\"something\" | undefined>();\n\nemit.event.on((something) => {\n    console.log(\"did we get something?:\", something);\n});\n\nemit(); // prints `did we get something?: undefined`\n\n// the emitter has access to itself via the `emit` key as well\nconsole.log(emit === emit.emit); // print `true`\n```\n\n### Public Events\n\nIn the above examples, the `event` and `emit` are two separate constructs.\nThis is to separate the callback and invocation logic. However there are some\ntimes when you could want an event to be able to be triggered by anything with\naccess to it.\n\n```ts\nimport { PublicEvent } from \"ts-typed-events\";\n\nconst publicEvent = new PublicEvent();\n\npublicEvent.on(() => console.log(\"someone triggered this!\"));\n\npublicEvent.emit(); // prints: `someone triggered this!`\n```\n\nYou can also use it functionally if you want to avoid classes/OOP.\n\n```ts\nimport { createPublicEventEmitter } from \"ts-typed-events\";\n\nconst { event, emit } = createPublicEventEmitter<string>();\n\nevent.on((emitted) => console.log(`someone emitted: '${emitted}'!`));\n\nevent.emit(\"first\"); // prints: `someone emitted 'first'!`\n\n// you still can use the \"normal\" emitter too\nemit(\"second\"); // prints: `someone emitted 'second'!`\n```\n\n### Classes\n\n```ts\nclass Dog {\n    private timesBarked = 0;\n    // By keeping reference to the tuple, we have wrapped the emit function\n    // in a private variable, and only exposed the public event.\n    // This allows us to decide inside our class instances when we want to\n    // emit events.\n    private emitBarked = createEventEmit();\n    public barked = this.emitBarked.event;\n\n    public bark() {\n        this.timesBarked += 1;\n        this.emitBarked();\n    }\n}\n\nconst dog = new Dog();\ndog.barked.on(() => console.log(\"The dog barked!\"));\ndog.bark(); // prints: `The dog barked!`;\n```\n\n## Other Notes\n\nThis library leverages TypeScript's interfaces and generics very heavily to do\ntype checking at every point. If you plan to use this with regular JavaScript\nmost of this library's features are lost to you, so you'd probably be best off\nsticking to the built-in EventEmitter class.\n\n## Docs\n\nAll the functions are documented using jsdoc style comments, so your\nfavorite IDE should pick up the documentation cleanly.\n\nHowever, if you prefer external docs, they are available online here:\nhttps://jacobfischer.github.io/ts-typed-events/\n","readmeFilename":"README.md","_id":"ts-typed-events@3.0.0-rc.4","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-FpW8gYsR6qItLGT8/g9qYvax42I6tt8Y824uESSbE5BGqa0Z1HGRe0nfM3ZW+MPRvh2X3iJd7iGvOQ83nA/Kng==","shasum":"8597aac550481ea8818d2e30dcb307ca64908309","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0-rc.4.tgz","fileCount":6,"unpackedSize":24438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJ9+NCRA9TVsSAnZWagAAn4cP/1ssiYGFPIdtcXbHu58R\nwmNmWKhBt3HdOoo/C2pZR88AAeTbPsUvJIXkWRAF65wTgvaiBs0z/8Fy6j7+\nV/8gzbCtaTB51ZFIodKPs8M2AFqoqg/BAodbJa/sz95Hb+sZWyevrCLZm9Qp\nbtBH6M4EWE5L0iC0EhM2xMo9PIC3UF4mWEjKTv6lOBm248Ke+tcXdorvVFfY\n33ZDGv33oybXpXAfWy2WUZTaBRUQSHzNebRZF4LGEvmAeLKZtwkgtKbGb8Z/\nnBDEfWj9xos9YgMCrIMPKMc7Airh6OJ+hXkWv5vFnhluPEXo9nQmdyo0q4e8\nSZKVT6UlP6O7t8vRfgsEf2xB5Y5Y19r62fqx1J+3hEXKPvHSjT0q515pf7wO\nF0Cb0FTC3BBbM1UeFdWWBBC0OM8iUPx3RAezQxHSh2Xr48mIT0KZZNpqGh/A\n/QwRCxtTzlIG6UmkH7Rde3KZIlnuhIY0QNBXGbkUNUIwT3SUvKqnqg1ZhES2\nOz8AdVw1qJjSCaEd9CAjzmE67Ld1Rk/Ykg/GFxVlSpcvX9Wwkq7zKo0JBPJ9\nU2c7jB4t9ZppOhoWOJ+OjKjx4Q0A+MjdM7WJG+jVcevlWGB5DDDkYtCsETEl\nDpyWyZVhrVczK78LlYuCPATYlEGYZqRXMJJDN3aJG1/Zry4NOUT64Gk/5DEO\nT3md\r\n=frdU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmcXldTjoiVvDS0yQOvx0oJBtL/7VZYZrXhmsq7/vV3AIhALl5twNUexuiQ6pmv+ODBzxhjVHd8u/79pPipii2iBT4"}]},"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_3.0.0-rc.4_1613225868858_0.46992189225105596"},"_hasShrinkwrap":false},"3.0.0-rc.5":{"name":"ts-typed-events","version":"3.0.0-rc.5","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"Strongly typed event emitters for TypeScript","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"7.2.6","@types/jest":"26.0.20","@typescript-eslint/eslint-plugin":"4.15.0","eslint":"7.20.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#d3ecf89151932989003e837dd11fd8d0715d5a69","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#4cbb83846d4e1a29e95b406ed5d957bdab6b0824","eslint-plugin-import":"2.22.1","eslint-plugin-import-order-alphabetical":"1.0.1","eslint-plugin-jest":"24.1.3","eslint-plugin-jsdoc":"31.6.1","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","jest-cli":"26.6.3","npm-check-updates":"11.1.3","prettier":"2.2.1","shx":"0.3.3","ts-jest":"26.5.1","ts-node":"9.1.1","typedoc":"0.20.24","typescript":"4.1.5"},"scripts":{"build":"tsc --project ./tsconfig.build.json","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc --out docs/ --exclude test/* --entryPoints src/index.ts","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"bf12a0efebb49b9382eb9b395eca546a69bff2e1","readme":"# ts-typed-events\n\nStrongly typed event emitters for [TypeScript].\n\nThis is a TypeScript project, although the built code is available in the\npackage without any runtime dependencies, it is solely designed around the\npurpose of making events easier to work with _in TypeScript_ via the included\ndefinitions.\n\n## Purpose\n\nUsing Node's [EventEmitter class] is nice; it's a useful software engineering\nparadigm. However in TypeScript you lose out on TypeScript's robust type\nchecking when publishing and subscribing to events; or you must write very\nbrittle function overloads for _every function_: `on`, `off`, `once`, `emit`,\netc. This is annoying and tedious.\n\nThe aim of this is to leverage TypeScript's generics to allow for compile-time\ntype checking. We also move the events into their own functions, so you don't\nhave to inherit or mixin any of our classes, just use these single Event\nemitters. It is also un-opinionated, exposing functional and object oriented\nbuilding blocks in this library so you can use it best works in your project.\n\n## Examples\n\n### Simple usage\n\nWith classes\n\n```ts\nimport { Event } from 'ts-typed-events';\n\nconst event = new Event();\n\nevent.on(() => {\n  console.log('The event triggered!');\n});\n\nevent.emit(); // prints: `The event triggered!`\n```\n\n_or_ with functions\n\n```ts\nimport { createEmitter } from 'ts-typed-events';\n\nconst { emit, event } = createEmitter();\n\nevent.on(() => {\n  console.log('The event triggered!');\n});\n\nemit(); // prints: `The event triggered!`\n```\n\n### Strongly typed events\n\n```ts\nconst event = new Event<string>();\n\nevent.on((str) => {\n  console.log('hey we got the string:', str);\n});\n\nevent.emit('some string'); // prints `hey we got the string: some string`\n```\n\n### async/await usage\n\nYou can register event listeners via traditional callbacks, or if no callback is\nsupplied to `event.once()`, a Promise is returns you can `await`.\n\n```ts\nconst event = new Event<number>();\n\n// emit the event in 1 second\nsetTimeout(() => event.emit(1337), 1000);\n\nconst emitted = await event.once();\nconsole.log('1 sec later we got', emitted);\n// printed: `1 sec later we got 1337`\n```\n\n_Note_: async only works with `once`, not `on` as that can trigger multiple\ntimes.\n\n### Multiple callbacks\n\n```ts\nconst event = new Event<'pizza' | 'ice cream'>();\n\nevent.on((food) => console.log('I like', food));\nevent.on((badFood) => console.log(badFood, 'is bad for me!'));\n\nevent.emit('pizza');\n// printed: `I like pizza` followed by `pizza is bad for me!`\n```\n\n### Removing callbacks\n\n```ts\nconst event = new Event();\n\nconst callback = () => { throw new Error(`I don't want to be called`); };\nevent.on(callback);\nevent.off(callback);\n\n// The callback was removed, so the Error in the callback is not thrown\nconst emitted = event.emit();\nconsole.log('were any callbacks invoked during the emit?', emitted);\n// printed: `were any callbacks invoked during the emit? false`\n```\n\n### Combining this within Classes\n\nAs this module intends to replace the \"built-in\" [EventEmitter class], you\ncan use it much more freely because it is not a class you **must** inherit like\nwith the [EventEmitter class]. To replicate similar functionality you can make\neach event a separate member variable of your.\n\n```ts\nclass Dog {\n  private timesBarked = 0;\n  // NOTE: the emitter is private here, and the event is public.\n  // This allows the class to completely control when it emits.\n  private emitBarked = createEmitter();\n\n  public barked = this.emitBarked.event;\n\n  public bark() {\n    this.timesBarked += 1;\n    this.emitBarked();\n  }\n}\n\nconst dog = new Dog();\ndog.barked.on(() => console.log('The dog barked!'));\ndog.bark(); // prints: `The dog barked!`;\n```\n\n### Alternative Syntax\n\nThe method, `createEmitter`, returns the emitter function, with\nthe event and itself as properties. This makes the above examples when used\nwith destructuring look clean. However you can choose not to destructure it\nas well:\n\n```ts\nconst emit = createEmitter<'something' | undefined>();\n\nemit.event.on((something) => {\n  console.log('did we get something?:', something);\n});\n\nemit(); // prints `did we get something?: undefined`\n\n// the emitter has access to itself via the `emit` key as well\nconsole.log(emit === emit.emit); // print `true`\n```\n\n#### Sealed Events\n\nThe `Event` class has exposed the member function `emit`, which means any bit\nof code that can your event to listen, can also act as an event emitter.\n\nOften you'll find you do not want to trust bits of code with that\nresponsibility. To that end this module exposes an alternative type of events\nand API to generate Events called `SealedEvents` that cannot self emit, and\na separate emitter function\n\n```ts\nimport { createEmitter, SealedEvent } from 'ts-typed-events';\n\nconst { event, emit } = createEmitter<BigInt>();\n\nevent instanceof SealedEvent; // true\n\nevent.on((int) => {\n  console.log('Emitted BigInt:', int);\n});\n\nemit(1337n); // prints: 'Emitted BigInt: 1337'\n\n'emit' in event; // === false\n```\n\n**Note**: you can also use `createEventEmitter` if you wish the `event` type to\nbe `instanceof Event`. However bear in mind that event has access to the\nemitter. This module exposes both for API uniformity.\n\n## Other Notes\n\nThis library leverages TypeScript's interfaces and generics very heavily to do\ntype checking at every point. If you plan to use this with regular JavaScript\nmost of this library's features are lost to you. However do not let that deter\nyou from trying this, or [TypeScript]!\n\n## Docs\n\nAll the functions are documented using jsdoc style comments, so your\nfavorite IDE should pick up the documentation cleanly.\n\nHowever, if you prefer external docs, they are available online here:\nhttps://jacobfischer.github.io/ts-typed-events/\n\n[TypeScript]: https://www.typescriptlang.org/\n[EventEmitter class]: https://nodejs.org/api/events.html#events_class_eventemitter\n","readmeFilename":"README.md","_id":"ts-typed-events@3.0.0-rc.5","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-E8CFXnJSD7mBDw6T4pXQCSGN9nzRxSq9SxDL5AEy83p09aPXw2DLLX0An7CyOdQqoM93tmUvfqjQ7uaPgiHo1g==","shasum":"a3d73128e8ceca6f1125ad29be71b651606c87a9","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0-rc.5.tgz","fileCount":6,"unpackedSize":25229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMvcQCRA9TVsSAnZWagAAXOkP/2v2zleSx57DB6Yu7UHm\nhCEj95TH9Qw9AY0HoejSbDn6ThsHh0wrWQiD2UDZiyhHx3eINthVYzw4Wu+D\naFhwOgjGeHpr8H9+LX5x1WRmDSu+yxTrP+GX2GkpTTT4+Rlqw7yrQSdNFR7A\nh1RZaLWIP5mlr8qcxxlKG9McKzbS2J/3DnffN5TI2/CfLwRO2w0ew0Pf+arC\nElvSLQU0x72zubYAs1nTogcH+QJwsBAijZMl7HVDD/p6gKCDLIeuJdAosh7p\nTwbXCNbbB5daiaSFRnUtJYM07YWszZiEjDhCdgjsJT/M4YPKmdY24ZoOLVnv\nbVoHfpRwFnCMBuvKqDgE0TgYQYtcqfc26cjbsQmQ1q/sAWCGPjSDOHBZPIs1\nBcvHUC61Hy0D6dPejs0LFheAT2dcmY9fpX/9vcJlgfq6rWkH7OhgbiKboUuV\n4st/NLmwBj8dFW2F2mMGnqw7ZIxdqFTCdHvy0Ba/wN2q1HnsT/2CexMgO6n3\nrHZhXTjqeNCqJyw5L+wdXXU0Zt7HD9+rGz5rVAAKyKvZPOHWIz25NeKUhQuE\nrgclKSkKay7W150DfidqLUcCASod3N6a1anbi5WD5gHsBCjO7xc9Rkwq1+Bu\nrlKkYRcaHvFBSAwHJn01ZR7kHGW1hrMQcCpD6VTys5WJa6+BCQ3hs2y8W7JK\nbk2b\r\n=wS9C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRHtrp6ZkV0ORroQNNeYp8G4ahVcgCgRwLZVB8SPIhZgIhAJ2JGvCi+f6XL67dbYeI83sYTvXB0NDqgt3GXV9xZmUl"}]},"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_3.0.0-rc.5_1613952783767_0.30836771031694865"},"_hasShrinkwrap":false},"3.0.0":{"name":"ts-typed-events","version":"3.0.0","author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"description":"Zero dependency strongly typed event emitters for TypeScript","homepage":"https://jacobfischer.github.io/ts-typed-events/","license":"MIT","repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"@types/eslint":"7.2.6","@types/jest":"26.0.20","@typescript-eslint/eslint-plugin":"4.15.2","eslint":"7.21.0","eslint-config-jacobfischer":"git://github.com/JacobFischer/eslint-config.git#d3ecf89151932989003e837dd11fd8d0715d5a69","eslint-config-jacobfischer-jest":"git://github.com/JacobFischer/eslint-config-jest.git#4cbb83846d4e1a29e95b406ed5d957bdab6b0824","eslint-plugin-import":"2.22.1","eslint-plugin-import-order-alphabetical":"1.0.1","eslint-plugin-jest":"24.1.5","eslint-plugin-jsdoc":"32.2.0","eslint-plugin-prettier":"3.3.1","jest":"26.6.3","jest-cli":"26.6.3","npm-check-updates":"11.1.9","prettier":"2.2.1","shx":"0.3.3","ts-jest":"26.5.2","ts-node":"9.1.1","typedoc":"0.20.28","typescript":"4.1.5"},"scripts":{"build":"tsc --project ./tsconfig.build.json","build:watch":"tsc --watch","clean":"npm run clean:dist && npm run clean:docs","clean:docs":"shx rm -rf docs/","clean:dist":"shx rm -rf dist/","docs":"typedoc src/index.ts --out docs/ --exclude \"(dist|test)/*\"","docs:predeploy":"shx touch docs/.nojekyll","lint":"eslint ./ --max-warnings=0","prettier:base":"prettier **/*.{js,jsx,ts,tsx}","prettier":"npm run prettier:base -- --write","prettier:check":"npm run prettier:base -- --check","test":"jest --env=node --config ./test/jest.config.js --colors --coverage test","ncu":"ncu -u"},"keywords":["event","events","ts","TypeScript","events","typing"],"gitHead":"04734b5de39c430536434c503fb46dc427a654f3","_id":"ts-typed-events@3.0.0","_nodeVersion":"15.6.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-+2FZ0XPX+UPR7PO8ZQjuvnuDMYRhzrDaCRaNHaBG1xSL//0oPa3XMU5yxgDTzW67VzkE33fQpx1YxWBdkaF7Zw==","shasum":"2f9d96ff962edfc936402c859370337373880faa","tarball":"https://registry.npmjs.org/ts-typed-events/-/ts-typed-events-3.0.0.tgz","fileCount":6,"unpackedSize":25596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgO74+CRA9TVsSAnZWagAAzOkQAJA4L2Vp3akxhaETB4O4\nd/0b/bfN6rqwrG7Biw1jEalfACcW/7p8n9q6hhYXxWkOuku23BfyeZCrvq56\n6044GXNYVIhdfp+z3J28ClM9SwzOWQtPE5m8SDjOG3nJnSZbgVkkGJN4uxXv\ntA0xgy4+rhWfcAFPbyuNo26ZpGm9in/vPlKlq1jXXm40Iu9Nh8OiLu01WWaz\nlVW01btcyujWPNcqj+J6QuL33Xwh3FyBE3MHTr8ntl9pIYmkL9hEbWtj26Cs\niXsI5khS4QRhVsasS3i1fD3ppnG4BQy3Np9eTsb4C0TZk2qI6KcPX4xF0v69\nSo8FRbdMIhZsn7RvM7WS7zDjlBb3JfPUoAAm/H+0D36IZtWwgi38SHAAmEbj\nZ2e5+cvLkdHvrTNhgJGNMV+XososRku0osZXk88av0aBIp25m1ogfbqAQhz0\nEEptGo4K56Wu4aVNMadUb9zLF4iKk1+lK56zphg1xhsLOauQ4jYcwi6/izxN\n9aSWEl0mjkndbEeQFIkQyqO9AadeM3ljdsNpGDc+TfDDlmhRZ3dZiWEGOp/s\n68PGB4hKgLRCmQes12rk/o7o8lSj8k4iNWdcVwFTzmfTrUeOeaRFDuwggUVz\nWxBdUHjWjQA5GXbyaY20tHBVLth0+jbSOQrTZxJ6rZ/D+Z7QSrSUpinNQxgw\n3X8d\r\n=9H2D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzeKE0xhcM+PkiGKwzszt4ojF1emqEzt9Gk0qdJ2E3fAiEAnpg+iiPlOHHqtilb9LkLfx8HHGbeLx+uXUBi+RuLQSc="}]},"_npmUser":{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"},"directories":{},"maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-typed-events_3.0.0_1614528061835_0.3272645292983112"},"_hasShrinkwrap":false}},"readme":"# ts-typed-events\n\nZero dependency strongly typed event emitters for [TypeScript].\n\n## Purpose\n\nUsing Node's [EventEmitter class] is nice; it's a useful software engineering\nparadigm. However in TypeScript you lose out on TypeScript's robust type\nchecking when publishing and subscribing to events; or you must write very\nbrittle function overloads for _every function_: `on`, `off`, `once`, `emit`,\netc. This is annoying and tedious.\n\nThe aim of this is to leverage TypeScript's generics to allow for build-time\ntype checking. We also move the events into their own functions, so you don't\nhave to inherit or mixin any of our classes; just use these single Event\nemitters. It is also un-opinionated, exposing functional and object oriented\nbuilding blocks in this library so you can use it best works in your project.\n\n## Examples\n\n### Simple usage\n\nWith classes\n\n```ts\nimport { Event } from 'ts-typed-events';\n\nconst event = new Event();\n\nevent.on(() => {\n  console.log('The event triggered!');\n});\n\nevent.emit(); // prints: `The event triggered!`\n```\n\n_Or_ with functions\n\n```ts\nimport { createEmitter } from 'ts-typed-events';\n\nconst { emit, event } = createEmitter();\n\nevent.on(() => {\n  console.log('The event triggered!');\n});\n\nemit(); // prints: `The event triggered!`\n```\n\n### Strongly typed events\n\n```ts\nconst event = new Event<string>();\n\nevent.on((str) => {\n  console.log('hey we got the string:', str);\n});\n\n// this emit function requires an argument of type `string`\nevent.emit('some string'); // prints `hey we got the string: some string`\n```\n\n### async/await usage\n\nYou can register event listeners via traditional callbacks, or if no callback is\nsupplied to `event.once()`, a Promise is returned that you can `await`.\n\n```ts\nconst event = new Event<number>();\n\n// emit the event in 1 second\nsetTimeout(() => event.emit(1337), 1000);\n\nconst emitted = await event.once();\nconsole.log('1 sec later we got', emitted);\n// printed: `1 sec later we got 1337`\n```\n\n_Note_: async only works with `once`, not `on` as that can trigger multiple\ntimes.\n\n### Multiple callbacks\n\n```ts\nconst event = new Event<'pizza' | 'ice cream'>();\n\nevent.on((food) => console.log('I like', food));\nevent.on((badFood) => console.log(badFood, 'is bad for me!'));\n\nevent.emit('pizza');\n// printed: `I like pizza`, followed by: `pizza is bad for me!`\n```\n\n### Removing callbacks\n\n```ts\nconst event = new Event();\n\nconst callback = () => { throw new Error(`I don't want to be called`); };\nevent.on(callback);\nevent.off(callback);\n\n// The callback was removed, so the Error in the callback is not thrown\nconst emitted = event.emit();\nconsole.log('were any callbacks invoked during the emit?', emitted);\n// printed: `were any callbacks invoked during the emit? false`\n```\n\n### Combining this within Classes\n\nAs this module intends to replace the \"built-in\" [EventEmitter class], you\ncan use it much more freely because it is not a class you **must** inherit like\nwith the [EventEmitter class]. To replicate similar functionality you can make\neach event a separate member variable of your.\n\n```ts\nclass Dog {\n  private timesBarked = 0;\n  // NOTE: the emitter is private here, and the event is public.\n  // This allows the class to completely control when it emits.\n  private emitBarked = createEmitter();\n\n  public barked = this.emitBarked.event;\n\n  public bark() {\n    this.timesBarked += 1;\n    this.emitBarked();\n  }\n}\n\nconst dog = new Dog();\ndog.barked.on(() => console.log('The dog barked!'));\ndog.bark(); // prints: `The dog barked!`;\n```\n\n### `createEmitter` alternative Syntax\n\nThe method `createEmitter` returns an emitter function, with the event and\nitself as properties. This makes the above examples when used with destructuring\nlook clean. However you can choose not to destructure it as well:\n\n```ts\nconst emit = createEmitter<'something' | undefined>();\n\nemit.event.on((something) => {\n  console.log('did we get something?:', something);\n});\n\nemit(); // prints `did we get something?: undefined`\nemit.emit('something'); // prints `did we get something?: something`\n\n// the emitter has access to itself via the `emit` key as well\nconsole.log(emit === emit.emit); // prints `true`\n```\n\n#### Sealed Events\n\nThe `Event` class has exposed the member function `emit`, which means any bit\nof code that can register as a listener on your event, can also force that event\nto emit.\n\nOften you do not want to trust bits of code with that responsibility. For that\ncommon use case this module exposes an alternative type of events\nand API to generate Events called `SealedEvents` that cannot self emit, and\na separate emitter function to handle the emitting logic.\n\n```ts\nimport { createEmitter, SealedEvent } from 'ts-typed-events';\n\nconst { event, emit } = createEmitter<BigInt>();\n\nevent instanceof SealedEvent; // true\n'emit' in event; // === false\n\nevent.on((int) => {\n  console.log('Emitted BigInt:', int);\n});\n\nemit(1337n); // prints: 'Emitted BigInt: 1337'\n```\n\n**Note**: you can also use `createEventEmitter` if you wish the `event` type to\nbe `instanceof Event`. Keep in mind that regular `Event` instances have access\nto their emitter via `.emit`. This module exposes both variants for API\nuniformity.\n\n## Other Notes\n\nThis library leverages TypeScript's interfaces and generics very heavily to do\ntype checking at every point. If you plan to use this with regular JavaScript\nmost of this library's features are lost to you. However do not let that deter\nyou from trying this, or [TypeScript]!\n\n## Docs\n\nAll the functions are documented using jsdoc style comments, so your\nfavorite IDE should pick up the documentation cleanly.\n\nHowever, if you prefer external docs, they are available online here:\nhttps://jacobfischer.github.io/ts-typed-events/\n\n[TypeScript]: https://www.typescriptlang.org/\n[EventEmitter class]: https://nodejs.org/api/events.html#events_class_eventemitter\n","maintainers":[{"name":"jacobfischer","email":"jacob.t.fischer@gmail.com"}],"time":{"modified":"2022-05-22T08:00:33.584Z","created":"2017-09-20T22:05:38.788Z","1.0.0":"2017-09-20T22:05:38.788Z","1.0.1":"2017-09-20T23:19:35.443Z","1.0.2":"2018-01-01T01:20:49.745Z","1.1.0":"2018-01-01T02:17:02.395Z","1.1.1":"2018-01-06T05:39:19.465Z","2.0.0":"2020-05-20T00:10:44.757Z","3.0.0-rc.1":"2021-01-24T00:21:58.311Z","2.0.1":"2021-01-25T01:01:24.146Z","3.0.0-rc.2":"2021-01-25T04:21:18.056Z","3.0.0-rc.3":"2021-01-31T05:31:43.000Z","3.0.0-rc.4":"2021-02-13T14:17:49.058Z","3.0.0-rc.5":"2021-02-22T00:13:03.929Z","3.0.0":"2021-02-28T16:01:01.970Z"},"homepage":"https://jacobfischer.github.io/ts-typed-events/","keywords":["event","events","ts","TypeScript","events","typing"],"repository":{"type":"git","url":"git://github.com/JacobFischer/ts-typed-events.git"},"author":{"name":"Jacob Fischer","email":"jacob.t.fischer@gmail.com","url":"https://github.com/JacobFischer"},"bugs":{"url":"https://github.com/JacobFischer/ts-typed-events/issues"},"license":"MIT","readmeFilename":"README.md"}