koffing 1.0.0 → 2.0.0

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.
@@ -0,0 +1,62 @@
1
+ //#region src/types.d.ts
2
+ type StatID = "hp" | "atk" | "def" | "spa" | "spd" | "spe";
3
+ type Stats = Partial<Record<StatID, number>>;
4
+ /** Showdown-compatible sparse set. `name` is the nickname, never the species. */
5
+ interface PokemonSet {
6
+ species: string;
7
+ name?: string;
8
+ item?: string;
9
+ ability?: string;
10
+ gender?: "M" | "F" | "N" | "";
11
+ moves: string[];
12
+ nature?: string;
13
+ evs?: Stats;
14
+ ivs?: Stats;
15
+ level?: number;
16
+ shiny?: boolean;
17
+ happiness?: number;
18
+ pokeball?: string;
19
+ hpType?: string;
20
+ dynamaxLevel?: number;
21
+ gigantamax?: boolean;
22
+ teraType?: string;
23
+ }
24
+ /** Metadata belongs to the collection wrapper, not to Showdown's set array. */
25
+ interface Team {
26
+ name?: string;
27
+ format?: string;
28
+ folder?: string;
29
+ pokemon: PokemonSet[];
30
+ }
31
+ interface Diagnostic {
32
+ code: string;
33
+ severity: "warning" | "error";
34
+ message: string;
35
+ /** One-based source line, when the input is text. */
36
+ line?: number;
37
+ path?: string;
38
+ }
39
+ interface Limits {
40
+ /** UTF-16 code units, checked before splitting or JSON decoding. */
41
+ maxInputLength: number;
42
+ maxLineLength: number;
43
+ maxTeams: number;
44
+ maxPokemon: number;
45
+ maxMoves: number;
46
+ maxDiagnostics: number;
47
+ }
48
+ interface Options {
49
+ /** Strict mode throws on any diagnostic; permissive mode returns them. */
50
+ mode?: "strict" | "permissive";
51
+ limits?: Partial<Limits>;
52
+ }
53
+ interface ParseResult {
54
+ teams: Team[];
55
+ diagnostics: Diagnostic[];
56
+ }
57
+ interface SanitizeOptions extends Options {
58
+ maxLevel?: number;
59
+ maxMovesPerPokemon?: number;
60
+ }
61
+ //#endregion
62
+ export { PokemonSet as a, Stats as c, ParseResult as i, Team as l, Limits as n, SanitizeOptions as o, Options as r, StatID as s, Diagnostic as t };
@@ -0,0 +1,62 @@
1
+ //#region src/types.d.ts
2
+ type StatID = "hp" | "atk" | "def" | "spa" | "spd" | "spe";
3
+ type Stats = Partial<Record<StatID, number>>;
4
+ /** Showdown-compatible sparse set. `name` is the nickname, never the species. */
5
+ interface PokemonSet {
6
+ species: string;
7
+ name?: string;
8
+ item?: string;
9
+ ability?: string;
10
+ gender?: "M" | "F" | "N" | "";
11
+ moves: string[];
12
+ nature?: string;
13
+ evs?: Stats;
14
+ ivs?: Stats;
15
+ level?: number;
16
+ shiny?: boolean;
17
+ happiness?: number;
18
+ pokeball?: string;
19
+ hpType?: string;
20
+ dynamaxLevel?: number;
21
+ gigantamax?: boolean;
22
+ teraType?: string;
23
+ }
24
+ /** Metadata belongs to the collection wrapper, not to Showdown's set array. */
25
+ interface Team {
26
+ name?: string;
27
+ format?: string;
28
+ folder?: string;
29
+ pokemon: PokemonSet[];
30
+ }
31
+ interface Diagnostic {
32
+ code: string;
33
+ severity: "warning" | "error";
34
+ message: string;
35
+ /** One-based source line, when the input is text. */
36
+ line?: number;
37
+ path?: string;
38
+ }
39
+ interface Limits {
40
+ /** UTF-16 code units, checked before splitting or JSON decoding. */
41
+ maxInputLength: number;
42
+ maxLineLength: number;
43
+ maxTeams: number;
44
+ maxPokemon: number;
45
+ maxMoves: number;
46
+ maxDiagnostics: number;
47
+ }
48
+ interface Options {
49
+ /** Strict mode throws on any diagnostic; permissive mode returns them. */
50
+ mode?: "strict" | "permissive";
51
+ limits?: Partial<Limits>;
52
+ }
53
+ interface ParseResult {
54
+ teams: Team[];
55
+ diagnostics: Diagnostic[];
56
+ }
57
+ interface SanitizeOptions extends Options {
58
+ maxLevel?: number;
59
+ maxMovesPerPokemon?: number;
60
+ }
61
+ //#endregion
62
+ export { PokemonSet as a, Stats as c, ParseResult as i, Team as l, Limits as n, SanitizeOptions as o, Options as r, StatID as s, Diagnostic as t };