codyfight-widget-ui-type
v1.0.23
Published
Types declaration file for Widget -> UI events payload.
Downloads
119
Readme
codyfight-widget-ui-type
Description
Types declaration file for Widget -> UI events payload.
https://www.npmjs.com/package/codyfight-widget-ui-type
Installation
This package can be installed via npm or yarn:
npm install codyfight-widget-ui-type --save-dev
or
yarn add codyfight-widget-ui-type -D
Usage
import type { GameConfigEvent, GameState } from "codyfight-widget-ui-type";
// Example usage of exported types
function handleGameState(event: GameState) {
// Do something with event.detail.value
}
function handleGameConfig(event: GameConfigEvent) {
// Do something with event.detail.value.toggleSound
}
Updating types
In order to update the types, follow these steps:
- Clone the repository
- Run
npm install
- Update the
src/index.ts
file - Update the package version in
package.json
- Run
npm run build
- Run
npm publish
- Commit and push the changes
Make sure to log in to npm before publishing the package:
npm login
Make sure to always have the latest version of the package installed in your project:
{
"devDependencies": {
"codyfight-widget-ui-type": "^1.0.0"
}
}
yarn upgrade codyfight-widget-ui-type --latest
or
npm update codyfight-widget-ui-type --latest