lol-constants 0.7.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ import { StatRuneId } from '../types';
2
+ export declare const StatRuneIds: StatRuneId[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatRuneIds = void 0;
4
+ const StatRunes_1 = require("./StatRunes");
5
+ exports.StatRuneIds = (Object.keys(StatRunes_1.StatRunes).map(id => id));
@@ -0,0 +1,2 @@
1
+ import { StatRuneName } from '../types';
2
+ export declare const StatRuneNames: StatRuneName[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatRuneNames = void 0;
4
+ const StatRunes_1 = require("./StatRunes");
5
+ exports.StatRuneNames = Object.values(StatRunes_1.StatRunes);
@@ -1,11 +1,11 @@
1
1
  export declare const StatRunes: {
2
- readonly '5001': "DefenseHP";
3
- readonly '5002': "DefenseAR";
4
- readonly '5003': "DefenseMR";
5
- readonly '5002f': "FlexAR";
6
- readonly '5003f': "FlexMR";
7
- readonly '5008f': "FlexAF";
8
- readonly '5005': "OffenseAS";
9
- readonly '5007': "OffenseAH";
10
- readonly '5008': "OffenseAF";
2
+ readonly '5001': "Defense (HP)";
3
+ readonly '5002': "Defense (AR)";
4
+ readonly '5003': "Defense (MR)";
5
+ readonly '5002f': "Flex (AR)";
6
+ readonly '5003f': "Flex (MR)";
7
+ readonly '5008f': "Flex (AF)";
8
+ readonly '5005': "Offense (AS)";
9
+ readonly '5007': "Offense (AH)";
10
+ readonly '5008': "Offense (AF)";
11
11
  };
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatRunes = void 0;
4
4
  exports.StatRunes = {
5
- '5001': 'DefenseHP',
6
- '5002': 'DefenseAR',
7
- '5003': 'DefenseMR',
8
- '5002f': 'FlexAR',
9
- '5003f': 'FlexMR',
10
- '5008f': 'FlexAF',
11
- '5005': 'OffenseAS',
12
- '5007': 'OffenseAH',
13
- '5008': 'OffenseAF',
5
+ '5001': 'Defense (HP)',
6
+ '5002': 'Defense (AR)',
7
+ '5003': 'Defense (MR)',
8
+ '5002f': 'Flex (AR)',
9
+ '5003f': 'Flex (MR)',
10
+ '5008f': 'Flex (AF)',
11
+ '5005': 'Offense (AS)',
12
+ '5007': 'Offense (AH)',
13
+ '5008': 'Offense (AF)',
14
14
  };
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellId } from '../types';
2
+ export declare const SummonerSpellIds: SummonerSpellId[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SummonerSpellIds = void 0;
7
+ const summoner_json_1 = __importDefault(require("../assets/summoner.json"));
8
+ exports.SummonerSpellIds = (Object.keys(summoner_json_1.default.data).map(id => id));
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellKey } from '../types';
2
+ export declare const SummonerSpellKeys: SummonerSpellKey[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SummonerSpellKeys = void 0;
7
+ const summonerByKey_json_1 = __importDefault(require("../generated/summonerByKey.json"));
8
+ exports.SummonerSpellKeys = (Object.keys(summonerByKey_json_1.default.data).map(key => key));
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellName } from '../types';
2
+ export declare const SummonerSpellNames: SummonerSpellName[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SummonerSpellNames = void 0;
7
+ const summonerByName_json_1 = __importDefault(require("../generated/summonerByName.json"));
8
+ exports.SummonerSpellNames = (Object.keys(summonerByName_json_1.default.data).map(name => name));
@@ -0,0 +1,2 @@
1
+ import { TreeRuneId } from '../types';
2
+ export declare const TreeRuneIds: TreeRuneId[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TreeRuneIds = void 0;
7
+ const runesById_json_1 = __importDefault(require("../generated/runesById.json"));
8
+ exports.TreeRuneIds = (Object.keys(runesById_json_1.default).map(id => id));
@@ -0,0 +1,2 @@
1
+ import { TreeRuneName } from '../types';
2
+ export declare const TreeRuneNames: TreeRuneName[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TreeRuneNames = void 0;
7
+ const runesByName_json_1 = __importDefault(require("../generated/runesByName.json"));
8
+ exports.TreeRuneNames = (Object.keys(runesByName_json_1.default).map(name => name));
@@ -0,0 +1 @@
1
+ export declare function generateSummonerSpellsByKey(): void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generateSummonerSpellsByKey = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const summoner_json_1 = __importDefault(require("../assets/summoner.json"));
9
+ function generateSummonerSpellsByKey() {
10
+ const summonersByKey = {
11
+ data: {},
12
+ version: '',
13
+ };
14
+ let summonerId;
15
+ for (summonerId in summoner_json_1.default.data) {
16
+ const summonerData = summoner_json_1.default.data[summonerId];
17
+ summonersByKey.data[summonerData.key] = {
18
+ ...summonerData,
19
+ };
20
+ }
21
+ summonersByKey.version = summoner_json_1.default.version;
22
+ fs_1.default.writeFileSync(`src/generated/summonerByKey.json`, JSON.stringify(summonersByKey));
23
+ }
24
+ exports.generateSummonerSpellsByKey = generateSummonerSpellsByKey;
@@ -0,0 +1 @@
1
+ export declare function generateSummonerSpellsByName(): void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generateSummonerSpellsByName = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const summoner_json_1 = __importDefault(require("../assets/summoner.json"));
9
+ function generateSummonerSpellsByName() {
10
+ const summonersByName = {
11
+ data: {},
12
+ version: '',
13
+ };
14
+ let summonerId;
15
+ for (summonerId in summoner_json_1.default.data) {
16
+ const summonerData = summoner_json_1.default.data[summonerId];
17
+ summonersByName.data[summonerData.name] = {
18
+ ...summonerData,
19
+ };
20
+ }
21
+ summonersByName.version = summoner_json_1.default.version;
22
+ fs_1.default.writeFileSync(`src/generated/summonerByName.json`, JSON.stringify(summonersByName));
23
+ }
24
+ exports.generateSummonerSpellsByName = generateSummonerSpellsByName;
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellId } from '../types';
2
+ export declare function isSummonerSpellId(id: any): id is SummonerSpellId;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSummonerSpellId = void 0;
4
+ const SummonerSpellIds_1 = require("../Constants/SummonerSpellIds");
5
+ function isSummonerSpellId(id) {
6
+ if (SummonerSpellIds_1.SummonerSpellIds.includes(id))
7
+ return true;
8
+ return false;
9
+ }
10
+ exports.isSummonerSpellId = isSummonerSpellId;
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellKey } from '../types';
2
+ export declare function isSummonerSpellKey(key: any): key is SummonerSpellKey;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSummonerSpellKey = void 0;
4
+ const SummonerSpellKeys_1 = require("../Constants/SummonerSpellKeys");
5
+ function isSummonerSpellKey(key) {
6
+ if (SummonerSpellKeys_1.SummonerSpellKeys.includes(key))
7
+ return true;
8
+ return false;
9
+ }
10
+ exports.isSummonerSpellKey = isSummonerSpellKey;
@@ -0,0 +1,2 @@
1
+ import { SummonerSpellName } from '../types';
2
+ export declare function isSummonerSpellName(name: any): name is SummonerSpellName;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSummonerSpellName = void 0;
4
+ const SummonerSpellNames_1 = require("../Constants/SummonerSpellNames");
5
+ function isSummonerSpellName(name) {
6
+ if (SummonerSpellNames_1.SummonerSpellNames.includes(name))
7
+ return true;
8
+ return false;
9
+ }
10
+ exports.isSummonerSpellName = isSummonerSpellName;
package/dist/index.d.ts CHANGED
@@ -17232,10 +17232,14 @@ export { ItemKeys } from './Constants/ItemKeys';
17232
17232
  export { ItemNames } from './Constants/ItemNames';
17233
17233
  export { RuneIds } from './Constants/RuneIds';
17234
17234
  export { RuneNames } from './Constants/RuneNames';
17235
+ export { StatRuneIds } from './Constants/StatRuneIds';
17236
+ export { StatRuneNames } from './Constants/StatRuneNames';
17235
17237
  export { StatRunes } from './Constants/StatRunes';
17236
- export { SummonerIds } from './Constants/SummonerIds';
17237
- export { SummonerKeys } from './Constants/SummonerKeys';
17238
- export { SummonerNames } from './Constants/SummonerNames';
17238
+ export { SummonerSpellIds } from './Constants/SummonerSpellIds';
17239
+ export { SummonerSpellKeys } from './Constants/SummonerSpellKeys';
17240
+ export { SummonerSpellNames } from './Constants/SummonerSpellNames';
17241
+ export { TreeRuneIds } from './Constants/TreeRuneIds';
17242
+ export { TreeRuneNames } from './Constants/TreeRuneNames';
17239
17243
  export declare const championByKey: {
17240
17244
  data: {
17241
17245
  "1": {
@@ -43399,8 +43403,8 @@ export { isItemKey } from './Helpers/isItemKey';
43399
43403
  export { isItemName } from './Helpers/isItemName';
43400
43404
  export { isRuneId } from './Helpers/isRuneId';
43401
43405
  export { isRuneName } from './Helpers/isRuneName';
43402
- export { isSummonerId } from './Helpers/isSummonerId';
43403
- export { isSummonerKey } from './Helpers/isSummonerKey';
43404
- export { isSummonerName } from './Helpers/isSummonerName';
43406
+ export { isSummonerSpellId } from './Helpers/isSummonerSpellId';
43407
+ export { isSummonerSpellKey } from './Helpers/isSummonerSpellKey';
43408
+ export { isSummonerSpellName } from './Helpers/isSummonerSpellName';
43405
43409
  export * from './types';
43406
43410
  export * from './types/Meta';
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.isSummonerName = exports.isSummonerKey = exports.isSummonerId = exports.isRuneName = exports.isRuneId = exports.isItemName = exports.isItemKey = exports.isChampionName = exports.isChampionKey = exports.summonerByName = exports.summonerByKey = exports.runesByName = exports.runesById = exports.itemByName = exports.championByName = exports.championByKey = exports.SummonerNames = exports.SummonerKeys = exports.SummonerIds = exports.StatRunes = exports.RuneNames = exports.RuneIds = exports.ItemNames = exports.ItemKeys = exports.DDPaths = exports.ChampionNames = exports.ChampionKeys = exports.summoner = exports.runesReforged = exports.item = exports.champion = void 0;
20
+ exports.isSummonerSpellName = exports.isSummonerSpellKey = exports.isSummonerSpellId = exports.isRuneName = exports.isRuneId = exports.isItemName = exports.isItemKey = exports.isChampionName = exports.isChampionKey = exports.summonerByName = exports.summonerByKey = exports.runesByName = exports.runesById = exports.itemByName = exports.championByName = exports.championByKey = exports.TreeRuneNames = exports.TreeRuneIds = exports.SummonerSpellNames = exports.SummonerSpellKeys = exports.SummonerSpellIds = exports.StatRunes = exports.StatRuneNames = exports.StatRuneIds = exports.RuneNames = exports.RuneIds = exports.ItemNames = exports.ItemKeys = exports.DDPaths = exports.ChampionNames = exports.ChampionKeys = exports.summoner = exports.runesReforged = exports.item = exports.champion = void 0;
21
21
  const champion_json_1 = __importDefault(require("./assets/champion.json"));
22
22
  const item_json_1 = __importDefault(require("./assets/item.json"));
23
23
  const runesReforged_json_1 = __importDefault(require("./assets/runesReforged.json"));
@@ -40,14 +40,22 @@ var RuneIds_1 = require("./Constants/RuneIds");
40
40
  Object.defineProperty(exports, "RuneIds", { enumerable: true, get: function () { return RuneIds_1.RuneIds; } });
41
41
  var RuneNames_1 = require("./Constants/RuneNames");
42
42
  Object.defineProperty(exports, "RuneNames", { enumerable: true, get: function () { return RuneNames_1.RuneNames; } });
43
+ var StatRuneIds_1 = require("./Constants/StatRuneIds");
44
+ Object.defineProperty(exports, "StatRuneIds", { enumerable: true, get: function () { return StatRuneIds_1.StatRuneIds; } });
45
+ var StatRuneNames_1 = require("./Constants/StatRuneNames");
46
+ Object.defineProperty(exports, "StatRuneNames", { enumerable: true, get: function () { return StatRuneNames_1.StatRuneNames; } });
43
47
  var StatRunes_1 = require("./Constants/StatRunes");
44
48
  Object.defineProperty(exports, "StatRunes", { enumerable: true, get: function () { return StatRunes_1.StatRunes; } });
45
- var SummonerIds_1 = require("./Constants/SummonerIds");
46
- Object.defineProperty(exports, "SummonerIds", { enumerable: true, get: function () { return SummonerIds_1.SummonerIds; } });
47
- var SummonerKeys_1 = require("./Constants/SummonerKeys");
48
- Object.defineProperty(exports, "SummonerKeys", { enumerable: true, get: function () { return SummonerKeys_1.SummonerKeys; } });
49
- var SummonerNames_1 = require("./Constants/SummonerNames");
50
- Object.defineProperty(exports, "SummonerNames", { enumerable: true, get: function () { return SummonerNames_1.SummonerNames; } });
49
+ var SummonerSpellIds_1 = require("./Constants/SummonerSpellIds");
50
+ Object.defineProperty(exports, "SummonerSpellIds", { enumerable: true, get: function () { return SummonerSpellIds_1.SummonerSpellIds; } });
51
+ var SummonerSpellKeys_1 = require("./Constants/SummonerSpellKeys");
52
+ Object.defineProperty(exports, "SummonerSpellKeys", { enumerable: true, get: function () { return SummonerSpellKeys_1.SummonerSpellKeys; } });
53
+ var SummonerSpellNames_1 = require("./Constants/SummonerSpellNames");
54
+ Object.defineProperty(exports, "SummonerSpellNames", { enumerable: true, get: function () { return SummonerSpellNames_1.SummonerSpellNames; } });
55
+ var TreeRuneIds_1 = require("./Constants/TreeRuneIds");
56
+ Object.defineProperty(exports, "TreeRuneIds", { enumerable: true, get: function () { return TreeRuneIds_1.TreeRuneIds; } });
57
+ var TreeRuneNames_1 = require("./Constants/TreeRuneNames");
58
+ Object.defineProperty(exports, "TreeRuneNames", { enumerable: true, get: function () { return TreeRuneNames_1.TreeRuneNames; } });
51
59
  const championByKey_json_1 = __importDefault(require("./generated/championByKey.json"));
52
60
  const championByName_json_1 = __importDefault(require("./generated/championByName.json"));
53
61
  const itemByName_json_1 = __importDefault(require("./generated/itemByName.json"));
@@ -74,11 +82,11 @@ var isRuneId_1 = require("./Helpers/isRuneId");
74
82
  Object.defineProperty(exports, "isRuneId", { enumerable: true, get: function () { return isRuneId_1.isRuneId; } });
75
83
  var isRuneName_1 = require("./Helpers/isRuneName");
76
84
  Object.defineProperty(exports, "isRuneName", { enumerable: true, get: function () { return isRuneName_1.isRuneName; } });
77
- var isSummonerId_1 = require("./Helpers/isSummonerId");
78
- Object.defineProperty(exports, "isSummonerId", { enumerable: true, get: function () { return isSummonerId_1.isSummonerId; } });
79
- var isSummonerKey_1 = require("./Helpers/isSummonerKey");
80
- Object.defineProperty(exports, "isSummonerKey", { enumerable: true, get: function () { return isSummonerKey_1.isSummonerKey; } });
81
- var isSummonerName_1 = require("./Helpers/isSummonerName");
82
- Object.defineProperty(exports, "isSummonerName", { enumerable: true, get: function () { return isSummonerName_1.isSummonerName; } });
85
+ var isSummonerSpellId_1 = require("./Helpers/isSummonerSpellId");
86
+ Object.defineProperty(exports, "isSummonerSpellId", { enumerable: true, get: function () { return isSummonerSpellId_1.isSummonerSpellId; } });
87
+ var isSummonerSpellKey_1 = require("./Helpers/isSummonerSpellKey");
88
+ Object.defineProperty(exports, "isSummonerSpellKey", { enumerable: true, get: function () { return isSummonerSpellKey_1.isSummonerSpellKey; } });
89
+ var isSummonerSpellName_1 = require("./Helpers/isSummonerSpellName");
90
+ Object.defineProperty(exports, "isSummonerSpellName", { enumerable: true, get: function () { return isSummonerSpellName_1.isSummonerSpellName; } });
83
91
  __exportStar(require("./types"), exports);
84
92
  __exportStar(require("./types/Meta"), exports);
@@ -5,15 +5,15 @@ const generateChampionsByName_1 = require("../Helpers/generateChampionsByName");
5
5
  const generateItemsByName_1 = require("../Helpers/generateItemsByName");
6
6
  const generateRunesById_1 = require("../Helpers/generateRunesById");
7
7
  const generateRunesByName_1 = require("../Helpers/generateRunesByName");
8
- const generateSummonersByKey_1 = require("../Helpers/generateSummonersByKey");
9
- const generateSummonersByName_1 = require("../Helpers/generateSummonersByName");
8
+ const generateSummonerSpellsByKey_1 = require("../Helpers/generateSummonerSpellsByKey");
9
+ const generateSummonerSpellsByName_1 = require("../Helpers/generateSummonerSpellsByName");
10
10
  const generateJSONs = () => {
11
11
  (0, generateChampionsByKey_1.generateChampionsByKey)();
12
12
  (0, generateChampionsByName_1.generateChampionsByName)();
13
13
  (0, generateItemsByName_1.generateItemsByName)();
14
14
  (0, generateRunesById_1.generateRunesById)();
15
15
  (0, generateRunesByName_1.generateRunesByName)();
16
- (0, generateSummonersByKey_1.generateSummonersByKey)();
17
- (0, generateSummonersByName_1.generateSummonersByName)();
16
+ (0, generateSummonerSpellsByKey_1.generateSummonerSpellsByKey)();
17
+ (0, generateSummonerSpellsByName_1.generateSummonerSpellsByName)();
18
18
  };
19
19
  generateJSONs();
@@ -12,11 +12,15 @@ export declare type ChampionKey = keyof typeof championByKey.data;
12
12
  export declare type ChampionName = keyof typeof championByName.data;
13
13
  export declare type ItemKey = keyof typeof item.data;
14
14
  export declare type ItemName = keyof typeof itemByName.data;
15
- export declare type SummonerId = keyof typeof summoner.data;
16
- export declare type SummonerKey = keyof typeof summonerByKey.data;
17
- export declare type SummonerName = keyof typeof summonerByName.data;
18
- export declare type RuneId = keyof typeof runesById | keyof typeof StatRunes;
19
- export declare type RuneName = keyof typeof runesByName;
15
+ export declare type SummonerSpellId = keyof typeof summoner.data;
16
+ export declare type SummonerSpellKey = keyof typeof summonerByKey.data;
17
+ export declare type SummonerSpellName = keyof typeof summonerByName.data;
18
+ export declare type RuneId = TreeRuneId | StatRuneId;
19
+ export declare type RuneName = TreeRuneName | StatRuneName;
20
+ export declare type TreeRuneId = keyof typeof runesById;
21
+ export declare type TreeRuneName = keyof typeof runesByName;
22
+ export declare type StatRuneId = keyof typeof StatRunes;
23
+ export declare type StatRuneName = typeof StatRunes[keyof typeof StatRunes];
20
24
  export declare type XP = number;
21
25
  export declare type Minute = number;
22
26
  export declare type TPosition = 'TOP' | 'JUNGLE' | 'MIDDLE' | 'BOTTOM' | 'UTILITY';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lol-constants",
3
- "version": "0.7.1",
4
- "description": "League of Legends constants and data resources, such as champion, item, runes reforged, summoner.",
3
+ "version": "0.9.0",
4
+ "description": "League of Legends constants and data resources, such as champion, item, runes reforged, summoner spells.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "MIT",