Minor adjustments to tsdocs from code review

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
This commit is contained in:
Sirz Benjie 2025-07-30 20:52:25 -06:00
parent aac91c700d
commit ba438ed0a2
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
2 changed files with 9 additions and 9 deletions

View File

@ -51,7 +51,7 @@ import i18next from "i18next";
* *
* If the data is mutable (i.e. it can change over the course of the tag's lifetime), then it *must* * If the data is mutable (i.e. it can change over the course of the tag's lifetime), then it *must*
* be defined as a field, and it must be set in the `loadTag` method. * be defined as a field, and it must be set in the `loadTag` method.
* Such fields cannot be marked as `private/protected`, as if they were, typescript would omit them from * Such fields cannot be marked as `private`/`protected`; if they were, Typescript would omit them from
* types that are based off of the class, namely, `ArenaTagTypeData`. It is preferrable to trade the * types that are based off of the class, namely, `ArenaTagTypeData`. It is preferrable to trade the
* type-safety of private/protected fields for the type safety when deserializing arena tags from save data. * type-safety of private/protected fields for the type safety when deserializing arena tags from save data.
* *
@ -61,16 +61,16 @@ import i18next from "i18next";
* If the field should be accessible outside of the class, then a public getter should be used. * If the field should be accessible outside of the class, then a public getter should be used.
* *
* If any new serializable fields *are* added, then the class *must* override the * If any new serializable fields *are* added, then the class *must* override the
* `loadTag` method to set the new fields. It's signature *must* match the example below, * `loadTag` method to set the new fields. Its signature *must* match the example below,
* ``` * ```
* class ClassName extends SerializableArenaTag { * class ExampleTag extends SerializableArenaTag {
* // Example, if we add 2 new fields that should be serialized: * // Example, if we add 2 new fields that should be serialized:
* public a: string; * public a: string;
* public b: number; * public b: number;
* // Then we must also define a loadTag method with one of the following signatures * // Then we must also define a loadTag method with one of the following signatures
* public override loadTag(source: BaseArenaTag & Pick<ClassName, "tagType" | "a" | "b"): void; * public override loadTag(source: BaseArenaTag & Pick<ExampleTag, "tagType" | "a" | "b"): void;
* public override loadTag<const T extends this>(source: BaseArenaTag & Pick<T, "tagType" | "a" | "b">): void; * public override loadTag<const T extends this>(source: BaseArenaTag & Pick<T, "tagType" | "a" | "b">): void;
* public override loadTag(source: NonFunctionProperties<ClassName>): void; * public override loadTag(source: NonFunctionProperties<ExampleTag>): void;
* } * }
* ``` * ```
* Notes * Notes

View File

@ -71,16 +71,16 @@ import { BooleanHolder, coerceArray, getFrameMs, isNullOrUndefined, NumberHolder
* These rules ensure that Typescript is aware of the shape of the serialized version of the class. * These rules ensure that Typescript is aware of the shape of the serialized version of the class.
* *
* If any new serializable fields *are* added, then the class *must* override the * If any new serializable fields *are* added, then the class *must* override the
* `loadTag` method to set the new fields. It's signature *must* match the example below: * `loadTag` method to set the new fields. Its signature *must* match the example below:
* ``` * ```
* class ClassName extends SerializableBattlerTag { * class ExampleTag extends SerializableBattlerTag {
* // Example, if we add 2 new fields that should be serialized: * // Example, if we add 2 new fields that should be serialized:
* public a: string; * public a: string;
* public b: number; * public b: number;
* // Then we must also define a loadTag method with one of the following signatures * // Then we must also define a loadTag method with one of the following signatures
* public override loadTag(source: BaseBattlerTag & Pick<ClassName, "tagType" | "a" | "b"): void; * public override loadTag(source: BaseBattlerTag & Pick<ExampleTag, "tagType" | "a" | "b"): void;
* public override loadTag<const T extends this>(source: BaseBattlerTag & Pick<T, "tagType" | "a" | "b">): void; * public override loadTag<const T extends this>(source: BaseBattlerTag & Pick<T, "tagType" | "a" | "b">): void;
* public override loadTag(source: NonFunctionProperties<ClassName>): void; * public override loadTag(source: NonFunctionProperties<ExampleTag>): void;
* } * }
* ``` * ```
* Notes * Notes