@hatsuboshi/types
    Preparing search index...

    @hatsuboshi/types

    Logo

    Hatsuboshi App - Types Package


    Hatsuboshi App Types Package is a TypeScript package that defines data structures to represent in-game data / assets from Gakuen IDOLM@STER. It provides shared, canonical data object definitions across the Hatsuboshi App project, and is available for public use via npm.

    • Strongly defined data representations for different use cases (e.g. class instances, JSON objects, document-store-compatible JSON objects, etc.)
    • Easy conversion between data representations via class constructors and methods
    • Utility types for sorting, filtering & pagination of data
    • Convenient methods on model classes for manipulating and deriving data
    • Fully documented with JSDoc & generated as static HTML pages using TypeDoc, hosted on the Hatsuboshi App Docs
    npm i @hatsuboshi/types
    

    For a list of all available types exported by this package, checkout the Types Reference.

    We demonstrate here some features of the package using the PIdol class as an example, but other model classes provide similar functionality.

    // Default instance
    new PIdol()

    // From partial data
    new PIdol({ name: { ja: "Hello" } })

    // From JSON data returned by an API
    const res = await fetch(...)
    const data = new PIdol(await res.json())

    // Changing the Potential Level of a PIdol instance
    const pIdol = new PIdol()
    pIdol.setPotentialLevel(3) // updates all relevant data fields accordingly!
    console.log(pIdol.initialParameter === pIdol.currentParameter) // false

    This package is written in TypeScript with no runtime dependencies. It uses tsup to build the package, TypeDoc to generate static HTML documentation pages, and Vitest to run unit tests.

    To build the package for publishing to npm or local use (to the ./dist folder, by default):

    $ npm run build
    

    To generate static HTML documentation pages (to the ./docs folder, by default):

    $ npm run docs
    

    To run unit tests:

    $ npm run test
    

    This package uses GitHub Actions to automatically run CI/CD pipelines for publishing. Versioning is handled by semantic-release.

    • The main branch automatically publishes the package to npm (@hatsuboshi/types) when the commits since the previous release warrant a new version according to the configured semantic-release rules.
      • If a new version is published, it also automatically pushes generated documentation artifacts to docs repo,
      • ...which then automatically deploys the up-to-date documentation to https://docs.hatsuboshi.app/types

    Feel free to open an issue for any bugs, feature requests, or questions to do with this package.

    When contributing, please use feature branching when implementing new features, and submit a pull request titled using the Conventional Commits specification, targeting the main branch.

    Feel free to contact me, @HuzzuDesu on Twitter or @huzzudesu on Discord for any other questions or inquiries.

    There is currently no Discord server for the purposes of development for this project.

    Warning

    This package is a part of a fan-made project and NOT an officially endorsed app for Gakuen IDOLM@STER, nor is it associated with BNEI, QualiArts Inc., or any other official entities. All rights to the original game assets, content, and intellectual property belong to their respective copyright owners.