@pkmn/dex-types 0.8.9 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +33 -33
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -53,14 +53,14 @@ export interface ConditionData extends Omit<EffectData, 'num'> {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
interface AbilityFlags {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
breakable?: 1 | 0;
|
|
57
|
+
cantsuppress?: 1 | 0;
|
|
58
|
+
failroleplay?: 1 | 0;
|
|
59
|
+
failskillswap?: 1 | 0;
|
|
60
|
+
noentrain?: 1 | 0;
|
|
61
|
+
noreceiver?: 1 | 0;
|
|
62
|
+
notrace?: 1 | 0;
|
|
63
|
+
notransform?: 1 | 0;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export interface AbilityData extends EffectData {
|
|
@@ -86,7 +86,7 @@ export interface ItemData extends EffectData {
|
|
|
86
86
|
isPokeball?: boolean;
|
|
87
87
|
megaStone?: string;
|
|
88
88
|
megaEvolves?: string;
|
|
89
|
-
naturalGift?: {
|
|
89
|
+
naturalGift?: {basePower: number; type: TypeName};
|
|
90
90
|
onDrive?: string;
|
|
91
91
|
onMemory?: string;
|
|
92
92
|
onPlate?: string;
|
|
@@ -187,7 +187,7 @@ export interface MoveData extends EffectData, HitEffect {
|
|
|
187
187
|
heal?: number[] | null;
|
|
188
188
|
forceSwitch?: boolean;
|
|
189
189
|
selfSwitch?: 'copyvolatile' | 'shedtail' | boolean;
|
|
190
|
-
selfBoost?: {
|
|
190
|
+
selfBoost?: {boosts?: Partial<BoostsTable>};
|
|
191
191
|
selfdestruct?: boolean | 'ifHit' | 'always';
|
|
192
192
|
breaksProtect?: boolean;
|
|
193
193
|
recoil?: [number, number];
|
|
@@ -212,7 +212,7 @@ export interface MoveData extends EffectData, HitEffect {
|
|
|
212
212
|
ignoreAccuracy?: boolean;
|
|
213
213
|
ignoreDefensive?: boolean;
|
|
214
214
|
ignoreEvasion?: boolean;
|
|
215
|
-
ignoreImmunity?: boolean | {
|
|
215
|
+
ignoreImmunity?: boolean | {[k in keyof TypeName]?: boolean};
|
|
216
216
|
ignoreNegativeOffensive?: boolean;
|
|
217
217
|
ignoreOffensive?: boolean;
|
|
218
218
|
ignorePositiveDefensive?: boolean;
|
|
@@ -263,7 +263,7 @@ export interface SpeciesData {
|
|
|
263
263
|
evoType?: EvoType;
|
|
264
264
|
forme?: string;
|
|
265
265
|
gender?: GenderName;
|
|
266
|
-
genderRatio?: {
|
|
266
|
+
genderRatio?: {M: number; F: number};
|
|
267
267
|
maxHP?: number;
|
|
268
268
|
cosmeticFormes?: string[];
|
|
269
269
|
otherFormes?: string[];
|
|
@@ -305,7 +305,7 @@ export interface EventInfoData {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
export interface LearnsetData {
|
|
308
|
-
learnset?: {
|
|
308
|
+
learnset?: {[moveid: string]: MoveSource[]};
|
|
309
309
|
eventData?: EventInfoData[];
|
|
310
310
|
eventOnly?: boolean;
|
|
311
311
|
encounters?: EventInfoData[];
|
|
@@ -313,7 +313,7 @@ export interface LearnsetData {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
export interface TypeData {
|
|
316
|
-
damageTaken: {
|
|
316
|
+
damageTaken: {[t in Exclude<TypeName, '???'>]?: number} & {[key: string]: number};
|
|
317
317
|
HPdvs?: Partial<StatsTable>;
|
|
318
318
|
HPivs?: Partial<StatsTable>;
|
|
319
319
|
isNonstandard?: Nonstandard | null;
|
|
@@ -407,7 +407,7 @@ export interface Species extends Readonly<BasicEffect<SpeciesName> & SpeciesData
|
|
|
407
407
|
readonly cosmeticFormes?: SpeciesName[];
|
|
408
408
|
readonly otherFormes?: SpeciesName[];
|
|
409
409
|
readonly formeOrder?: SpeciesName[];
|
|
410
|
-
readonly genderRatio: {
|
|
410
|
+
readonly genderRatio: {M: number; F: number};
|
|
411
411
|
readonly weighthg: number;
|
|
412
412
|
readonly tags: SpeciesTag[];
|
|
413
413
|
readonly unreleasedHidden: boolean | 'Past';
|
|
@@ -440,7 +440,7 @@ export interface Learnset {
|
|
|
440
440
|
readonly eventOnly: boolean;
|
|
441
441
|
readonly eventData?: EventInfo[];
|
|
442
442
|
readonly encounters?: EventInfo[];
|
|
443
|
-
readonly learnset?: {
|
|
443
|
+
readonly learnset?: {[moveid: string]: MoveSource[]};
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
export interface Type extends Readonly<TypeData> {
|
|
@@ -450,7 +450,7 @@ export interface Type extends Readonly<TypeData> {
|
|
|
450
450
|
readonly name: TypeName;
|
|
451
451
|
readonly exists: boolean;
|
|
452
452
|
readonly gen: GenerationNum;
|
|
453
|
-
readonly damageTaken: {
|
|
453
|
+
readonly damageTaken: {[t in Exclude<TypeName, '???'>]: number} & {[key: string]: number};
|
|
454
454
|
readonly HPivs: Partial<StatsTable>;
|
|
455
455
|
readonly HPdvs: Partial<StatsTable>;
|
|
456
456
|
}
|
|
@@ -465,7 +465,7 @@ export interface Nature extends NatureData {
|
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
export type GenID = 'gen1' | 'gen2' | 'gen3' | 'gen4' | 'gen5' | 'gen6' | 'gen7' | 'gen8' | 'gen9';
|
|
468
|
-
export type ModData = DeepPartial<Dex['data'] & {Scripts: {inherit: GenID}}>;
|
|
468
|
+
export type ModData = DeepPartial<Dex['data'] & {Scripts: {inherit: GenID}; Formats: any}>;
|
|
469
469
|
|
|
470
470
|
export interface DexTable<T> {
|
|
471
471
|
get(name: string): T;
|
|
@@ -476,14 +476,14 @@ export interface Dex {
|
|
|
476
476
|
readonly gen: GenerationNum;
|
|
477
477
|
readonly modid: ID;
|
|
478
478
|
readonly data: {
|
|
479
|
-
Abilities: {
|
|
480
|
-
Aliases: {
|
|
481
|
-
Items: {
|
|
482
|
-
Moves: {
|
|
483
|
-
Species: {
|
|
484
|
-
Natures: {
|
|
485
|
-
Learnsets: null | {
|
|
486
|
-
Types: {
|
|
479
|
+
Abilities: {[id: string]: AbilityData};
|
|
480
|
+
Aliases: {[id: string]: string};
|
|
481
|
+
Items: {[id: string]: ItemData};
|
|
482
|
+
Moves: {[id: string]: MoveData};
|
|
483
|
+
Species: {[id: string]: SpeciesData};
|
|
484
|
+
Natures: {[id: string]: NatureData};
|
|
485
|
+
Learnsets: null | {[id: string]: LearnsetData};
|
|
486
|
+
Types: {[id: string]: TypeData};
|
|
487
487
|
};
|
|
488
488
|
|
|
489
489
|
mod(genid: GenID): Dex;
|
|
@@ -503,14 +503,14 @@ export interface Dex {
|
|
|
503
503
|
species: DexTable<Species>;
|
|
504
504
|
types: DexTable<Type>;
|
|
505
505
|
|
|
506
|
-
getHiddenPower(ivs: StatsTable): {
|
|
506
|
+
getHiddenPower(ivs: StatsTable): {type: TypeName; power: number};
|
|
507
507
|
getImmunity(
|
|
508
|
-
source: {
|
|
509
|
-
target: {
|
|
508
|
+
source: {type: string} | string,
|
|
509
|
+
target: {getTypes: () => string[]} | {types: string[]} | string[] | string
|
|
510
510
|
): boolean;
|
|
511
511
|
getEffectiveness(
|
|
512
|
-
source: {
|
|
513
|
-
target: {
|
|
512
|
+
source: {type: string} | string,
|
|
513
|
+
target: {getTypes: () => string[]} | {types: string[]} | string[] | string
|
|
514
514
|
): number;
|
|
515
515
|
}
|
|
516
516
|
|
|
@@ -537,8 +537,8 @@ export type DeepPartial<T> =
|
|
|
537
537
|
: T extends Set<infer U> ? Set<DeepPartial<U>>
|
|
538
538
|
: T extends ReadonlySet<infer U> ? ReadonlySet<DeepPartial<U>>
|
|
539
539
|
: T extends Array<infer U> ? T extends IsTuple<T>
|
|
540
|
-
? {
|
|
540
|
+
? {[K in keyof T]?: DeepPartial<T[K]>}
|
|
541
541
|
: Array<DeepPartial<U>>
|
|
542
542
|
: T extends Promise<infer U> ? Promise<DeepPartial<U>>
|
|
543
|
-
: T extends {} ? {
|
|
543
|
+
: T extends {} ? {[K in keyof T]?: DeepPartial<T[K]>}
|
|
544
544
|
: Partial<T>;
|