@ifunny/ifunny-api-types 1.2.0 → 1.2.2
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.
- package/.devenv/bootstrap/bootstrapLib.nix +21 -1
- package/.devenv/bootstrap/lock-sources.nix +123 -0
- package/.devenv/bootstrap/resolve-input-paths.nix +34 -0
- package/.devenv/bootstrap/resolve-lock.nix +5 -79
- package/.devenv/changelog-cache.json +7 -3
- package/.devenv/devenv.fish +13 -13
- package/.devenv/input-paths.txt +2 -4
- package/.devenv/nix-eval-cache.db +0 -0
- package/.devenv/shell-env.sh +1601 -1589
- package/.devenv/state/files.json +5 -1
- package/.devenv/state/git-hooks-install/hooks +1 -0
- package/.devenv/state/git-hooks-install/key +4 -0
- package/.devenv/state/prek/.lock +0 -0
- package/.devenv/state/prek/README +2 -0
- package/.devenv/state/prek/config-tracking.json +3 -0
- package/.devenv/state/prek/patches/1793595918715-562072.patch +26 -0
- package/.devenv/state/prek/patches/1793596283854-574354.patch +22881 -0
- package/.devenv/state/prek/patches/1793596332255-574728.patch +22870 -0
- package/.devenv/state/prek/patches/1793597557669-617911.patch +284 -0
- package/.devenv/state/prek/patches/1793856046749-331249.patch +2906 -0
- package/.devenv/state/prek/patches/1793856096552-331868.patch +2998 -0
- package/.devenv/state/prek/patches/1793856146786-332328.patch +3009 -0
- package/.devenv/state/prek/patches/1793856181490-332981.patch +11401 -0
- package/.devenv/state/prek/patches/1793856203087-333510.patch +11388 -0
- package/.devenv/state/prek/patches/1793856277935-334258.patch +11372 -0
- package/.devenv/state/prek/patches/1793856646955-337912.patch +8488 -0
- package/.devenv/state/prek/patches/1793856682905-338572.patch +8260 -0
- package/.devenv/state/prek/patches/1793857035751-356215.patch +8295 -0
- package/.devenv/state/tasks.db +0 -0
- package/.devenv/task-names.txt +3 -1
- package/.prettierignore +9 -0
- package/CHANGELOG.md +476 -8272
- package/devenv.lock +47 -9
- package/devenv.nix +10 -13
- package/devenv.yaml +5 -0
- package/dist/errors/bad_request.js +8 -0
- package/dist/errors/bad_request.js.map +1 -0
- package/dist/errors/captcha_required.js +19 -0
- package/dist/errors/captcha_required.js.map +1 -0
- package/dist/errors/email_exists.js +8 -0
- package/dist/errors/email_exists.js.map +1 -0
- package/dist/errors/error.js +3 -0
- package/dist/errors/error.js.map +1 -0
- package/dist/errors/error_base.js +43 -0
- package/dist/errors/error_base.js.map +1 -0
- package/dist/errors/index.js +29 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/invalid_client.js +8 -0
- package/dist/errors/invalid_client.js.map +1 -0
- package/dist/errors/invalid_email.js +8 -0
- package/dist/errors/invalid_email.js.map +1 -0
- package/dist/errors/invalid_grant.js +8 -0
- package/dist/errors/invalid_grant.js.map +1 -0
- package/dist/errors/not_found.js +3 -0
- package/dist/errors/not_found.js.map +1 -0
- package/dist/errors/permission_denied.js +8 -0
- package/dist/errors/permission_denied.js.map +1 -0
- package/dist/errors/unauthorized.js +8 -0
- package/dist/errors/unauthorized.js.map +1 -0
- package/dist/errors/wrong_params.js +8 -0
- package/dist/errors/wrong_params.js.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/payloads/activity.js +50 -0
- package/dist/payloads/activity.js.map +1 -0
- package/dist/payloads/app.js +3 -0
- package/dist/payloads/app.js.map +1 -0
- package/dist/payloads/appeal.js +14 -0
- package/dist/payloads/appeal.js.map +1 -0
- package/dist/payloads/ban.js +36 -0
- package/dist/payloads/ban.js.map +1 -0
- package/dist/payloads/base.js +3 -0
- package/dist/payloads/base.js.map +1 -0
- package/dist/payloads/chat.js +37 -0
- package/dist/payloads/chat.js.map +1 -0
- package/dist/payloads/client.js +13 -0
- package/dist/payloads/client.js.map +1 -0
- package/dist/payloads/comment.js +42 -0
- package/dist/payloads/comment.js.map +1 -0
- package/dist/payloads/content.js +176 -0
- package/dist/payloads/content.js.map +1 -0
- package/dist/payloads/index.js +29 -0
- package/dist/payloads/index.js.map +1 -0
- package/dist/payloads/strike.js +3 -0
- package/dist/payloads/strike.js.map +1 -0
- package/dist/payloads/topics.js +72 -0
- package/dist/payloads/topics.js.map +1 -0
- package/dist/payloads/user.js +215 -0
- package/dist/payloads/user.js.map +1 -0
- package/dist/rest/account.js +3 -0
- package/dist/rest/account.js.map +1 -0
- package/dist/rest/content.js +54 -0
- package/dist/rest/content.js.map +1 -0
- package/dist/rest/counters.js +3 -0
- package/dist/rest/counters.js.map +1 -0
- package/dist/rest/endpoints.js +199 -0
- package/dist/rest/endpoints.js.map +1 -0
- package/dist/rest/explore.js +82 -0
- package/dist/rest/explore.js.map +1 -0
- package/dist/rest/feeds.js +3 -0
- package/dist/rest/feeds.js.map +1 -0
- package/dist/rest/index.js +25 -0
- package/dist/rest/index.js.map +1 -0
- package/dist/rest/issues.js +3 -0
- package/dist/rest/issues.js.map +1 -0
- package/dist/rest/oauth2.js +9 -0
- package/dist/rest/oauth2.js.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/rest.js +3 -0
- package/dist/utils/rest.js.map +1 -0
- package/dist/utils/util.js +3 -0
- package/dist/utils/util.js.map +1 -0
- package/package.json +15 -8
- package/tag-check.sh +111 -0
- package/types/errors/bad_request.d.ts +12 -0
- package/types/errors/bad_request.d.ts.map +1 -0
- package/types/errors/captcha_required.d.ts +33 -0
- package/types/errors/captcha_required.d.ts.map +1 -0
- package/types/errors/email_exists.d.ts +15 -0
- package/types/errors/email_exists.d.ts.map +1 -0
- package/types/errors/error.d.ts +29 -0
- package/types/errors/error.d.ts.map +1 -0
- package/types/errors/error_base.d.ts +61 -0
- package/types/errors/error_base.d.ts.map +1 -0
- package/types/errors/index.d.ts +13 -0
- package/types/errors/index.d.ts.map +1 -0
- package/types/errors/invalid_client.d.ts +15 -0
- package/types/errors/invalid_client.d.ts.map +1 -0
- package/types/errors/invalid_email.d.ts +15 -0
- package/types/errors/invalid_email.d.ts.map +1 -0
- package/types/errors/invalid_grant.d.ts +12 -0
- package/types/errors/invalid_grant.d.ts.map +1 -0
- package/types/errors/not_found.d.ts +8 -0
- package/types/errors/not_found.d.ts.map +1 -0
- package/types/errors/permission_denied.d.ts +12 -0
- package/types/errors/permission_denied.d.ts.map +1 -0
- package/types/errors/unauthorized.d.ts +12 -0
- package/types/errors/unauthorized.d.ts.map +1 -0
- package/types/errors/wrong_params.d.ts +11 -0
- package/types/errors/wrong_params.d.ts.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -0
- package/types/payloads/activity.d.ts +114 -0
- package/types/payloads/activity.d.ts.map +1 -0
- package/types/payloads/app.d.ts +266 -0
- package/types/payloads/app.d.ts.map +1 -0
- package/types/payloads/appeal.d.ts +22 -0
- package/types/payloads/appeal.d.ts.map +1 -0
- package/types/payloads/ban.d.ts +85 -0
- package/types/payloads/ban.d.ts.map +1 -0
- package/types/payloads/base.d.ts +5 -0
- package/types/payloads/base.d.ts.map +1 -0
- package/types/payloads/chat.d.ts +117 -0
- package/types/payloads/chat.d.ts.map +1 -0
- package/types/payloads/client.d.ts +108 -0
- package/types/payloads/client.d.ts.map +1 -0
- package/types/payloads/comment.d.ts +124 -0
- package/types/payloads/comment.d.ts.map +1 -0
- package/types/payloads/content.d.ts +677 -0
- package/types/payloads/content.d.ts.map +1 -0
- package/types/payloads/index.d.ts +13 -0
- package/types/payloads/index.d.ts.map +1 -0
- package/types/payloads/strike.d.ts +15 -0
- package/types/payloads/strike.d.ts.map +1 -0
- package/types/payloads/topics.d.ts +45 -0
- package/types/payloads/topics.d.ts.map +1 -0
- package/types/payloads/user.d.ts +523 -0
- package/types/payloads/user.d.ts.map +1 -0
- package/types/rest/account.d.ts +4 -0
- package/types/rest/account.d.ts.map +1 -0
- package/types/rest/content.d.ts +96 -0
- package/types/rest/content.d.ts.map +1 -0
- package/types/rest/counters.d.ts +10 -0
- package/types/rest/counters.d.ts.map +1 -0
- package/types/rest/endpoints.d.ts +153 -0
- package/types/rest/endpoints.d.ts.map +1 -0
- package/types/rest/explore.d.ts +113 -0
- package/types/rest/explore.d.ts.map +1 -0
- package/types/rest/feeds.d.ts +17 -0
- package/types/rest/feeds.d.ts.map +1 -0
- package/types/rest/index.d.ts +9 -0
- package/types/rest/index.d.ts.map +1 -0
- package/types/rest/issues.d.ts +16 -0
- package/types/rest/issues.d.ts.map +1 -0
- package/types/rest/oauth2.d.ts +37 -0
- package/types/rest/oauth2.d.ts.map +1 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/rest.d.ts +50 -0
- package/types/utils/rest.d.ts.map +1 -0
- package/types/utils/util.d.ts +80 -0
- package/types/utils/util.d.ts.map +1 -0
- package/.devenv/nix-eval-cache.db-shm +0 -0
- package/.devenv/nix-eval-cache.db-wal +0 -0
- package/.devenv/state/tasks.db-shm +0 -0
- package/.devenv/state/tasks.db-wal +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/rest/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhE;;GAEG;AACH,oBAAY,WAAW;IACtB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,cAAc,WAAW;IACzB;;OAEG;IACH,OAAO,SAAS;IAChB;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,UAAU,eAAe;IACzB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,WAAW,EAAE,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;AAEnF,MAAM,WAAW,iBAAiB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,MAAM,gCAAgC,GAAG,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;AAEzF,MAAM,WAAW,qBAAqB;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,MAAM,oCAAoC,GAC/C,sBAAsB,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RESTAPISuccessResponse } from "../utils";
|
|
2
|
+
export interface APICounters {
|
|
3
|
+
featured: number;
|
|
4
|
+
subscriptions: number;
|
|
5
|
+
collective: number;
|
|
6
|
+
news: number;
|
|
7
|
+
map: number;
|
|
8
|
+
}
|
|
9
|
+
export type RESTAPICountersResponse = RESTAPISuccessResponse<APICounters>;
|
|
10
|
+
//# sourceMappingURL=counters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"counters.d.ts","sourceRoot":"","sources":["../../src/rest/counters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export declare class Endpoints {
|
|
2
|
+
static readonly base = "api.ifunny.mobi";
|
|
3
|
+
static readonly account = "/account";
|
|
4
|
+
static readonly collective = "/feeds/collective";
|
|
5
|
+
static readonly counters = "/counters";
|
|
6
|
+
static readonly featured = "/feeds/featured";
|
|
7
|
+
static readonly feeds = "/feeds";
|
|
8
|
+
static readonly oauth2 = "/oauth2";
|
|
9
|
+
static readonly projectElements = "/feeds/project_elements";
|
|
10
|
+
static readonly subscriptionFeed = "/timelines/home";
|
|
11
|
+
static readonly timelines = "/timelines";
|
|
12
|
+
static readonly token = "/oauth2/token";
|
|
13
|
+
static readonly myUser = "/users/my";
|
|
14
|
+
static readonly myComments: string;
|
|
15
|
+
static readonly chatInvites: string;
|
|
16
|
+
static readonly mySmiles: string;
|
|
17
|
+
static readonly myAppeals: string;
|
|
18
|
+
static readonly unreadChatMessages: string;
|
|
19
|
+
static readonly myNews = "/news/my";
|
|
20
|
+
static readonly nicksAvailable = "/users/nicks_available";
|
|
21
|
+
static readonly emailsAvailable = "/users/emails_available";
|
|
22
|
+
static readonly app = "/app";
|
|
23
|
+
static readonly settings: string;
|
|
24
|
+
static readonly privacy: string;
|
|
25
|
+
/**
|
|
26
|
+
* @param query The nick or id of the user
|
|
27
|
+
* @param byNick Whether to fetch by nick (Default: false)
|
|
28
|
+
* @example
|
|
29
|
+
* "/timelines/users/:userId"
|
|
30
|
+
* "/timelines/users/by_nick/:userNick"
|
|
31
|
+
*/
|
|
32
|
+
static userTimeline(query: string, byNick?: boolean): string;
|
|
33
|
+
/**
|
|
34
|
+
* @param query The user id or nick
|
|
35
|
+
* @param byNick Whether to fetch by nick (Default: false)
|
|
36
|
+
* @example
|
|
37
|
+
* "/users"
|
|
38
|
+
* "/users/:userId"
|
|
39
|
+
* "/users/by_nick/:userNick"
|
|
40
|
+
*/
|
|
41
|
+
static user(query?: string, byNick?: boolean): string;
|
|
42
|
+
/**
|
|
43
|
+
* @param user The user id or nick
|
|
44
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
45
|
+
* @example
|
|
46
|
+
* "/users/:userId/guests"
|
|
47
|
+
* "/users/by_nick/:userNick/guests"
|
|
48
|
+
*/
|
|
49
|
+
static guests(user: string, byNick?: boolean): string;
|
|
50
|
+
/**
|
|
51
|
+
* @param user The user id or nick
|
|
52
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
53
|
+
* @example
|
|
54
|
+
* "/users/:userId/blocked"
|
|
55
|
+
* "/users/by_nick/:userNick/blocked"
|
|
56
|
+
*/
|
|
57
|
+
static blocked(user: string, byNick?: boolean): string;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param user User nick or ID
|
|
61
|
+
* @param byNick User is the nick
|
|
62
|
+
* @example
|
|
63
|
+
* ""
|
|
64
|
+
*/
|
|
65
|
+
static blockedData(user: string, byNick?: boolean): string;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @param user Url to block
|
|
69
|
+
* @param byNick Is the user the nick?
|
|
70
|
+
* @example
|
|
71
|
+
* "/users/my/blocked/:userId"
|
|
72
|
+
* "/users/my/blocked/by_nick/:userNick"
|
|
73
|
+
*/
|
|
74
|
+
static blockUser(user: string, byNick?: boolean): string;
|
|
75
|
+
/**
|
|
76
|
+
* @param user The user id or nick
|
|
77
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
78
|
+
* @example
|
|
79
|
+
* "/users/:userId/subscribers"
|
|
80
|
+
* "/users/by_nick/:userNick/subscribers"
|
|
81
|
+
*/
|
|
82
|
+
static subscribers(user: string, byNick?: boolean): string;
|
|
83
|
+
/**
|
|
84
|
+
* @param user The user id or nick
|
|
85
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
86
|
+
* @example
|
|
87
|
+
* "/users/:userId/subscriptions"
|
|
88
|
+
*/
|
|
89
|
+
static subscriptions(user: string, byNick?: boolean): string;
|
|
90
|
+
/**
|
|
91
|
+
* @param id Id of the content if getting one
|
|
92
|
+
* @example
|
|
93
|
+
* "/content"
|
|
94
|
+
* "/content/:contentId"
|
|
95
|
+
*/
|
|
96
|
+
static content(id?: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* @param contentId The content id
|
|
99
|
+
* @example
|
|
100
|
+
* "/content/:contentId/smiles"
|
|
101
|
+
*/
|
|
102
|
+
static smiles(contentId: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* @param contentId The content id
|
|
105
|
+
* @example
|
|
106
|
+
* "/content/:contentId/unsmiles"
|
|
107
|
+
*/
|
|
108
|
+
static unsmiles(contentId: string): string;
|
|
109
|
+
/**
|
|
110
|
+
* @param contentId The content id
|
|
111
|
+
* @example
|
|
112
|
+
* "/content/:contentId/republished"
|
|
113
|
+
*/
|
|
114
|
+
static republishes(contentId: string): string;
|
|
115
|
+
/**
|
|
116
|
+
* @param contentId Id of the content
|
|
117
|
+
* @param commentId Id of the comment if applicable
|
|
118
|
+
* @example
|
|
119
|
+
* "/content/:contentId/comments"
|
|
120
|
+
* "/content/:contentId/comments/:commentId"
|
|
121
|
+
*/
|
|
122
|
+
static comments(contentId: string, commentId?: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* @param contentId The content id
|
|
125
|
+
* @param commentId The comment id
|
|
126
|
+
* @example
|
|
127
|
+
* "/content/:contentId/comments/:commentId/replies"
|
|
128
|
+
*/
|
|
129
|
+
static replies(contentId: string, commentId: string): string;
|
|
130
|
+
/**
|
|
131
|
+
* @param contentId The content id
|
|
132
|
+
* @example
|
|
133
|
+
* "/content/:contentId/comments/attached_content"
|
|
134
|
+
*/
|
|
135
|
+
static commentAttachment(contentId: string): string;
|
|
136
|
+
/**
|
|
137
|
+
* @param contentId The content id or array of content ids if adding to reads
|
|
138
|
+
* @example
|
|
139
|
+
* "/reads"
|
|
140
|
+
* "/reads/:contentId"
|
|
141
|
+
* "/reads/:contentId1,contentId2..."
|
|
142
|
+
*/
|
|
143
|
+
static reads(contentId?: string | string[]): string;
|
|
144
|
+
/**
|
|
145
|
+
* @param userId The id of the user the ban belongs to
|
|
146
|
+
* @param banId The id of the Ban
|
|
147
|
+
* @example
|
|
148
|
+
* "/users/:userId/bans"
|
|
149
|
+
* "/users/:userId/bans/:banId"
|
|
150
|
+
*/
|
|
151
|
+
static bans(userId: string, banId?: string): string;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/rest/endpoints.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,qBAAqB;IACzC,MAAM,CAAC,QAAQ,CAAC,OAAO,cAAc;IACrC,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAuB;IACjD,MAAM,CAAC,QAAQ,CAAC,QAAQ,eAAe;IACvC,MAAM,CAAC,QAAQ,CAAC,QAAQ,qBAAqB;IAC7C,MAAM,CAAC,QAAQ,CAAC,KAAK,YAAY;IACjC,MAAM,CAAC,QAAQ,CAAC,MAAM,aAAa;IACnC,MAAM,CAAC,QAAQ,CAAC,eAAe,6BAA6B;IAC5D,MAAM,CAAC,QAAQ,CAAC,gBAAgB,qBAAqB;IACrD,MAAM,CAAC,QAAQ,CAAC,SAAS,gBAAgB;IACzC,MAAM,CAAC,QAAQ,CAAC,KAAK,mBAAmB;IACxC,MAAM,CAAC,QAAQ,CAAC,MAAM,eAAe;IACrC,MAAM,CAAC,QAAQ,CAAC,UAAU,SAA6B;IACvD,MAAM,CAAC,QAAQ,CAAC,WAAW,SAAqC;IAChE,MAAM,CAAC,QAAQ,CAAC,QAAQ,SAAmC;IAC3D,MAAM,CAAC,QAAQ,CA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AAG,MAAM;IAInC;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIxC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI1C;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI7C;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9D;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAI5D;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAInD;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAOnD;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAG1C"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { RESTAPIPaging, RESTAPISuccessResponse } from "../utils/rest";
|
|
2
|
+
import { APIContent } from "../payloads/content";
|
|
3
|
+
import { ValueOf } from "../utils/util";
|
|
4
|
+
export type RESTAPIExploreSuccess = RESTAPISuccessResponse<RESTAPIExploreData>;
|
|
5
|
+
export interface RESTAPIExploreData {
|
|
6
|
+
tabs: RESTAPIExploreTabBase[];
|
|
7
|
+
active_tab: RESTAPIExploreActiveTab;
|
|
8
|
+
}
|
|
9
|
+
export interface RESTAPIExploreTabBase<Name extends APIExploreTabName = APIExploreTabName> {
|
|
10
|
+
id: EXPLORE_TAB_IDS;
|
|
11
|
+
name: Name;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents the active tab being displayed
|
|
15
|
+
*/
|
|
16
|
+
export interface RESTAPIExploreActiveTab extends RESTAPIExploreTabBase {
|
|
17
|
+
compilations_set: APIExploreCompilationSet;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* All known explore tab ids
|
|
21
|
+
*/
|
|
22
|
+
export declare enum EXPLORE_TAB_IDS {
|
|
23
|
+
Best = 2,
|
|
24
|
+
Memes = 3,
|
|
25
|
+
Users = 4,
|
|
26
|
+
Chats = 5,
|
|
27
|
+
Channels = 6,
|
|
28
|
+
Tags = 7,
|
|
29
|
+
All = 8
|
|
30
|
+
}
|
|
31
|
+
export type APIExploreTabName = keyof typeof EXPLORE_TAB_IDS;
|
|
32
|
+
export type APIExploreTabID = ValueOf<typeof EXPLORE_TAB_IDS>;
|
|
33
|
+
interface APIExploreCompilationSet {
|
|
34
|
+
layout: string;
|
|
35
|
+
value: APIExploreCompilation;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* All possible layouts for explore
|
|
39
|
+
*/
|
|
40
|
+
export declare enum EXPLORE_LAYOUTS {
|
|
41
|
+
/**
|
|
42
|
+
* Lists content in explore
|
|
43
|
+
*/
|
|
44
|
+
CONTENT_LIST = "content_list_6_items",
|
|
45
|
+
/**
|
|
46
|
+
* Lists comments in explore
|
|
47
|
+
*/
|
|
48
|
+
COMMENT_LIST = "comment_list",
|
|
49
|
+
/**
|
|
50
|
+
* Lists chats in explore
|
|
51
|
+
*/
|
|
52
|
+
CHATS_LIST = "chats_list_horizontal",
|
|
53
|
+
/**
|
|
54
|
+
* Lists users in explore
|
|
55
|
+
*/
|
|
56
|
+
USER_LIST = "users_list_vertical",
|
|
57
|
+
/**
|
|
58
|
+
* Lists categories in explore
|
|
59
|
+
*/
|
|
60
|
+
CATEGORY_LIST = "category_list",
|
|
61
|
+
/**
|
|
62
|
+
* Lists top values by their calender year or month
|
|
63
|
+
*/
|
|
64
|
+
CALENDER_LIST = "calender"
|
|
65
|
+
}
|
|
66
|
+
export type APIExploreTabLayout = `${EXPLORE_LAYOUTS}`;
|
|
67
|
+
interface APIExploreCompilation {
|
|
68
|
+
id: APIExploreCompilationID;
|
|
69
|
+
context: APIExploreContext;
|
|
70
|
+
type: string;
|
|
71
|
+
title: string;
|
|
72
|
+
share_url: string;
|
|
73
|
+
}
|
|
74
|
+
interface APIExploreContext {
|
|
75
|
+
items: APIContent[];
|
|
76
|
+
paging: RESTAPIPaging;
|
|
77
|
+
}
|
|
78
|
+
export declare enum EXPLORE_COMPILATION_IDS {
|
|
79
|
+
CONTENT_TOP_OVERALL = "content_top_overall",
|
|
80
|
+
CONTENT_TOP_TODAY = "content_top_today",
|
|
81
|
+
CONTENT_TOP_SHARES = "content_top_by_share",
|
|
82
|
+
CONTENT_SHUFFLE = "content_shuffle",
|
|
83
|
+
USERS_TOP_OVERALL = "users_top_overall",
|
|
84
|
+
USER_TOP_FEATURED = "users_top_by_featured",
|
|
85
|
+
USER_TOP_SUBSCRIBERS = "users_top_by_subcribers",
|
|
86
|
+
USER_TOP_VIEWS = "users_top_by_content_views",
|
|
87
|
+
CHATS_POPULAR_LAST_WEEK = "chats_popular_last_week",
|
|
88
|
+
CHATS_NEW = "chats_new_chats",
|
|
89
|
+
CHATS_TOP_MEMBERS = "chats_top_by_members",
|
|
90
|
+
CHANNEL_COMMUNITY_GAMING = "channel-community-gaming",
|
|
91
|
+
CHANNEL_WTF = "channel-wtf",
|
|
92
|
+
CHANNEL_ANIMALS = "channel-animals",
|
|
93
|
+
CHANNEL_GAMES = "channel-games",
|
|
94
|
+
CHANNEL_COMICS = "channel-comics",
|
|
95
|
+
CHANNEL_SPORTS = "channel-sports",
|
|
96
|
+
CHANNEL_VIDEO = "channel-video",
|
|
97
|
+
CHANNEL_ORIGINALS = "channel-ifunny-originals",
|
|
98
|
+
CHANNEL_WHOLESOME = "channel-wholesome-wednesday",
|
|
99
|
+
CALENDER_BY_YEARS = "calender_by_years",
|
|
100
|
+
CALENDER_BY_MONTH = "calender_by_month"
|
|
101
|
+
}
|
|
102
|
+
export type APIExploreCompilationID = `${EXPLORE_COMPILATION_IDS}`;
|
|
103
|
+
export declare enum EXPLORE_COMPILATION_TYPES {
|
|
104
|
+
CONTENT = "content",
|
|
105
|
+
CALENDER = "calender",
|
|
106
|
+
CHAT = "chat",
|
|
107
|
+
CATEGORY = "category",
|
|
108
|
+
USER = "user",
|
|
109
|
+
COMMENT = "comment"
|
|
110
|
+
}
|
|
111
|
+
export type APIExploreCompilationType = `${EXPLORE_COMPILATION_TYPES}`;
|
|
112
|
+
export {};
|
|
113
|
+
//# sourceMappingURL=explore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../src/rest/explore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;AAE/E,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,qBAAqB,EAAE,CAAC;IAC9B,UAAU,EAAE,uBAAuB,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB,CACrC,IAAI,SAAS,iBAAiB,GAAG,iBAAiB;IAElD,EAAE,EAAE,eAAe,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IACrE,gBAAgB,EAAE,wBAAwB,CAAC;CAC3C;AAED;;GAEG;AACH,oBAAY,eAAe;IAC1B,IAAI,IAAI;IACR,KAAK,IAAI;IACT,KAAK,IAAI;IACT,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,IAAI,IAAI;IACR,GAAG,IAAI;CACP;AAED,MAAM,MAAM,iBAAiB,GAAG,MA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AsB;IACvC,iBAAiB,sBAAsB;CACvC;AAED,MAAM,MAAM,uBAAuB,GAAG,GAAG,uBAAuB,EAAE,CAAC;AAEnE,oBAAY,yBAAyB;IACpC,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,OAAO,YAAY;CACnB;AAED,MAAM,MAAM,yBAAyB,GAAG,GAAG,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RESTAPIItems } from "../utils/rest";
|
|
2
|
+
import { APIContent } from "../payloads/content";
|
|
3
|
+
import { RESTAPISuccessResponse } from "../utils";
|
|
4
|
+
import { APICounters } from "./counters";
|
|
5
|
+
/**
|
|
6
|
+
* The feed returned from the API
|
|
7
|
+
*/
|
|
8
|
+
export interface APIFeed {
|
|
9
|
+
content: RESTAPIItems<APIContent>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Response when fetching feed items
|
|
13
|
+
*/
|
|
14
|
+
export interface RESTAPIFeedResponse extends RESTAPISuccessResponse<APIFeed> {
|
|
15
|
+
notifications: APICounters;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=feeds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feeds.d.ts","sourceRoot":"","sources":["../../src/rest/feeds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,OAAO;IACvB,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB,CAAC,OAAO,CAAC;IAC3E,aAAa,EAAE,WAAW,CAAC;CAC3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./account";
|
|
2
|
+
export * from "./content";
|
|
3
|
+
export * from "./counters";
|
|
4
|
+
export * from "./endpoints";
|
|
5
|
+
export * from "./explore";
|
|
6
|
+
export * from "./feeds";
|
|
7
|
+
export * from "./issues";
|
|
8
|
+
export * from "./oauth2";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EpochSec } from "../utils/util";
|
|
2
|
+
/**
|
|
3
|
+
* When the next feature set releases
|
|
4
|
+
*/
|
|
5
|
+
export interface APINextIssueTime {
|
|
6
|
+
time_left: EpochSec;
|
|
7
|
+
time: EpochSec;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The API response for `/issues/next_issue_time`
|
|
11
|
+
*/
|
|
12
|
+
export interface RESTAPINextIssueTime {
|
|
13
|
+
data: APINextIssueTime;
|
|
14
|
+
status: 200;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=issues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/rest/issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,QAAQ,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,GAAG,CAAC;CACZ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RESTAPIErrorResponse } from "../errors/error";
|
|
2
|
+
export type RESTAPIOauth2Login = RESTAPIOauth2LoginSuccess | RESTAPIOauth2LoginError;
|
|
3
|
+
export interface RESTAPIOauth2LoginSuccess {
|
|
4
|
+
/**
|
|
5
|
+
* Bearer token used for requests
|
|
6
|
+
*/
|
|
7
|
+
access_token: string;
|
|
8
|
+
/**
|
|
9
|
+
* The type of token created
|
|
10
|
+
*/
|
|
11
|
+
token_type: TOKEN_TYPES.BEARER;
|
|
12
|
+
/**
|
|
13
|
+
* How long until the token expires\
|
|
14
|
+
* Equivilent to `10 years`\
|
|
15
|
+
* ? In seconds
|
|
16
|
+
*/
|
|
17
|
+
expires_in: 315360000;
|
|
18
|
+
}
|
|
19
|
+
export declare enum TOKEN_TYPES {
|
|
20
|
+
BEARER = "bearer",
|
|
21
|
+
BASIC = "basic"
|
|
22
|
+
}
|
|
23
|
+
export type APITokenType = `${TOKEN_TYPES}`;
|
|
24
|
+
export type RESTAPIOauth2LoginError = RESTAPIErrorResponse;
|
|
25
|
+
export interface RESTAPISignUpSuccess {
|
|
26
|
+
/**
|
|
27
|
+
* Data about the account created
|
|
28
|
+
*/
|
|
29
|
+
data: {
|
|
30
|
+
/**
|
|
31
|
+
* The user id of the account created
|
|
32
|
+
*/
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
status: 200;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=oauth2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;AAErF,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC;IAC/B;;;;OAIG;IACH,UAAU,EAAE,SAAS,CAAC;CACtB;AAED,oBAAY,WAAW;IACtB,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AAED,MAAM,MAAM,YAAY,GAAG,GAAG,WAAW,EAAE,CAAC;AAE5C,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,IAAI,EAAE;QACL;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;KACX,CAAC;IACF,MAAM,EAAE,GAAG,CAAC;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns when the request was a success
|
|
3
|
+
*/
|
|
4
|
+
export interface RESTAPISuccessResponse<T> extends RESTAPIStatusCode {
|
|
5
|
+
/**
|
|
6
|
+
* The data returned from the API
|
|
7
|
+
*/
|
|
8
|
+
data: T;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Common data response
|
|
12
|
+
*/
|
|
13
|
+
export interface RESTAPIItems<Item> {
|
|
14
|
+
/**
|
|
15
|
+
* Array of items returned from the API
|
|
16
|
+
*/
|
|
17
|
+
items: Item[];
|
|
18
|
+
/**
|
|
19
|
+
* Pagination data returned from the API
|
|
20
|
+
*/
|
|
21
|
+
paging: RESTAPIPaging;
|
|
22
|
+
}
|
|
23
|
+
export interface RESTAPIPaging {
|
|
24
|
+
cursors: RESTAPICursors;
|
|
25
|
+
/**
|
|
26
|
+
* Is there a prev key in cursors
|
|
27
|
+
*/
|
|
28
|
+
hasPrev: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Is there a next key in cursors
|
|
31
|
+
*/
|
|
32
|
+
hasNext: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface RESTAPICursors {
|
|
35
|
+
/**
|
|
36
|
+
* The next value for pagination
|
|
37
|
+
*/
|
|
38
|
+
next?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The previous value for backwards pagination
|
|
41
|
+
*/
|
|
42
|
+
prev?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface RESTAPIStatusCode {
|
|
45
|
+
/**
|
|
46
|
+
* Typically 200 on success
|
|
47
|
+
*/
|
|
48
|
+
status: number;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=rest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../../src/utils/rest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,CAAE,SAAQ,iBAAiB;IACnE;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;CACR;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI;IACjC;;OAEG;IACH,KAAK,EAAE,IAAI,EAAE,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pixel size of an image or video
|
|
3
|
+
*/
|
|
4
|
+
export interface Size {
|
|
5
|
+
/**
|
|
6
|
+
* Width (in pixels)
|
|
7
|
+
*/
|
|
8
|
+
w: number;
|
|
9
|
+
/**
|
|
10
|
+
* Height (in pixels)
|
|
11
|
+
*/
|
|
12
|
+
h: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A color hex code without `#`
|
|
16
|
+
* @example
|
|
17
|
+
* '55ff00'
|
|
18
|
+
*/
|
|
19
|
+
export type HexCode = string;
|
|
20
|
+
/**
|
|
21
|
+
* Conditional post type.\
|
|
22
|
+
* `T` Conditional\
|
|
23
|
+
* Returns `A` if `T` is true\
|
|
24
|
+
* Returns `B` if `T` is false\
|
|
25
|
+
* Returns `A|B` if T is neither true or false\
|
|
26
|
+
* @example
|
|
27
|
+
* class Foo<Ready extends boolean = boolean> {
|
|
28
|
+
* bar: If<Ready, number, null>
|
|
29
|
+
* isReady(): this is Foo<true> {
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
33
|
+
export type If<T extends boolean, A, B = null> = T extends true ? A : T extends false ? B : A | B;
|
|
34
|
+
/**
|
|
35
|
+
* UNIX Epoch in seconds
|
|
36
|
+
* ? For better accuracy, convert to milliseconds
|
|
37
|
+
*/
|
|
38
|
+
export type EpochSec = number;
|
|
39
|
+
/**
|
|
40
|
+
* UNIX Epoch in milliseconds
|
|
41
|
+
*/
|
|
42
|
+
export type EpochMs = number;
|
|
43
|
+
/**
|
|
44
|
+
* @example
|
|
45
|
+
* interface Foo {
|
|
46
|
+
* bar: 'baz',
|
|
47
|
+
* spam: 'eggs',
|
|
48
|
+
* waldo: 'fred'
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* type BarOrSpamOrWaldo = ValueOf<Foo> // Expect 'baz'|'eggs'|'fred'
|
|
52
|
+
* type Bar = ValueOf<Foo, 'bar'> // Expect 'baz'
|
|
53
|
+
* type BarOrSpam = ValueOf<Foo, 'bar'|'spam'> // Expect 'baz'|'eggs'
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export type ValueOf<T, K extends keyof T = keyof T> = T[K];
|
|
57
|
+
/**
|
|
58
|
+
* Like {@link Pick}, but each key is made required
|
|
59
|
+
* @example
|
|
60
|
+
* interface Foo {
|
|
61
|
+
* bar?: string
|
|
62
|
+
* spam?: number
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* type FooBar = Has<Foo, 'bar'>; // Expect { bar: string }
|
|
66
|
+
* type FooBarOrSpam = Has<Foo, 'bar'|'spam'>; // Expect { bar: string; spam: number }
|
|
67
|
+
*/
|
|
68
|
+
export type Has<T, K extends keyof T> = {
|
|
69
|
+
[P in K]-?: T[P];
|
|
70
|
+
};
|
|
71
|
+
export type Primitive = string | number | boolean | null;
|
|
72
|
+
export type JSONValue = Primitive | JSONObject | JSONValue[];
|
|
73
|
+
/**
|
|
74
|
+
* Represents a raw JSON Object
|
|
75
|
+
*/
|
|
76
|
+
export interface JSONObject {
|
|
77
|
+
[key: string]: JSONValue;
|
|
78
|
+
[index: number]: never;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/utils/util.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,IAAI;IACpB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACV;AAED;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,IAAI,GAC5D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