Skip to content

Commit ec6110c

Browse files
authored
Type Mineral.density (#268)
1 parent 1f73abf commit ec6110c

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

dist/index.d.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,10 @@ declare const MINERAL_DENSITY_PROBABILITY: {
402402

403403
declare const MINERAL_DENSITY_CHANGE: number;
404404

405-
declare const DENSITY_LOW: number;
406-
declare const DENSITY_MODERATE: number;
407-
declare const DENSITY_HIGH: number;
408-
declare const DENSITY_ULTRA: number;
405+
declare const DENSITY_LOW: DENSITY_LOW;
406+
declare const DENSITY_MODERATE: DENSITY_MODERATE;
407+
declare const DENSITY_HIGH: DENSITY_HIGH;
408+
declare const DENSITY_ULTRA: DENSITY_ULTRA;
409409

410410
declare const DEPOSIT_EXHAUST_MULTIPLY: number;
411411
declare const DEPOSIT_EXHAUST_POW: number;
@@ -2733,6 +2733,13 @@ type EffectConstant = EFFECT_INVULNERABILITY | EFFECT_COLLAPSE_TIMER;
27332733

27342734
type EFFECT_INVULNERABILITY = 1001;
27352735
type EFFECT_COLLAPSE_TIMER = 1002;
2736+
2737+
type DENSITY_LOW = 1;
2738+
type DENSITY_MODERATE = 2;
2739+
type DENSITY_HIGH = 3;
2740+
type DENSITY_ULTRA = 4;
2741+
2742+
type DensityConstant = DENSITY_LOW | DENSITY_MODERATE | DENSITY_HIGH | DENSITY_ULTRA;
27362743
/**
27372744
* The options that can be accepted by `findRoute()` and friends.
27382745
*/
@@ -3206,7 +3213,7 @@ interface Mineral<T extends MineralConstant = MineralConstant> extends RoomObjec
32063213
/**
32073214
* The density of this mineral deposit, one of the `DENSITY_*` constants.
32083215
*/
3209-
density: number;
3216+
density: DensityConstant;
32103217
/**
32113218
* The remaining amount of resources.
32123219
*/

src/constants.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,10 @@ declare const MINERAL_DENSITY_PROBABILITY: {
402402

403403
declare const MINERAL_DENSITY_CHANGE: number;
404404

405-
declare const DENSITY_LOW: number;
406-
declare const DENSITY_MODERATE: number;
407-
declare const DENSITY_HIGH: number;
408-
declare const DENSITY_ULTRA: number;
405+
declare const DENSITY_LOW: DENSITY_LOW;
406+
declare const DENSITY_MODERATE: DENSITY_MODERATE;
407+
declare const DENSITY_HIGH: DENSITY_HIGH;
408+
declare const DENSITY_ULTRA: DENSITY_ULTRA;
409409

410410
declare const DEPOSIT_EXHAUST_MULTIPLY: number;
411411
declare const DEPOSIT_EXHAUST_POW: number;

src/literals.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,3 +698,10 @@ type EffectConstant = EFFECT_INVULNERABILITY | EFFECT_COLLAPSE_TIMER;
698698

699699
type EFFECT_INVULNERABILITY = 1001;
700700
type EFFECT_COLLAPSE_TIMER = 1002;
701+
702+
type DENSITY_LOW = 1;
703+
type DENSITY_MODERATE = 2;
704+
type DENSITY_HIGH = 3;
705+
type DENSITY_ULTRA = 4;
706+
707+
type DensityConstant = DENSITY_LOW | DENSITY_MODERATE | DENSITY_HIGH | DENSITY_ULTRA;

src/mineral.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface Mineral<T extends MineralConstant = MineralConstant> extends RoomObjec
1010
/**
1111
* The density of this mineral deposit, one of the `DENSITY_*` constants.
1212
*/
13-
density: number;
13+
density: DensityConstant;
1414
/**
1515
* The remaining amount of resources.
1616
*/

0 commit comments

Comments
 (0)