{"_id":"@diamondkinetics/dk-minigames-ts","_rev":"6-48cd61e12754b17b011a522bb10e4cde","name":"@diamondkinetics/dk-minigames-ts","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@diamondkinetics/dk-minigames-ts","version":"1.0.0","author":{"name":"Eric Drobotij"},"license":"ISC","_id":"@diamondkinetics/dk-minigames-ts@1.0.0","maintainers":[{"name":"ncksnydr","email":"nick@nicksnyder.is"},{"name":"delasare","email":"rdelasalas@diamondkinetics.com"},{"name":"edwardlach","email":"elach@diamondkinetics.com"},{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"}],"dist":{"shasum":"4ca21f941c23d4c2f1c51b5e2c7515f2d7b56622","tarball":"https://registry.npmjs.org/@diamondkinetics/dk-minigames-ts/-/dk-minigames-ts-1.0.0.tgz","fileCount":73,"integrity":"sha512-j3Meq+42zg+Em6kLleObwTa7LORYT2wuMpQonGjTFudweJ4HaG5n4r3SXR0Y2WpT/2ug1fiBULtFxNKOMcPf5A==","signatures":[{"sig":"MEUCICcfy8Pzwp6SIO48Mqs/JYP9nSXs8MIafQhjenRtU8CYAiEA46oQPK8fQY9kq55eY5e4aqgmMMypOiHz1xVRYrEQ6M0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":213756},"main":"./dist/index.js","module":"./dist/module/index.js","gitHead":"79bf55fe682ce5a5bfefcbffea552ccb4cb87095","scripts":{"build":"run-p build:*","clean":"rm -rf ./dist && mkdir -p ./dist/styles","deploy":"run-s clean templates styles build","styles":"find ./styles -name '*.scss' -exec cp {} ./dist/styles \\;","templates":"find ./src -name '*.html' -exec cp {} ./dist \\;","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json"},"typings":"./dist/main/index.d.ts","_npmUser":{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},"_npmVersion":"10.2.4","description":"DK MiniGames in TypeScript for use in web-based projects.","directories":{},"_nodeVersion":"20.11.0","dependencies":{"d3":"^7.4.3","tslib":"^2.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","@types/d3":"^7.4.3","@eslint/js":"^9.2.0","typescript":"^5.4.5","npm-run-all":"^4.1.5","typescript-eslint":"^7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/dk-minigames-ts_1.0.0_1718802204823_0.3509461535421412","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@diamondkinetics/dk-minigames-ts","version":"1.0.1","author":{"name":"Eric Drobotij"},"license":"ISC","_id":"@diamondkinetics/dk-minigames-ts@1.0.1","maintainers":[{"name":"ncksnydr","email":"nick@nicksnyder.is"},{"name":"delasare","email":"rdelasalas@diamondkinetics.com"},{"name":"edwardlach","email":"elach@diamondkinetics.com"},{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"}],"dist":{"shasum":"953ab6b6c8e5baf690206ff89ee92797a47caf54","tarball":"https://registry.npmjs.org/@diamondkinetics/dk-minigames-ts/-/dk-minigames-ts-1.0.1.tgz","fileCount":73,"integrity":"sha512-s2shHHjXEUVC7pD0+IAPGSVOszrFeQPahFz4Aaq7sVsIjcXDbWKC3UYS1RfZ/PDx8MZJ/unO/hrWKInoND7Ikw==","signatures":[{"sig":"MEUCIAViBalrUqEDBK4AHfTuTKKsx+R5gpVlPk46/s8qLtmoAiEAxk9WcfIVinZzTcYKssYsBn0rWEf4ULswo3NL4QFnQ2w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":214124},"main":"./dist/index.js","module":"./dist/module/index.js","scripts":{"build":"run-p build:*","clean":"rm -rf ./dist && mkdir -p ./dist/styles","deploy":"run-s clean templates styles build","styles":"find ./styles -name '*.scss' -exec cp {} ./dist/styles \\;","templates":"find ./src -name '*.html' -exec cp {} ./dist \\;","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json"},"typings":"./dist/main/index.d.ts","_npmUser":{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},"_npmVersion":"10.7.0","description":"DK MiniGames in TypeScript for use in web-based projects.","directories":{},"_nodeVersion":"20.14.0","dependencies":{"d3":"^7.4.3","tslib":"^2.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","@types/d3":"^7.4.3","@eslint/js":"^9.2.0","typescript":"^5.4.5","npm-run-all":"^4.1.5","typescript-eslint":"^7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/dk-minigames-ts_1.0.1_1718802800673_0.6414848050061901","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@diamondkinetics/dk-minigames-ts","version":"1.1.0","author":{"name":"Eric Drobotij"},"license":"ISC","_id":"@diamondkinetics/dk-minigames-ts@1.1.0","maintainers":[{"name":"ncksnydr","email":"nick@nicksnyder.is"},{"name":"delasare","email":"rdelasalas@diamondkinetics.com"},{"name":"edwardlach","email":"elach@diamondkinetics.com"},{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"}],"dist":{"shasum":"7a2f2402d8a838974d9af42477b37722aa676845","tarball":"https://registry.npmjs.org/@diamondkinetics/dk-minigames-ts/-/dk-minigames-ts-1.1.0.tgz","fileCount":73,"integrity":"sha512-/wIilViPYZ4gDqCa6mW1zL3e1usU2wQbtHY0BLGo3VCo+zS/NddxL/rWsjTkDiSvvVKlX0oEiVH5Q0b2uUieLA==","signatures":[{"sig":"MEYCIQD3QrTly93phJS5j8JKgdYfEzsa7o04DUVTcgIrSBsueQIhAIuX92fUwtaYhscc+3svYi7NhlI4bt/dFgWNeGBF6fOU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":216442},"main":"./dist/index.js","module":"./dist/module/index.js","scripts":{"build":"run-p build:*","clean":"rm -rf ./dist && mkdir -p ./dist/styles","deploy":"run-s clean templates styles build","styles":"find ./styles -name '*.scss' -exec cp {} ./dist/styles \\;","templates":"find ./src -name '*.html' -exec cp {} ./dist \\;","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json"},"typings":"./dist/main/index.d.ts","_npmUser":{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},"_npmVersion":"10.7.0","description":"DK MiniGames in TypeScript for use in web-based projects.","directories":{},"_nodeVersion":"20.14.0","dependencies":{"d3":"^7.4.3","tslib":"^2.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","@types/d3":"^7.4.3","@eslint/js":"^9.2.0","typescript":"^5.4.5","npm-run-all":"^4.1.5","typescript-eslint":"^7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/dk-minigames-ts_1.1.0_1718810646513_0.46034763242894927","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@diamondkinetics/dk-minigames-ts","version":"1.1.1","author":{"name":"Eric Drobotij"},"license":"ISC","_id":"@diamondkinetics/dk-minigames-ts@1.1.1","maintainers":[{"name":"ncksnydr","email":"nick@nicksnyder.is"},{"name":"delasare","email":"rdelasalas@diamondkinetics.com"},{"name":"edwardlach","email":"elach@diamondkinetics.com"},{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"}],"dist":{"shasum":"04edaac35ca3cd750323559e1005f74ad7202a04","tarball":"https://registry.npmjs.org/@diamondkinetics/dk-minigames-ts/-/dk-minigames-ts-1.1.1.tgz","fileCount":73,"integrity":"sha512-t/U8RT+VXYg6nPXEJVo18uFZkQzwu5hNtK1Lfds4upJ1ZmlQj7Fw2Q+DdAQBoF+R1rbetf/ApFhXkCXx0Xwzbg==","signatures":[{"sig":"MEYCIQDtgrB19N7O2iPnaLDIByEPJmtjao1n8V1nCOBi65brFAIhAKQmR28LgF6hAIoI0HpsKzHok3dIqKgBDKJBvV8fAogj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":216652},"main":"./dist/index.js","module":"./dist/module/index.js","scripts":{"build":"run-p build:*","clean":"rm -rf ./dist && mkdir -p ./dist/styles","deploy":"run-s clean templates styles build","styles":"find ./styles -name '*.scss' -exec cp {} ./dist/styles \\;","templates":"find ./src -name '*.html' -exec cp {} ./dist \\;","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json"},"typings":"./dist/main/index.d.ts","_npmUser":{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},"_npmVersion":"10.8.1","description":"DK MiniGames in TypeScript for use in web-based projects.","directories":{},"_nodeVersion":"20.16.0","dependencies":{"d3":"^7.4.3","tslib":"^2.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","@types/d3":"^7.4.3","@eslint/js":"^9.2.0","typescript":"^5.4.5","npm-run-all":"^4.1.5","typescript-eslint":"^7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/dk-minigames-ts_1.1.1_1722535487212_0.5011406710030948","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@diamondkinetics/dk-minigames-ts","version":"1.1.2","author":{"name":"Eric Drobotij"},"license":"ISC","_id":"@diamondkinetics/dk-minigames-ts@1.1.2","maintainers":[{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},{"name":"edwardlach","email":"elach@diamondkinetics.com"},{"name":"delasare","email":"rdelasalas@diamondkinetics.com"},{"name":"ncksnydr","email":"nick@nicksnyder.is"}],"dist":{"shasum":"c98e9d316d96522e0058f69183fc3477ba4c8a46","tarball":"https://registry.npmjs.org/@diamondkinetics/dk-minigames-ts/-/dk-minigames-ts-1.1.2.tgz","fileCount":73,"integrity":"sha512-fPpCchcyP0sSHXgHO/hYh0KFZe8DRwz0qxSt7radRMHk8W25468EiOFEveP9yau7th7QzEvcGWepdQ8yIASsHg==","signatures":[{"sig":"MEYCIQDU9yt/Tc2of9BulQS626A8UteIjohcsKEufmdWObvhwQIhANPoPU3yJQCov0uyGTvBRNczXXeRTpbLuSyAnnDYGYsc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":220876},"main":"./dist/index.js","module":"./dist/module/index.js","scripts":{"build":"run-p build:*","clean":"rm -rf ./dist && mkdir -p ./dist/styles","deploy":"run-s clean templates styles build","styles":"find ./styles -name '*.scss' -exec cp {} ./dist/styles \\;","templates":"find ./src -name '*.html' -exec cp {} ./dist \\;","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json"},"typings":"./dist/main/index.d.ts","_npmUser":{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},"_npmVersion":"10.8.2","description":"DK MiniGames in TypeScript for use in web-based projects.","directories":{},"_nodeVersion":"20.19.0","dependencies":{"d3":"^7.4.3","tslib":"^2.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","@types/d3":"^7.4.3","@eslint/js":"^9.2.0","typescript":"^5.4.5","npm-run-all":"^4.1.5","typescript-eslint":"^7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/dk-minigames-ts_1.1.2_1744661853750_0.21439743323202998","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@diamondkinetics/dk-minigames-ts","version":"1.1.3","description":"DK MiniGames in TypeScript for use in web-based projects.","main":"./dist/index.js","typings":"./dist/main/index.d.ts","module":"./dist/module/index.js","scripts":{"build":"run-p build:*","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","templates":"find ./src -name '*.html' -exec cp {} ./dist \\;","styles":"find ./styles -name '*.scss' -exec cp {} ./dist/styles \\;","clean":"rm -rf ./dist && mkdir -p ./dist/styles","deploy":"run-s clean templates styles build"},"author":{"name":"Eric Drobotij"},"license":"ISC","devDependencies":{"@eslint/js":"^9.2.0","@types/d3":"^7.4.3","eslint":"^8.57.0","jest":"^29.7.0","npm-run-all":"^4.1.5","typescript":"^5.4.5","typescript-eslint":"^7.9.0"},"dependencies":{"d3":"^7.4.3","tslib":"^2.6.2"},"_id":"@diamondkinetics/dk-minigames-ts@1.1.3","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-My3+mVzlErVEaUq4W6wRTYPzLzGYpTAJWq+rJTJHhqjkNdKPZaKOHFwb9akfUKiK0jWTVCjzFDDXC3n0GbMk6w==","shasum":"6d0400959d5e252b7eab187f682753a249d00590","tarball":"https://registry.npmjs.org/@diamondkinetics/dk-minigames-ts/-/dk-minigames-ts-1.1.3.tgz","fileCount":73,"unpackedSize":221067,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBiZZAEEyzEm/my6k5MQpdh3i/st/Jlu/bLW+l7oFajPAiAPdTZp+0uGHvArkuzHKCvJv5EOuSA9mH77b40sZa7yWw=="}]},"_npmUser":{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},"directories":{},"maintainers":[{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},{"name":"edwardlach","email":"elach@diamondkinetics.com"},{"name":"delasare","email":"rdelasalas@diamondkinetics.com"},{"name":"ncksnydr","email":"nick@nicksnyder.is"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dk-minigames-ts_1.1.3_1761745831546_0.35513562164773615"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-19T13:03:24.726Z","modified":"2025-10-29T13:50:31.992Z","1.0.0":"2024-06-19T13:03:25.024Z","1.0.1":"2024-06-19T13:13:20.885Z","1.1.0":"2024-06-19T15:24:06.656Z","1.1.1":"2024-08-01T18:04:47.443Z","1.1.2":"2025-04-14T20:17:34.001Z","1.1.3":"2025-10-29T13:50:31.768Z"},"author":{"name":"Eric Drobotij"},"license":"ISC","description":"DK MiniGames in TypeScript for use in web-based projects.","maintainers":[{"name":"edrobotij","email":"edrobotij@diamondkinetics.com"},{"name":"edwardlach","email":"elach@diamondkinetics.com"},{"name":"delasare","email":"rdelasalas@diamondkinetics.com"},{"name":"ncksnydr","email":"nick@nicksnyder.is"}],"readme":"# DK Mini Games in TypeScript\n\nThis library will allow client code to run a Mini Game as long as a valid configuration object is provided. The structure is as follows.\n\n```TypeScript\nexport interface MiniGameConfig {\n  viewModel: MiniGameViewModel;\n  gameContainer: HTMLElement;\n  onGameStart?: (() => void) | undefined;\n  onNextGame?: (() => void) | undefined;\n  onLeaveGame?: (() => void) | undefined;\n  onGameCompleted?: (() => void) | undefined;\n}\n```\n\n| Property | Description |\n| -------- | ----------- |\n| `viewModel` | The data that drives the UI and game logic |\n| `gameContainer` | The HTML element that the game instance will operate within |\n| `onGameStart` | A callback that executes (if set) just before the first question is presented |\n| `onNextGame` | A callback that executes (if set) when 'Next Game' is clicked/tapped in the End View |\n| `onLeaveGame` | A callback that executes (if set) when an action is taken to leave an active game |\n| `onGameCompleted` | A callback that executes (if set) when a game is completed by either going through all questions or getting three outs (wrong answers) |\n\n## Example\n\nThis example below shows basic usage of the library, which includes creating a config object, instantiating a MiniGame with it, and initializing the game.\n\n```TypeScript\nconst config: MiniGameConfig = getMiniGameConfig();\nconst game: MiniGame = new MiniGame(config);\ngame.init();\n```\n\n## Additional data models\n\n```TypeScript\nexport interface MiniGameViewModel {\n  uuid: string;\n  name: string;\n  description: string;\n  coverImageUrl: string;\n  questions: QuestionViewModel[];\n}\n```\n\n| Property | Description |\n| -------- | ----------- |\n| `uuid` | The UUID of the MiniGame activity definition |\n| `name` | The name of the game |\n| `description` | The description of the game |\n| `coverImageUrl` | A URL reference to the cover image of the game |\n| `questions` | A collection of view models that contain question related data |\n\n```TypeScript\nexport interface QuestionViewModel {\n  uuid: string;\n  videoUrl: string;\n  countdownStartTime: number;\n  countdownDuration: number;\n  questionLeadIn: string;\n  prompt: string;\n  onRevealText: string;\n  questionSubject: string;\n  questionSubjectDescription: string;\n  answers: AnswerViewModel[];\n}\n```\n\n| Property | Description |\n| -------- | ----------- |\n| `uuid` | The UUID of the question |\n| `videoUrl` | A URL reference to the video for the question |\n| `countdownStartTime` | The time (in seconds) it should take to start the countdown for answering the question |\n| `countdownDuration` | The duration (in seconds) that the countdown should last |\n| `questionLeadIn` | The text displayed related to the question, before the countdown begins |\n| `prompt` | The question prompt displayed when the countdown starts |\n| `onRevealText` | The text that is revealed once the countdown has expired |\n| `questionSubject` | A subject that is related to the question, shown when the game is paused |\n| `questionSubjectDescription` | A description of the above subject, shown when the game is paused |\n| `answers` | A collection of view models that contain answer related data |\n\n```TypeScript\nexport interface AnswerViewModel {\n  uuid: string;\n  displayOrder: number;\n  prompt: string;\n  isCorrect: boolean;\n  onRevealText: string;\n}\n```\n\n| Property | Description |\n| -------- | ----------- |\n| `uuid` | The UUID of the answer |\n| `displayOrder` | The position in which this answer should be displayed amongst the others |\n| `prompt` | The time (in seconds) it should take to start the countdown for answering the question |\n| `isCorrect` | Designates if the answer is correct |\n| `onRevealText` | The text revealed when this answer is selected (not currently used) |\n\n## Building\n\nThis library requires the using HTML templates that are included in the Node package. The library code assumes that these HTML files will be in the same directory together. So to use them, copy them into the directory your JS/TS will be running. The following command could also be used in a build configuration:\n\n`find ./node_modules/@diamondkinetics/dk-minigames-ts -name '*.html' -exec cp {} ./[your-build-folder] \\\\;`\n","readmeFilename":"README.md"}