Skip to content

Commit 9424247

Browse files
author
TurtlePaw
committed
Change to enums
1 parent f8309fb commit 9424247

21 files changed

+2577
-8754
lines changed

dist/src/Classes/Category.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ var Category = /** @class */ (function () {
117117
* @static
118118
*/
119119
Category.isNameResolvable = function (arg) {
120-
var _a, _b;
120+
var _a;
121121
var completeNameList = __spreadArray(__spreadArray([], Object.keys(this.allPrettyNames), true), Object.keys(this.allNames), true).filter(function (str) { return isNaN(str); })
122122
.map(function (str) { return str.toLowerCase(); });
123-
return completeNameList.includes((_b = (_a = arg) === null || _a === void 0 ? void 0 : _a.toLowerCase) === null || _b === void 0 ? void 0 : _b.call(_a));
123+
return completeNameList.includes((_a = arg === null || arg === void 0 ? void 0 : arg.toLowerCase) === null || _a === void 0 ? void 0 : _a.call(arg));
124124
};
125125
/**
126126
* Converts a category's pretty name into it's strict version
@@ -150,7 +150,7 @@ var Category = /** @class */ (function () {
150150
* @static
151151
*/
152152
Category.random = function (type) {
153-
if (type === void 0) { type = "ID"; }
153+
if (type === void 0) { type = enums_1.CategoryType.Id; }
154154
var names = Object.keys(this.allPrettyNames).filter(function (val) {
155155
return isNaN(+val);
156156
});

dist/src/Classes/Category.test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3+
var enums_1 = require("../Typings/enums");
34
var Category_1 = require("./Category");
45
function createInstance(arg) {
56
return new Category_1.default(arg);
@@ -94,9 +95,9 @@ test("Test outputs of Category.strictToPrettyName()", function () {
9495
expect(Category_1.default.strictToPrettyName("text")).toBe(null);
9596
expect(Category_1.default.strictToPrettyName(true)).toBe(null);
9697
expect(Category_1.default.strictToPrettyName("General Knowledge")).toBe(null);
97-
expect(Category_1.default.strictToPrettyName("GENERAL_KNOWLEDGE")).toBe("General Knowledge");
98+
expect(Category_1.default.strictToPrettyName("GeneralKnowledge")).toBe("General Knowledge");
9899
expect(Category_1.default.strictToPrettyName("Entertainment: Cartoon and Animations")).toBe(null);
99-
expect(Category_1.default.strictToPrettyName("ENTERTAINMENT_CARTOON_AND_ANIMATIONS")).toBe("Entertainment: Cartoon and Animations");
100+
expect(Category_1.default.strictToPrettyName("EntertainmentCartoonAndAnimations")).toBe("Entertainment: Cartoon and Animations");
100101
});
101102
test("Tests outputs for Category.random()", function () {
102103
expect(Category_1.default.random(1)).toBeGreaterThanOrEqual(9);
@@ -105,9 +106,9 @@ test("Tests outputs for Category.random()", function () {
105106
expect(Category_1.default.random({})).toBeLessThanOrEqual(32);
106107
expect(Category_1.default.random(true)).toBeGreaterThanOrEqual(9);
107108
expect(Category_1.default.random(true)).toBeLessThanOrEqual(32);
108-
expect(Category_1.default.random("ID")).toBeGreaterThanOrEqual(9);
109-
expect(Category_1.default.random("ID")).toBeLessThanOrEqual(32);
110-
expect(typeof Category_1.default.random("NAME")).toBe("string");
109+
expect(Category_1.default.random(enums_1.CategoryType.Id)).toBeGreaterThanOrEqual(9);
110+
expect(Category_1.default.random(enums_1.CategoryType.Id)).toBeLessThanOrEqual(32);
111+
expect(typeof Category_1.default.random(enums_1.CategoryType.Name)).toBe("string");
111112
});
112113
test("Tests outputs for Category.resolve()", function () {
113114
expect(Category_1.default.resolve(8)).toBe(null);

dist/src/Classes/Validator.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { QuestionDifficulties, QuestionEncodings, QuestionTypes } from "../Typings/enums";
12
import { QuestionOptions } from "../Typings/interfaces";
2-
import { QuestionDifficulty } from "../Typings/types";
33
export default class Validator {
44
private readonly options;
55
constructor(options: QuestionOptions);
66
checkAmount(): number | null;
77
checkCategory(): number | null;
8-
checkDifficulty(): QuestionDifficulty | null;
9-
checkEncode(): "none" | "base64" | "url3986" | "urlLegacy" | null;
8+
checkDifficulty(): QuestionDifficulties | null;
9+
checkEncode(): QuestionEncodings | null;
1010
checkToken(): string | null;
11-
checkType(): "boolean" | "multiple" | null;
11+
checkType(): QuestionTypes | null;
1212
static _checkCategory(category: unknown): number | null;
1313
}

dist/src/Classes/Validator.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ var Validator = /** @class */ (function () {
8383
if (typeof difficulty != "string") {
8484
throw new CustomErrors_1.OpenTDBError("'difficulty' option for QuestionOptions must be of type string, received ".concat(typeof difficulty), CustomErrors_1.OpenTDBError.errors.headers.INVALID_OPT);
8585
}
86-
var values = ["easy", "medium", "hard"];
86+
var values = [
87+
enums_1.QuestionDifficulties.Easy,
88+
enums_1.QuestionDifficulties.Medium,
89+
enums_1.QuestionDifficulties.Hard
90+
];
8791
if (!values.includes(difficulty)) {
8892
throw new CustomErrors_1.OpenTDBError("'difficulty' option (\"".concat(difficulty, "\") for QuestionOptions does not resolve into a question difficulty"), CustomErrors_1.OpenTDBError.errors.headers.INVALID_OPT);
8993
}
@@ -97,10 +101,10 @@ var Validator = /** @class */ (function () {
97101
throw new CustomErrors_1.OpenTDBError("'encode' option for QuestionOptions must be of type string, received ".concat(typeof encode), CustomErrors_1.OpenTDBError.errors.headers.INVALID_OPT);
98102
}
99103
var values = [
100-
"base64",
101-
"none",
102-
"url3986",
103-
"urlLegacy",
104+
enums_1.QuestionEncodings.UrlLegacy,
105+
enums_1.QuestionEncodings.Url3986,
106+
enums_1.QuestionEncodings.Base64,
107+
enums_1.QuestionEncodings.None
104108
];
105109
if (!values.includes(encode)) {
106110
throw new CustomErrors_1.OpenTDBError("'encode' option (\"".concat(encode, "\") for QuestionOptions does not resolve into a question encode"), CustomErrors_1.OpenTDBError.errors.headers.INVALID_OPT);
@@ -126,7 +130,10 @@ var Validator = /** @class */ (function () {
126130
if (typeof type != "string") {
127131
throw new CustomErrors_1.OpenTDBError("'type' option for QuestionOptions must be of type string, received ".concat(typeof type), CustomErrors_1.OpenTDBError.errors.headers.INVALID_OPT);
128132
}
129-
var values = ["boolean", "multiple"];
133+
var values = [
134+
enums_1.QuestionTypes.Boolean,
135+
enums_1.QuestionTypes.Multiple
136+
];
130137
if (!values.includes(type)) {
131138
throw new CustomErrors_1.OpenTDBError("'type' option (\"".concat(type, "\") for QuestionOptions does not resolve into a question type"), CustomErrors_1.OpenTDBError.errors.headers.INVALID_OPT);
132139
}

dist/src/Classes/Validator.test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3+
//@ts-nocheck
4+
var enums_1 = require("../Typings/enums");
35
var Validator_1 = require("./Validator");
46
function createInstance(options) {
57
return new Validator_1.default(options);
@@ -105,8 +107,8 @@ test("tests output of Validator.checkDifficulty()", function () {
105107
expect(function () {
106108
validator.checkDifficulty();
107109
}).toThrow(TypeError);
108-
validator = createInstance({ difficulty: "easy" });
109-
expect(validator.checkDifficulty()).toEqual("easy");
110+
validator = createInstance({ difficulty: enums_1.QuestionDifficulties.Easy });
111+
expect(validator.checkDifficulty()).toEqual(enums_1.QuestionDifficulties.Easy);
110112
validator = createInstance({ difficulty: undefined });
111113
expect(validator.checkDifficulty()).toEqual(null);
112114
validator = createInstance({ difficulty: null });
@@ -141,8 +143,8 @@ test("tests output of Validator.checkEncoding()", function () {
141143
expect(function () {
142144
validator.checkEncode();
143145
}).toThrow(TypeError);
144-
validator = createInstance({ encode: "base64" });
145-
expect(validator.checkEncode()).toEqual("base64");
146+
validator = createInstance({ encode: enums_1.QuestionEncodings.Base64 });
147+
expect(validator.checkEncode()).toEqual(enums_1.QuestionEncodings.Base64);
146148
validator = createInstance({ encode: undefined });
147149
expect(validator.checkEncode()).toEqual(null);
148150
validator = createInstance({ encode: null });
@@ -201,8 +203,8 @@ test("tests output of Validator.checkType()", function () {
201203
expect(function () {
202204
validator.checkType();
203205
}).toThrow(TypeError);
204-
validator = createInstance({ type: "boolean" });
205-
expect(validator.checkType()).toEqual("boolean");
206+
validator = createInstance({ type: enums_1.QuestionTypes.Boolean });
207+
expect(validator.checkType()).toEqual(enums_1.QuestionTypes.Boolean);
206208
validator = createInstance({ type: undefined });
207209
expect(validator.checkType()).toEqual(null);
208210
validator = createInstance({ type: null });

dist/src/Functions/getQuestions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function getQuestions(options) {
6666
link = OpenTDBUtil_1.default.links.base.GET_QUESTIONS;
6767
defaultOptions = {
6868
amount: 10,
69-
encode: enums_1.QuestionEncodings.none,
69+
encode: enums_1.QuestionEncodings.None,
7070
};
7171
if ((options === null || options === void 0 ? void 0 : options.category) instanceof Category_1.default)
7272
options.category = options.category.id;

dist/src/Typings/enums.d.ts

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
* @enum
44
*/
55
export declare enum CategoryNamesStrict {
6-
GENERAL_KNOWLEDGE = 9,
7-
ENTERTAINMENT_BOOKS = 10,
8-
ENTERTAINMENT_FILM = 11,
9-
ENTERTAINMENT_MUSIC = 12,
10-
ENTERTAINMENT_MUSICALS_AND_THEATRES = 13,
11-
ENTERTAINMENT_TELEVISION = 14,
12-
ENTERTAINMENT_VIDEO_GAMES = 15,
13-
ENTERTAINMENT_BOARD_GAMES = 16,
14-
SCIENCE_AND_NATURE = 17,
15-
SCIENCE_COMPUTERS = 18,
16-
SCIENCE_MATHEMATICS = 19,
17-
MYTHOLOGY = 20,
18-
SPORTS = 21,
19-
GEOGRAPHY = 22,
20-
HISTORY = 23,
21-
POLITICS = 24,
22-
ART = 25,
23-
CELEBRITIES = 26,
24-
ANIMALS = 27,
25-
VEHICLES = 28,
26-
ENTERTAINMENT_COMICS = 29,
27-
SCIENCE_GADGETS = 30,
28-
ENTERTAINMENT_JAPANESE_ANIME_AND_MANGA = 31,
29-
ENTERTAINMENT_CARTOON_AND_ANIMATIONS = 32
6+
GeneralKnowledge = 9,
7+
EntertainmentBooks = 10,
8+
EntertainmentFilm = 11,
9+
EntertainmentMusic = 12,
10+
EntertainmentMusicalsAndTheatres = 13,
11+
EntertainmentJapaneseAnimeAndManga = 14,
12+
EntertainmentCartoonAndAnimations = 15,
13+
EntertainmentTelevision = 16,
14+
EntertainmentVideoGames = 17,
15+
EntertainmentBoardGames = 18,
16+
EntertainmentComics = 19,
17+
ScienceAndNature = 20,
18+
ScienceComputers = 21,
19+
ScienceMathmatics = 22,
20+
ScienceGadgets = 23,
21+
Mythology = 24,
22+
Sports = 25,
23+
Geography = 26,
24+
History = 27,
25+
Politics = 28,
26+
Art = 29,
27+
Celebrities = 30,
28+
Animals = 31,
29+
Vehicles = 32
3030
}
3131
/**
3232
* All pretty category names mapped to their API id
@@ -79,27 +79,27 @@ export declare enum QuestionAmountRange {
7979
* @enum
8080
*/
8181
export declare enum QuestionDifficulties {
82-
easy = "easy",
83-
medium = "medium",
84-
hard = "hard"
82+
Easy = "easy",
83+
Medium = "medium",
84+
Hard = "hard"
8585
}
8686
/**
8787
* The question types mapped to their API value
8888
* @enum
8989
*/
9090
export declare enum QuestionTypes {
91-
multiple = "multiple",
92-
boolean = "boolean"
91+
Multiple = "multiple",
92+
Boolean = "boolean"
9393
}
9494
/**
9595
* The question encodings mapped to their API value
9696
* @enum
9797
*/
9898
export declare enum QuestionEncodings {
99-
base64 = "base64",
100-
none = "none",
101-
url3986 = "url3986",
102-
urlLegacy = "urlLegacy"
99+
Base64 = "base64",
100+
None = "none",
101+
Url3986 = "url3986",
102+
UrlLegacy = "urlLegacy"
103103
}
104104
/**
105105
* The types of Category versions
@@ -109,3 +109,7 @@ export declare enum QuestionVersions {
109109
Raw = 0,
110110
Final = 1
111111
}
112+
export declare enum CategoryType {
113+
Id = "ID",
114+
Name = "NAME"
115+
}

dist/src/Typings/enums.js

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.QuestionVersions = exports.QuestionEncodings = exports.QuestionTypes = exports.QuestionDifficulties = exports.QuestionAmountRange = exports.CategoryNameVersions = exports.CategoryNamesPretty = exports.CategoryNamesStrict = void 0;
3+
exports.CategoryType = exports.QuestionVersions = exports.QuestionEncodings = exports.QuestionTypes = exports.QuestionDifficulties = exports.QuestionAmountRange = exports.CategoryNameVersions = exports.CategoryNamesPretty = exports.CategoryNamesStrict = void 0;
44
/**
55
* All strict category names mapped to their API id
66
* @enum
77
*/
88
var CategoryNamesStrict;
99
(function (CategoryNamesStrict) {
10-
CategoryNamesStrict[CategoryNamesStrict["GENERAL_KNOWLEDGE"] = 9] = "GENERAL_KNOWLEDGE";
11-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_BOOKS"] = 10] = "ENTERTAINMENT_BOOKS";
12-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_FILM"] = 11] = "ENTERTAINMENT_FILM";
13-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_MUSIC"] = 12] = "ENTERTAINMENT_MUSIC";
14-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_MUSICALS_AND_THEATRES"] = 13] = "ENTERTAINMENT_MUSICALS_AND_THEATRES";
15-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_TELEVISION"] = 14] = "ENTERTAINMENT_TELEVISION";
16-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_VIDEO_GAMES"] = 15] = "ENTERTAINMENT_VIDEO_GAMES";
17-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_BOARD_GAMES"] = 16] = "ENTERTAINMENT_BOARD_GAMES";
18-
CategoryNamesStrict[CategoryNamesStrict["SCIENCE_AND_NATURE"] = 17] = "SCIENCE_AND_NATURE";
19-
CategoryNamesStrict[CategoryNamesStrict["SCIENCE_COMPUTERS"] = 18] = "SCIENCE_COMPUTERS";
20-
CategoryNamesStrict[CategoryNamesStrict["SCIENCE_MATHEMATICS"] = 19] = "SCIENCE_MATHEMATICS";
21-
CategoryNamesStrict[CategoryNamesStrict["MYTHOLOGY"] = 20] = "MYTHOLOGY";
22-
CategoryNamesStrict[CategoryNamesStrict["SPORTS"] = 21] = "SPORTS";
23-
CategoryNamesStrict[CategoryNamesStrict["GEOGRAPHY"] = 22] = "GEOGRAPHY";
24-
CategoryNamesStrict[CategoryNamesStrict["HISTORY"] = 23] = "HISTORY";
25-
CategoryNamesStrict[CategoryNamesStrict["POLITICS"] = 24] = "POLITICS";
26-
CategoryNamesStrict[CategoryNamesStrict["ART"] = 25] = "ART";
27-
CategoryNamesStrict[CategoryNamesStrict["CELEBRITIES"] = 26] = "CELEBRITIES";
28-
CategoryNamesStrict[CategoryNamesStrict["ANIMALS"] = 27] = "ANIMALS";
29-
CategoryNamesStrict[CategoryNamesStrict["VEHICLES"] = 28] = "VEHICLES";
30-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_COMICS"] = 29] = "ENTERTAINMENT_COMICS";
31-
CategoryNamesStrict[CategoryNamesStrict["SCIENCE_GADGETS"] = 30] = "SCIENCE_GADGETS";
32-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_JAPANESE_ANIME_AND_MANGA"] = 31] = "ENTERTAINMENT_JAPANESE_ANIME_AND_MANGA";
33-
CategoryNamesStrict[CategoryNamesStrict["ENTERTAINMENT_CARTOON_AND_ANIMATIONS"] = 32] = "ENTERTAINMENT_CARTOON_AND_ANIMATIONS";
10+
CategoryNamesStrict[CategoryNamesStrict["GeneralKnowledge"] = 9] = "GeneralKnowledge";
11+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentBooks"] = 10] = "EntertainmentBooks";
12+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentFilm"] = 11] = "EntertainmentFilm";
13+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentMusic"] = 12] = "EntertainmentMusic";
14+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentMusicalsAndTheatres"] = 13] = "EntertainmentMusicalsAndTheatres";
15+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentJapaneseAnimeAndManga"] = 14] = "EntertainmentJapaneseAnimeAndManga";
16+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentCartoonAndAnimations"] = 15] = "EntertainmentCartoonAndAnimations";
17+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentTelevision"] = 16] = "EntertainmentTelevision";
18+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentVideoGames"] = 17] = "EntertainmentVideoGames";
19+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentBoardGames"] = 18] = "EntertainmentBoardGames";
20+
CategoryNamesStrict[CategoryNamesStrict["EntertainmentComics"] = 19] = "EntertainmentComics";
21+
CategoryNamesStrict[CategoryNamesStrict["ScienceAndNature"] = 20] = "ScienceAndNature";
22+
CategoryNamesStrict[CategoryNamesStrict["ScienceComputers"] = 21] = "ScienceComputers";
23+
CategoryNamesStrict[CategoryNamesStrict["ScienceMathmatics"] = 22] = "ScienceMathmatics";
24+
CategoryNamesStrict[CategoryNamesStrict["ScienceGadgets"] = 23] = "ScienceGadgets";
25+
CategoryNamesStrict[CategoryNamesStrict["Mythology"] = 24] = "Mythology";
26+
CategoryNamesStrict[CategoryNamesStrict["Sports"] = 25] = "Sports";
27+
CategoryNamesStrict[CategoryNamesStrict["Geography"] = 26] = "Geography";
28+
CategoryNamesStrict[CategoryNamesStrict["History"] = 27] = "History";
29+
CategoryNamesStrict[CategoryNamesStrict["Politics"] = 28] = "Politics";
30+
CategoryNamesStrict[CategoryNamesStrict["Art"] = 29] = "Art";
31+
CategoryNamesStrict[CategoryNamesStrict["Celebrities"] = 30] = "Celebrities";
32+
CategoryNamesStrict[CategoryNamesStrict["Animals"] = 31] = "Animals";
33+
CategoryNamesStrict[CategoryNamesStrict["Vehicles"] = 32] = "Vehicles";
3434
})(CategoryNamesStrict = exports.CategoryNamesStrict || (exports.CategoryNamesStrict = {}));
3535
/**
3636
* All pretty category names mapped to their API id
@@ -87,29 +87,29 @@ var QuestionAmountRange;
8787
*/
8888
var QuestionDifficulties;
8989
(function (QuestionDifficulties) {
90-
QuestionDifficulties["easy"] = "easy";
91-
QuestionDifficulties["medium"] = "medium";
92-
QuestionDifficulties["hard"] = "hard";
90+
QuestionDifficulties["Easy"] = "easy";
91+
QuestionDifficulties["Medium"] = "medium";
92+
QuestionDifficulties["Hard"] = "hard";
9393
})(QuestionDifficulties = exports.QuestionDifficulties || (exports.QuestionDifficulties = {}));
9494
/**
9595
* The question types mapped to their API value
9696
* @enum
9797
*/
9898
var QuestionTypes;
9999
(function (QuestionTypes) {
100-
QuestionTypes["multiple"] = "multiple";
101-
QuestionTypes["boolean"] = "boolean";
100+
QuestionTypes["Multiple"] = "multiple";
101+
QuestionTypes["Boolean"] = "boolean";
102102
})(QuestionTypes = exports.QuestionTypes || (exports.QuestionTypes = {}));
103103
/**
104104
* The question encodings mapped to their API value
105105
* @enum
106106
*/
107107
var QuestionEncodings;
108108
(function (QuestionEncodings) {
109-
QuestionEncodings["base64"] = "base64";
110-
QuestionEncodings["none"] = "none";
111-
QuestionEncodings["url3986"] = "url3986";
112-
QuestionEncodings["urlLegacy"] = "urlLegacy";
109+
QuestionEncodings["Base64"] = "base64";
110+
QuestionEncodings["None"] = "none";
111+
QuestionEncodings["Url3986"] = "url3986";
112+
QuestionEncodings["UrlLegacy"] = "urlLegacy";
113113
})(QuestionEncodings = exports.QuestionEncodings || (exports.QuestionEncodings = {}));
114114
/**
115115
* The types of Category versions
@@ -120,3 +120,9 @@ var QuestionVersions;
120120
QuestionVersions[QuestionVersions["Raw"] = 0] = "Raw";
121121
QuestionVersions[QuestionVersions["Final"] = 1] = "Final";
122122
})(QuestionVersions = exports.QuestionVersions || (exports.QuestionVersions = {}));
123+
var CategoryType;
124+
(function (CategoryType) {
125+
CategoryType["Id"] = "ID";
126+
CategoryType["Name"] = "NAME";
127+
})(CategoryType = exports.CategoryType || (exports.CategoryType = {}));
128+
;

dist/src/Typings/interfaces.d.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Session from "../Classes/Session";
2-
import { CategoryName, CategoryResolvable, NumberResolvable, QuestionDifficulty, QuestionEncoding, QuestionType } from "./types";
2+
import { QuestionDifficulties, QuestionEncodings, QuestionTypes } from "./enums";
3+
import { CategoryName, CategoryResolvable, NumberResolvable, QuestionDifficulty, QuestionType } from "./types";
34
/**
45
* A basic response from OpenTDB with `results` being an array of T
56
* @interface
@@ -85,8 +86,8 @@ export interface Question extends QuestionBase {
8586
export interface QuestionOptions {
8687
amount?: NumberResolvable | null;
8788
category?: CategoryResolvable | null;
88-
difficulty?: QuestionDifficulty | null;
89-
type?: QuestionType | null;
90-
encode?: QuestionEncoding | null;
89+
difficulty?: QuestionDifficulties | null;
90+
type?: QuestionTypes | null;
91+
encode?: QuestionEncodings | null;
9192
session?: Session | string | null;
9293
}

0 commit comments

Comments
 (0)