Skip to content

Commit

Permalink
Add missing prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiennou committed Feb 2, 2025
1 parent 3c1b1b2 commit c4d6b29
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 2 deletions.
31 changes: 30 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,12 @@ declare const Creep: CreepConstructor;
* Each harvest operation triggers a cooldown period, which becomes longer and longer over time.
*/
interface Deposit extends RoomObject {
/**
* The prototype is stored in the {@link Deposit.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: Deposit;
/**
* A unique object identificator.
* You can use {@link Game.getObjectById} method to retrieve an object instance by its id.
Expand Down Expand Up @@ -3405,6 +3411,12 @@ interface CostMatrixConstructor extends _Constructor<CostMatrix> {
* Container for custom navigation cost data.
*/
interface CostMatrix {
/**
* The prototype is stored in the {@link CostMatrix.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: CostMatrix;
/**
* Set the cost of a position in this CostMatrix.
* @param x X position in the room.
Expand Down Expand Up @@ -4878,6 +4890,8 @@ interface SpawningConstructor extends _Constructor<Spawning> {
(id: Id<StructureSpawn>): Spawning;
}
interface StoreBase<POSSIBLE_RESOURCES extends ResourceConstant, UNLIMITED_STORE extends boolean> {
readonly prototype: GenericStoreBase;

/**
* Returns capacity of this store for the specified resource. For a general purpose store, it returns total capacity if `resource` is undefined.
* @param resource The type of the resource.
Expand Down Expand Up @@ -4927,7 +4941,12 @@ type Store<POSSIBLE_RESOURCES extends ResourceConstant, UNLIMITED_STORE extends

interface GenericStoreBase {
/**
* Returns capacity of this store for the specified resource. For a general purpose store, it returns total capacity if `resource` is undefined.
* The prototype is stored in the {@link GenericStoreBase.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: GenericStoreBase;
/**
* @param resource The type of the resource.
* @returns Returns capacity number, or `null` in case of an invalid `resource` for this store type.
*/
Expand All @@ -4947,6 +4966,10 @@ interface GenericStoreBase {
}

type GenericStore = GenericStoreBase & { [P in ResourceConstant]: number };

interface StoreConstructor extends _Constructor<GenericStoreBase> {}

declare const Store: StoreConstructor;
/**
* Parent object for structure classes
*/
Expand Down Expand Up @@ -5725,6 +5748,12 @@ type ConcreteStructure<T extends StructureConstant> = ConcreteStructureMap[T];
* </ul>
*/
interface Tombstone extends RoomObject {
/**
* The prototype is stored in the {@link Tombstone.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: Tombstone;
/**
* A unique object identificator.
* You can use {@link Game.getObjectById} method to retrieve an object instance by its id.
Expand Down
6 changes: 6 additions & 0 deletions src/deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
* Each harvest operation triggers a cooldown period, which becomes longer and longer over time.
*/
interface Deposit extends RoomObject {
/**
* The prototype is stored in the {@link Deposit.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: Deposit;
/**
* A unique object identificator.
* You can use {@link Game.getObjectById} method to retrieve an object instance by its id.
Expand Down
6 changes: 6 additions & 0 deletions src/path-finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ interface CostMatrixConstructor extends _Constructor<CostMatrix> {
* Container for custom navigation cost data.
*/
interface CostMatrix {
/**
* The prototype is stored in the {@link CostMatrix.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: CostMatrix;
/**
* Set the cost of a position in this CostMatrix.
* @param x X position in the room.
Expand Down
13 changes: 12 additions & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
interface StoreBase<POSSIBLE_RESOURCES extends ResourceConstant, UNLIMITED_STORE extends boolean> {
readonly prototype: GenericStoreBase;

/**
* Returns capacity of this store for the specified resource. For a general purpose store, it returns total capacity if `resource` is undefined.
* @param resource The type of the resource.
Expand Down Expand Up @@ -48,7 +50,12 @@ type Store<POSSIBLE_RESOURCES extends ResourceConstant, UNLIMITED_STORE extends

interface GenericStoreBase {
/**
* Returns capacity of this store for the specified resource. For a general purpose store, it returns total capacity if `resource` is undefined.
* The prototype is stored in the {@link GenericStoreBase.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: GenericStoreBase;
/**
* @param resource The type of the resource.
* @returns Returns capacity number, or `null` in case of an invalid `resource` for this store type.
*/
Expand All @@ -68,3 +75,7 @@ interface GenericStoreBase {
}

type GenericStore = GenericStoreBase & { [P in ResourceConstant]: number };

interface StoreConstructor extends _Constructor<GenericStoreBase> {}

declare const Store: StoreConstructor;
6 changes: 6 additions & 0 deletions src/tombstone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
* </ul>
*/
interface Tombstone extends RoomObject {
/**
* The prototype is stored in the {@link Tombstone.prototype} global object.
*
* You can use it to extend game objects behaviour globally.
*/
readonly prototype: Tombstone;
/**
* A unique object identificator.
* You can use {@link Game.getObjectById} method to retrieve an object instance by its id.
Expand Down

0 comments on commit c4d6b29

Please sign in to comment.