@hatsuboshi/types
    Preparing search index...

    Class PDrink

    A P-Drink / produce drink (Pドリンク).

    These are drinks that can be used during an lesson/audition gameplay sector for an effect (e.g. "初星ホエイプロテイン" / "Hatsuboshi Whey Protein", "センブリソーダ" / "Senburi Soda", etc.).

    Tip

    See PDrinkFilter for the list of filtering options.

    See IPDrink for the list of fields that can be used for sorting.

    Hierarchy (View Summary)

    Implements

    Index
    • Constructs a PDrink instance from an optional IPDrink object.

      If obj, or any of its required fields are undefined, the default value of each property's type will be used to construct the object.

      Parameters

      • Optionalobj: Partial<IPDrink>

        Data to construct the object from.

      Returns PDrink

      // Default instance
      new PDrink()

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

      // From JSON data returned by an API
      const res = await fetch(...)
      const data = new PDrink(await res.json())
    • Returns the document-store representation of this object.

      Caution

      Unlike toJSON(), the resulting document-store representation may be in a significantly different shape to that of its implementing class, and it cannot be passed back into the constructor to reconstruct an equivalent instance.

      Use fromDB() instead, which reconstructs the instance and rehydrates any fields truncated by the conversion.

      Returns DBPDrink

    • Returns the JSON-serializable representation of this object.

      Tip

      The result can be passed back into the constructor to reconstruct an equivalent instance.

      Returns IPDrink

      // t1 and t2 are deeply equal
      const t1: T = new T({ ... })
      const t2: T = new T(t1.toJSON())
    • get dbRef(): string

      The unique reference to this object in persistent storage.

      Returns string

    assetUrl: string

    The URL to the main visual asset (image) of the P-Drink.

    createdAt: string

    The time the object was created, as an ISO 8601 (RFC 3339) timestamp.

    ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?(Z|[+-]\d{2}:\d{2})$

    "2026-07-08T07:35:46.741Z"
    
    effect: Effect

    The effect applied by the P-Drink.

    id: string

    An ID associated with the object.

    index: number = 0

    An auto-incremented index to keep object IDs unique during runtime.

    The name of the P-Drink.

    plan: Plan

    The produce plan(s) the P-Drink can be used on.

    rarity: Rarity

    The rarity of the P-Drink.

    sortableFields: readonly [
        "id",
        "createdAt",
        "updatedAt",
        "name",
        "plan",
        "rarity",
        "unlockLevel",
    ] = ...
    unlockLevel: number

    The produce level at which the P-Drink is unlocked at.

    updatedAt: string

    The time the object was last updated, as an ISO 8601 (RFC 3339) timestamp.

    ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?(Z|[+-]\d{2}:\d{2})$

    "2026-07-09T14:02:11.508Z"