@malib/gear 0.9.0 → 0.10.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.
@@ -7,47 +7,76 @@ import { Soul } from "../soul";
7
7
  * `Gear`를 나타내는 순수 객체 형식
8
8
  */
9
9
  export interface GearLike {
10
+ /** id */
10
11
  id: number;
11
- name: string;
12
- desc?: string;
13
- icon: GearIcon;
14
- anvilIcon?: GearIcon;
15
- anvilName?: string;
16
- type: GearType;
17
- req: GearReq;
18
- props: [GearPropType, number][];
19
- options: [GearPropType, OptionLike][];
20
- tuc?: number;
12
+ /** name */
13
+ n: string;
14
+ /** desc */
15
+ d?: string;
16
+ /** icon */
17
+ i: GearIcon;
18
+ /** anvilIcon */
19
+ i2?: GearIcon;
20
+ /** anvilName */
21
+ n2?: string;
22
+ /** type */
23
+ t: GearType;
24
+ /** req */
25
+ r: GearReq;
26
+ /** props */
27
+ pr: [GearPropType, number][];
28
+ /** options */
29
+ o: [GearPropType, OptionLike][];
30
+ /** totalUpgradeCount */
31
+ c?: number;
32
+ /** upgradeCount */
21
33
  up?: number;
22
- fail?: number;
23
- hammer?: number;
24
- maxStar?: number;
25
- star?: number;
26
- amazing?: boolean;
27
- karma?: number;
28
- canPot?: boolean;
29
- grade?: PotentialGrade;
30
- pots?: (PotLike | null)[];
31
- addGrade?: PotentialGrade;
32
- addPots?: (PotLike | null)[];
33
- soulWeapon: SoulWeaponLike;
34
- }
35
- export interface OptionLike {
36
- base?: number;
37
- bonus?: number;
38
- upgrade?: number;
39
- enchant?: number;
34
+ /** failCount */
35
+ f?: number;
36
+ /** hammerCount */
37
+ h?: number;
38
+ /** maxStar */
39
+ m?: number;
40
+ /** star */
41
+ s?: number;
42
+ /** amazing */
43
+ a?: boolean;
44
+ /** karma */
45
+ k?: number;
46
+ /** canPotential */
47
+ cp?: boolean;
48
+ /** grade */
49
+ g?: PotentialGrade;
50
+ /** potentials */
51
+ p?: (PotLike | null)[];
52
+ /** additionalGrade */
53
+ g2?: PotentialGrade;
54
+ /** additionalPotentials */
55
+ p2?: (PotLike | null)[];
56
+ /** soulWeapon */
57
+ w?: SoulWeaponLike;
40
58
  }
59
+ /** base, bonus, upgrade, enchant */
60
+ export type OptionLike = [number, number, number, number];
41
61
  export interface PotLike {
42
- code: number;
43
- optionType: number;
44
- reqLevel: number;
45
- summary: string;
46
- option: [GearPropType, number][];
62
+ /** code */
63
+ c: number;
64
+ /** optionType */
65
+ t: number;
66
+ /** reqLevel */
67
+ l: number;
68
+ /** summary */
69
+ s: string;
70
+ /** options */
71
+ o: [GearPropType, number][];
47
72
  }
48
73
  export interface SoulWeaponLike {
49
- enchanted?: boolean;
50
- soul?: Soul;
51
- charge?: number;
52
- chargeOption?: [GearPropType, number][];
74
+ /** enchanted */
75
+ e?: boolean;
76
+ /** soul */
77
+ s?: Soul;
78
+ /** charge */
79
+ c?: number;
80
+ /** chargeOption */
81
+ o?: [GearPropType, number][];
53
82
  }
@@ -17,3 +17,11 @@ export declare function parseGear(like: string): Gear;
17
17
  * @returns 장비. 입력이 잘못되었을 경우 `null`을 반환합니다.
18
18
  */
19
19
  export declare function validateParseGear(maybe: string): Gear | null;
20
+ export declare function serializeMap<K, V>(map: Map<K, V>, filterFunc?: (val: V) => boolean): [K, V][];
21
+ export declare function serializeMap<K, V, VLike>(map: Map<K, V>, filterFunc: ((val: V) => boolean) | undefined, convertFunc: (val: V) => VLike): [K, VLike][];
22
+ export declare function serializeArray<T>(arr: T[], filterFunc?: (e: T) => boolean): T[];
23
+ export declare function serializeArray<T, TLike>(arr: T[], filterFunc: ((e: T) => boolean) | undefined, convertFunc: (e: T) => TLike): TLike[];
24
+ export declare function deserializeMap<K, V>(mapLike: [K, V][]): Map<K, V>;
25
+ export declare function deserializeMap<K, V, VLike>(mapLike: [K, VLike][], func: (val: VLike) => V): Map<K, V>;
26
+ export declare function deserializeArray<T>(arr: T[]): T[];
27
+ export declare function deserializeArray<T, TLike>(arr: TLike[], func: (e: TLike) => T): T[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malib/gear",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",