{"_id":"@byzanteam/carbonium-timer","_rev":"8-13979137aa79168ffb99db488eae7dd4","name":"@byzanteam/carbonium-timer","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@byzanteam/carbonium-timer","version":"0.1.0","keywords":["Carbonium","Timer"],"author":{"name":"vanppo","email":"vanppo@hotmail.com"},"license":"MIT","_id":"@byzanteam/carbonium-timer@0.1.0","maintainers":[{"name":"cdbigdata","email":"939950559@qq.com"},{"name":"admiral.coco","email":"solar.pom@gmail.com"},{"name":"vanppo","email":"vanppo@hotmail.com"}],"homepage":"https://github.com/Byzanteam/carbonium-timer#readme","bugs":{"url":"https://github.com/Byzanteam/carbonium-timer/issues"},"dist":{"shasum":"1ae80f2075b64b9c17a882397ca536a98a41fe99","tarball":"https://registry.npmjs.org/@byzanteam/carbonium-timer/-/carbonium-timer-0.1.0.tgz","fileCount":11,"integrity":"sha512-giJ9/LPrq+6OsRLbcc78skaCZ+1qOy4eDrFqF47KVDIgO/2RiyyZaA905nCpfpHsIm3YsjmF2gEYNY5ruEWn9Q==","signatures":[{"sig":"MEUCICjv5Al8VSXfQ17GTtUE8xv8PvnG+c6/LK6k7tOhN49wAiEAq/2DuiG4k/irski7Y1nnOD0z9RFWINrsZa4V3+Iz988=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":30319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3U4/CRA9TVsSAnZWagAAROoP/R+duch9NYmrbwLj8qVK\n3orZ63/ZRsv2DRTtChfi1vn2HaZ5V9r10POyvKWh1IzGZ/5fkza5kaTtt9CR\ntroTqYIRrVta7vIQ9d1kBzbN02UT3JX0kuxhjhudHjWcUlncix4Q2OcG8CXv\nybaLFxS4BRNAEoNzvWOV16125EBV1w5dIsIcwWhWHU7+Pw3h7KIbba/B1rEJ\nH4wlDdjJs7VXh3r3ubpT5qWBPcYJu12FTukhvASoWFKzpDirKINNOIUwJBRS\nxcliYj0BnKPOFrwgWAeweVBxZHqUp6HzVz70NSNevl7hnFZspOXQ04/viukC\nelhJTiYx9oo9AqnZPNYWtkyLs9nqOlAXIGIQtsOHk08nd3ugoSiEifopGr3k\nOZ3b8r1uhZLjxXlC9pA5vCIJ8QA/5sJpY4+ReCXaByuQSGkJxc5CGYVESB4c\nMLWBUU1+R4sdtFJZ6RtU3yO/ZQ+TgHXXdhvcKM9HnU8lnDwM3xYb9rjFrdxp\nOaTrEbBAGYsTiqO4sBR71tfV/IJjFjJ4gc7I1IH0Chd1HNkSOI5HIA4fPNss\nrzshxWxeCaBUKrTgVO0JfZh7KaBzBeOPHwCr3kA3BW3yTMtgendVPUqPO5gc\nA2FHnBRxq7bAIcmLIavyiqeRuOAVelKT1WonYylQOGO21Ip0tmN5cwxvpQcy\nkaJQ\r\n=Dtr2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"types/index.d.ts","module":"dist/index.es.js","gitHead":"8b2f4866c2cefabba85d0713d5e1f1fe5a2d487d","scripts":{"test":"jest","build":"rollup -c rollup.config.js","clean":"rm -rf dist types","prepack":"npm run build"},"_npmUser":{"name":"vanppo","email":"vanppo@hotmail.com"},"deprecated":"This module is now available at @byzanteam/timer","repository":{"url":"git+https://github.com/Byzanteam/carbonium-timer.git","type":"git"},"_npmVersion":"6.4.1","description":"Timer for Carbonium","directories":{},"_nodeVersion":"8.12.0","dependencies":{"bezier-easing":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.8.0","rollup":"^1.12.0","ts-jest":"^24.0.2","typescript":"^3.4.5","@types/jest":"^24.0.12","rollup-plugin-commonjs":"^10.0.0","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-typescript2":"^0.21.0","rollup-plugin-node-resolve":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/carbonium-timer_0.1.0_1558007358442_0.9610281865669421","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@byzanteam/carbonium-timer","version":"0.1.1","keywords":["Carbonium","Timer"],"author":{"name":"vanppo","email":"vanppo@hotmail.com"},"license":"MIT","_id":"@byzanteam/carbonium-timer@0.1.1","maintainers":[{"name":"admiral.coco","email":"solar.pom@gmail.com"},{"name":"cdbigdata","email":"939950559@qq.com"},{"name":"vanppo","email":"vanppo@hotmail.com"}],"homepage":"https://github.com/Byzanteam/carbonium-timer#readme","bugs":{"url":"https://github.com/Byzanteam/carbonium-timer/issues"},"dist":{"shasum":"ded726d2de50f90b801bdc06508b2c81492bf993","tarball":"https://registry.npmjs.org/@byzanteam/carbonium-timer/-/carbonium-timer-0.1.1.tgz","fileCount":11,"integrity":"sha512-17x29ke4GhK1UteIcRMmNwue0W+R6U7JO+TTe4Ukd+p3SQc7R5AZDYG5v2yi+NDZDikDXBNpc9Kb9Qb2wmAcHQ==","signatures":[{"sig":"MEQCIA88LN/II4nEv4P2wrAmvMvKh0uujZYol5CH/RD2Y9VMAiAUD+p1EDDAmr70A8NEPrekVtavFdz0XsQ6RISABRNuZA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3h/OCRA9TVsSAnZWagAAwQQP/Rxrsooi2ZYNzy2+EqMr\nebsrfO61nGu6uZ5Wu2wr34GHTBja9P3gZsEmU31zMVnarnv9XWVO0b6Mi7G4\nqh2PPgspay9m6C9s+yA32FPoxgBH8teo9/k8tDgdKUSUIvG+scHuZoeq5/LZ\njkgidPWY0yiKf+mMXnH7THYdrrS6aJwSdhzITLbc4LjbdjesusYK4Rvl7M3g\nOiwsdBkdKQtFgoNiR3hRMiJbXc3C9ZjaiTrKRi6N51yGuBCr9pHSoVOJGdFh\nFGnop6ofy2G78+iq+mKy8O4mMg9gOsRLnjrO4BMhSFNcWl4Hb09Pj8in5BYr\npH1uwFEK+KbRbI08K3dBktp49Nf5VJI+kqfjGIrLquByis4DXgDD+uDd0omb\nksHm7/EHMrEGArSqA7vfbFYGCmeN7W10GpojxEfKQ+wf2SgaCqeZQ7W/65aL\nrLzJrpuwixX/XtMCmNVosMiypXXJpAi+TwtVpQhQNM9iC7KDuqnh7LTfWoxm\ndIZKl8IVP8En4oP0Lsj+2e8/cbVl+ds5O7JTK1krZnIiDePwLgUS1tg1Rdtb\naR1tNelhWrMP1ZKV1C41A6ulhEQy3j1LYkSB9J0mRakjJ6ZJjzPBVV+m7kU5\nRsue+ahG9C/lReRLbinbz3EgTe+Folb0yeK9qKT7GHL/d66OQh0j6943JMfw\n74Jc\r\n=Sd7V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"types/index.d.ts","module":"dist/index.es.js","gitHead":"2965a26c56bda0da8b5b127f76fc29dae685167c","scripts":{"test":"jest","build":"rollup -c rollup.config.js","clean":"rm -rf dist types","prepack":"npm run build"},"_npmUser":{"name":"vanppo","email":"vanppo@hotmail.com"},"deprecated":"This module is now available at @byzanteam/timer","repository":{"url":"git+https://github.com/Byzanteam/carbonium-timer.git","type":"git"},"_npmVersion":"6.4.1","description":"Timer for Carbonium","directories":{},"_nodeVersion":"8.12.0","dependencies":{"bezier-easing":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.8.0","rollup":"^1.12.0","ts-jest":"^24.0.2","typescript":"^3.4.5","@types/jest":"^24.0.12","rollup-plugin-commonjs":"^10.0.0","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-typescript2":"^0.21.0","rollup-plugin-node-resolve":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/carbonium-timer_0.1.1_1558061005672_0.8794554094004428","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-05-16T11:49:18.261Z","modified":"2026-05-21T13:25:13.170Z","0.1.0":"2019-05-16T11:49:18.568Z","0.1.1":"2019-05-17T02:43:25.852Z"},"bugs":{"url":"https://github.com/Byzanteam/carbonium-timer/issues"},"author":{"name":"vanppo","email":"vanppo@hotmail.com"},"license":"MIT","homepage":"https://github.com/Byzanteam/carbonium-timer#readme","keywords":["Carbonium","Timer"],"repository":{"url":"git+https://github.com/Byzanteam/carbonium-timer.git","type":"git"},"description":"Timer for Carbonium","maintainers":[{"email":"solar.pom@gmail.com","name":"admiral.coco"}],"readme":"# Carbonium-Timer\n\nTimer support for Carbonium.\n\n## Installation\n\n```bash\n$ npm install @byzanteam/carbonium-timer\n```\n\n## Usage\n\n### Create Timer\n\n```typescript\nimport {createTimer} from '@byzanteam/carbonium-timer'\n\nconst timer = createTimer()\n\n// Create timer with given defaults.\nconst timer = createTimer({delay: 0, duration: 1e3, easingFunction: 'easeInOut'})\n```\n\n### Subscribe\n\n`timer.subscribe()` 向 timer 中添加任务，返回退订函数。调用退订函数会从任务队列中移除相关的所有任务。该函数一共有三种调用形式，如下所示。\n\n```typescript\ninterface StateType {\n  width: number,\n  height: number,\n}\n\nconst handler = (progress: number, startState: StateType, endState: StateType) => {\n  console.log(progress, startState, endState)\n}\n\n// 处理函数和配置分离的但任务。\ntimer.subscribe<StateType>(handler, {\n  delay: 250,\n  startState: {width: 100, height: 100},\n  endState: {width: 200, height: 200},\n})\n\n// 单个任务配置对象。\ntimer.subscribe<StateType>({\n  handler,\n  duration: 2e3,\n  startState: {width: 100, height: 100},\n  endState: {width: 200, height: 200},\n})\n\n// 多个任务配置对象数组。\nconst unsubscribe = timer.subscribe<StateType>([\n  {\n    handler,\n  },\n  {\n    handler,\n  }\n])\n\n// 调用 unsubscribe 函数会移除第三次订阅的所有任务。\nunsubscribe()\n```\n","readmeFilename":"README.md"}