lol-constants 2.5.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -9
- package/core/constants/DataDragonUrls.d.ts +2 -0
- package/core/constants/DataDragonUrls.js +2 -0
- package/core/constants/QueueDescriptions.d.ts +21 -0
- package/core/constants/QueueDescriptions.js +26 -0
- package/core/index.d.ts +5 -0
- package/core/index.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
-
Provides constants and types for League of Legends related stuff within the context of [Riot APIs](https://developer.riotgames.com/docs/lol). Types such as [ChampionId](
|
1
|
+
Provides constants and types for League of Legends related stuff within the context of [Riot APIs](https://developer.riotgames.com/docs/lol). Types such as [`ChampionId`](src/core/constants/Champions/ChampionIds.ts), [`ChampionName`](src/core/constants/Champions/ChampionNames.ts), [`ItemKey`](src/core/constants/Items/ItemKeys.ts), [`RuneId`](src/core/constants/Runes/RuneSetsByRuneNames.ts#L55), [`SpellName`](src/core/constants/Spells/SpellNames.ts), [`Position`](src/core/constants/Positions.ts), [`Queue`](src/core/constants/Queues.ts), [`RankedTier`](src/core/constants/RankedTiers.ts), [`Region`](src/core/constants/Regions.ts) and more are provided. Certain URLs and URIs are available as constants as well in [`DataDragonUrls`](src/core/constants/DataDragonUrls.ts), [`PlatformApiUris`](src/core/constants/PlatformApiUris.ts), [`RegionalApiUris`](src/core/constants/RegionalApiUris.ts).
|
2
2
|
|
3
3
|
Advantages:
|
4
|
-
- Four categories — champions, items, runes, summoner spells — are armed with getter functions that exchange between id–key–name such as [getChampionNameByKey](
|
5
|
-
- Types can be validated through type
|
6
|
-
- Type validation functions such as [isChampionName](
|
7
|
-
|
8
|
-
<!-- - Runes and items are also provided in a categorized way: [StatRuneId](asd), [NonStatRuneId](asd), [DominationRuneId](asd) etc. and [MythicItemName](asd), [LegendaryItemName](asd), [BootsItemName](asd) etc. -->
|
4
|
+
- Four categories — champions, items, runes, summoner spells — are armed with getter functions that exchange between id–key–name such as [`getChampionNameByKey`](src/core/helpers/Champions/getChampionNameByKey.ts)–[`getChampionIdByName`](src/core/helpers/Champions/getChampionIdByName.ts)–[`getChampionKeyById`](src/core/helpers/Champions/getChampionKeyById.ts)
|
5
|
+
- Types can be validated through type-validating functions such as [`isChampionName`](src/core/helpers/Champions/isChampionName.ts)
|
6
|
+
- Type validation functions such as [`isChampionName`](src/core/helpers/Champions/isChampionName.ts) and getter functions such as [`getChampionNameByKey`](src/core/helpers/Champions/getChampionNameByKey.ts) are instantaneous $O(1)$ and do not iterate over many elements
|
9
7
|
|
10
8
|
# Champions
|
11
|
-
| constants | types | getters
|
12
|
-
| --- | --- |
|
13
|
-
| `ChampionIds`, `ChampionKeys` | `ChampionId`, `ChampionKey`, `ChampionKeyNum`, `ChampionName` |
|
9
|
+
| constants | types | getters | type-validators
|
10
|
+
| --- | --- | --- | --- |
|
11
|
+
| `ChampionIds`, `ChampionIdsByName`, `ChampionKeys`, `ChampionKeysNum`, `ChampionNames` | `ChampionId`, `ChampionKey`, `ChampionKeyNum`, `ChampionName` | `getChampionIdByKey`, `getChampionIdByName`, `getChampionKeyById`, `getChampionKeyByName`, `getChampionNameById`, `getChampionNameByKey` | `isChampionId`, `isChampionKey`, `isChampionKeyNum`, `isChampionName`
|
14
12
|
# Items
|
15
13
|
# Runes
|
16
14
|
# Summoner spells
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export declare const QueueDescriptions: {
|
2
|
+
readonly 0: "Custom";
|
3
|
+
readonly 400: "5v5 Draft Pick";
|
4
|
+
readonly 420: "5v5 Ranked Solo";
|
5
|
+
readonly 430: "5v5 Blind Pick";
|
6
|
+
readonly 440: "5v5 Ranked Flex";
|
7
|
+
readonly 450: "5v5 ARAM";
|
8
|
+
readonly 700: "Clash";
|
9
|
+
readonly 900: "ARURF";
|
10
|
+
readonly 920: "Legend of the Poro King";
|
11
|
+
readonly 1020: "One for All";
|
12
|
+
readonly 1090: "Teamfight Tactics";
|
13
|
+
readonly 1100: "Ranked Teamfight Tactics";
|
14
|
+
readonly 1110: "Teamfight Tactics Tutorial";
|
15
|
+
readonly 1111: "Teamfight Tactics test";
|
16
|
+
readonly 1300: "Nexus Blitz";
|
17
|
+
readonly 1400: "Ultimate Spellbook";
|
18
|
+
readonly 1900: "URF";
|
19
|
+
};
|
20
|
+
export type QueueDescription = typeof QueueDescriptions[keyof typeof QueueDescriptions];
|
21
|
+
export declare function isQueueDescription(value: any): value is QueueDescription;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.isQueueDescription = exports.QueueDescriptions = void 0;
|
4
|
+
exports.QueueDescriptions = {
|
5
|
+
0: 'Custom',
|
6
|
+
400: '5v5 Draft Pick',
|
7
|
+
420: '5v5 Ranked Solo',
|
8
|
+
430: '5v5 Blind Pick',
|
9
|
+
440: '5v5 Ranked Flex',
|
10
|
+
450: '5v5 ARAM',
|
11
|
+
700: 'Clash',
|
12
|
+
900: 'ARURF',
|
13
|
+
920: 'Legend of the Poro King',
|
14
|
+
1020: 'One for All',
|
15
|
+
1090: 'Teamfight Tactics',
|
16
|
+
1100: 'Ranked Teamfight Tactics',
|
17
|
+
1110: 'Teamfight Tactics Tutorial',
|
18
|
+
1111: 'Teamfight Tactics test',
|
19
|
+
1300: 'Nexus Blitz',
|
20
|
+
1400: 'Ultimate Spellbook',
|
21
|
+
1900: 'URF',
|
22
|
+
};
|
23
|
+
function isQueueDescription(value) {
|
24
|
+
return typeof value == 'string' && value in exports.QueueDescriptions;
|
25
|
+
}
|
26
|
+
exports.isQueueDescription = isQueueDescription;
|
package/core/index.d.ts
CHANGED
@@ -9,10 +9,14 @@ export * from './constants/Lanes';
|
|
9
9
|
export * from './constants/LaneTypes';
|
10
10
|
export * from './constants/Levels';
|
11
11
|
export * from './constants/Locales';
|
12
|
+
export * from './constants/MapIds';
|
12
13
|
export * from './constants/MonsterTypes';
|
14
|
+
export * from './constants/ParticipantIds';
|
13
15
|
export * from './constants/PlatformApiUris';
|
14
16
|
export * from './constants/PlatformIds';
|
15
17
|
export * from './constants/Positions';
|
18
|
+
export * from './constants/QueueDescriptions';
|
19
|
+
export * from './constants/QueueIds';
|
16
20
|
export * from './constants/Queues';
|
17
21
|
export * from './constants/RankedRanks';
|
18
22
|
export * from './constants/RankedTiers';
|
@@ -22,6 +26,7 @@ export * from './constants/RelativeTeams';
|
|
22
26
|
export * from './constants/Roles';
|
23
27
|
export * from './constants/Skills';
|
24
28
|
export * from './constants/SkillSlots';
|
29
|
+
export * from './constants/TeamIds';
|
25
30
|
export * from './constants/TowerTypes';
|
26
31
|
export * from './constants/WardTypes';
|
27
32
|
export * from './constants/Champions/ChampionIds';
|
package/core/index.js
CHANGED
@@ -26,10 +26,14 @@ __exportStar(require("./constants/Lanes"), exports);
|
|
26
26
|
__exportStar(require("./constants/LaneTypes"), exports);
|
27
27
|
__exportStar(require("./constants/Levels"), exports);
|
28
28
|
__exportStar(require("./constants/Locales"), exports);
|
29
|
+
__exportStar(require("./constants/MapIds"), exports);
|
29
30
|
__exportStar(require("./constants/MonsterTypes"), exports);
|
31
|
+
__exportStar(require("./constants/ParticipantIds"), exports);
|
30
32
|
__exportStar(require("./constants/PlatformApiUris"), exports);
|
31
33
|
__exportStar(require("./constants/PlatformIds"), exports);
|
32
34
|
__exportStar(require("./constants/Positions"), exports);
|
35
|
+
__exportStar(require("./constants/QueueDescriptions"), exports);
|
36
|
+
__exportStar(require("./constants/QueueIds"), exports);
|
33
37
|
__exportStar(require("./constants/Queues"), exports);
|
34
38
|
__exportStar(require("./constants/RankedRanks"), exports);
|
35
39
|
__exportStar(require("./constants/RankedTiers"), exports);
|
@@ -39,6 +43,7 @@ __exportStar(require("./constants/RelativeTeams"), exports);
|
|
39
43
|
__exportStar(require("./constants/Roles"), exports);
|
40
44
|
__exportStar(require("./constants/Skills"), exports);
|
41
45
|
__exportStar(require("./constants/SkillSlots"), exports);
|
46
|
+
__exportStar(require("./constants/TeamIds"), exports);
|
42
47
|
__exportStar(require("./constants/TowerTypes"), exports);
|
43
48
|
__exportStar(require("./constants/WardTypes"), exports);
|
44
49
|
// ## Champions
|
package/package.json
CHANGED