scryfall-api 3.2.2 → 3.2.4
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/README.md +3 -1
- package/dist/index.d.ts +591 -0
- package/dist/scryfall-api.mjs +113 -113
- package/dist/scryfall-api.umd.js +1 -1
- package/package.json +8 -15
- package/dist/scryfall-api.js +0 -1
- package/dist/types/src/api/CardIdentifierBuilder.d.ts +0 -28
- package/dist/types/src/api/Cards.d.ts +0 -17
- package/dist/types/src/api/Catalog.d.ts +0 -18
- package/dist/types/src/api/Rulings.d.ts +0 -10
- package/dist/types/src/api/Sets.d.ts +0 -9
- package/dist/types/src/api/Symbology.d.ts +0 -7
- package/dist/types/src/error/MagicQueryError.d.ts +0 -3
- package/dist/types/src/index.d.ts +0 -10
- package/dist/types/src/query/MagicPageResult.d.ts +0 -12
- package/dist/types/src/query/MagicQuery.d.ts +0 -13
- package/dist/types/src/types/Border.d.ts +0 -1
- package/dist/types/src/types/BulkDataDefinition.d.ts +0 -0
- package/dist/types/src/types/BulkDataType.d.ts +0 -0
- package/dist/types/src/types/BulkDataTypes.d.ts +0 -1
- package/dist/types/src/types/Card.d.ts +0 -0
- package/dist/types/src/types/CardFace.d.ts +0 -0
- package/dist/types/src/types/CardIdentifier.d.ts +0 -0
- package/dist/types/src/types/CardSymbol.d.ts +0 -0
- package/dist/types/src/types/Color.d.ts +0 -1
- package/dist/types/src/types/Format.d.ts +0 -1
- package/dist/types/src/types/FrameEffect.d.ts +0 -1
- package/dist/types/src/types/Game.d.ts +0 -1
- package/dist/types/src/types/HomepageLink.d.ts +0 -0
- package/dist/types/src/types/ImageUris.d.ts +0 -0
- package/dist/types/src/types/Layout.d.ts +0 -1
- package/dist/types/src/types/Legalties.d.ts +0 -0
- package/dist/types/src/types/Legalty.d.ts +0 -1
- package/dist/types/src/types/ManaCost.d.ts +0 -0
- package/dist/types/src/types/PageQuery.d.ts +0 -0
- package/dist/types/src/types/PageQueryValue.d.ts +0 -0
- package/dist/types/src/types/Preview.d.ts +0 -0
- package/dist/types/src/types/Prices.d.ts +0 -0
- package/dist/types/src/types/PromoType.d.ts +0 -1
- package/dist/types/src/types/PurchaseUris.d.ts +0 -0
- package/dist/types/src/types/Query.d.ts +0 -0
- package/dist/types/src/types/Rarity.d.ts +0 -1
- package/dist/types/src/types/RelatedCard.d.ts +0 -0
- package/dist/types/src/types/RelatedCardComponent.d.ts +0 -1
- package/dist/types/src/types/RelatedUris.d.ts +0 -0
- package/dist/types/src/types/ResultCatalog.d.ts +0 -0
- package/dist/types/src/types/ResultData.d.ts +0 -0
- package/dist/types/src/types/ResultList.d.ts +0 -0
- package/dist/types/src/types/RetryStrategy.d.ts +0 -0
- package/dist/types/src/types/Ruling.d.ts +0 -0
- package/dist/types/src/types/SearchError.d.ts +0 -0
- package/dist/types/src/types/SearchOptions.d.ts +0 -0
- package/dist/types/src/types/Set.d.ts +0 -0
- package/dist/types/src/types/SetType.d.ts +0 -1
- package/dist/types/src/types/Sort.d.ts +0 -1
- package/dist/types/src/types/SortDirection.d.ts +0 -1
- package/dist/types/src/types/TOrArrayOfT.d.ts +0 -0
- package/dist/types/src/types/UniqueStrategy.d.ts +0 -1
- package/dist/types/src/types/index.d.ts +0 -42
package/README.md
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
A Javascript library for [Scryfall](https://scryfall.com/docs/api) written in Typescript.
|
|
7
7
|
|
|
8
|
-
As of [August 6th, 2022](./CHANGELOG.md), almost all features described in
|
|
8
|
+
As of [August 6th, 2022](./CHANGELOG.md), almost all features described in
|
|
9
|
+
the [Scryfall documentation](https://scryfall.com/docs/api) are supported. If you see something that isn't supported,
|
|
10
|
+
make an issue! See [support readme](./SUPPORT.md).
|
|
9
11
|
|
|
10
12
|
## Installation
|
|
11
13
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
|
|
3
|
+
export declare enum Border {
|
|
4
|
+
black = 0,
|
|
5
|
+
borderless = 1,
|
|
6
|
+
gold = 2,
|
|
7
|
+
silver = 3,
|
|
8
|
+
white = 4
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare interface BulkDataDefinition {
|
|
12
|
+
compressed_size: number;
|
|
13
|
+
content_encoding: string;
|
|
14
|
+
content_type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
download_uri: string;
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
object: 'bulk_data';
|
|
20
|
+
type: BulkDataType;
|
|
21
|
+
updated_at: string;
|
|
22
|
+
uri: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare type BulkDataType = keyof typeof BulkDataTypes;
|
|
26
|
+
|
|
27
|
+
export declare enum BulkDataTypes {
|
|
28
|
+
oracle_cards = 0,
|
|
29
|
+
unique_artwork = 1,
|
|
30
|
+
default_cards = 2,
|
|
31
|
+
all_cards = 3,
|
|
32
|
+
rulings = 4
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare interface Card {
|
|
36
|
+
all_parts?: RelatedCard[];
|
|
37
|
+
arena_id?: number;
|
|
38
|
+
artist?: string;
|
|
39
|
+
artist_ids?: string[];
|
|
40
|
+
booster: boolean;
|
|
41
|
+
border_color: keyof typeof Border;
|
|
42
|
+
card_back_id: string;
|
|
43
|
+
card_faces?: CardFace[];
|
|
44
|
+
cmc: number;
|
|
45
|
+
collector_number: string;
|
|
46
|
+
color_identity: Color[];
|
|
47
|
+
color_indicator?: Color[];
|
|
48
|
+
colors?: Color[];
|
|
49
|
+
digital: boolean;
|
|
50
|
+
edhrec_rank?: number;
|
|
51
|
+
flavor_text?: string;
|
|
52
|
+
foil: boolean;
|
|
53
|
+
frame: '1993' | '1997' | '2003' | '2015' | 'Future';
|
|
54
|
+
frame_effects?: (keyof typeof FrameEffect)[];
|
|
55
|
+
full_art: boolean;
|
|
56
|
+
games: (keyof typeof Game)[];
|
|
57
|
+
hand_modifier?: string;
|
|
58
|
+
highres_image: boolean;
|
|
59
|
+
id: string;
|
|
60
|
+
illustration_id?: string;
|
|
61
|
+
image_uris?: ImageUris;
|
|
62
|
+
lang: string;
|
|
63
|
+
layout: keyof typeof Layout;
|
|
64
|
+
legalities: Legalities;
|
|
65
|
+
life_modifier?: string;
|
|
66
|
+
loyalty?: string;
|
|
67
|
+
mana_cost?: string;
|
|
68
|
+
mtgo_foil_id?: number;
|
|
69
|
+
mtgo_id?: number;
|
|
70
|
+
multiverse_ids?: number[];
|
|
71
|
+
name: string;
|
|
72
|
+
nonfoil: boolean;
|
|
73
|
+
object: 'card';
|
|
74
|
+
oracle_id: string;
|
|
75
|
+
oracle_text?: string;
|
|
76
|
+
oversized: boolean;
|
|
77
|
+
power?: string;
|
|
78
|
+
preview?: Preview;
|
|
79
|
+
prices: Prices;
|
|
80
|
+
printed_name?: string;
|
|
81
|
+
printed_text?: string;
|
|
82
|
+
printed_type_line?: string;
|
|
83
|
+
prints_search_uri: string;
|
|
84
|
+
promo: boolean;
|
|
85
|
+
promo_types?: (keyof typeof PromoType)[];
|
|
86
|
+
purchase_uris: PurchaseUris;
|
|
87
|
+
rarity: keyof typeof Rarity;
|
|
88
|
+
related_uris: RelatedUris;
|
|
89
|
+
released_at: string;
|
|
90
|
+
reprint: boolean;
|
|
91
|
+
reserved: boolean;
|
|
92
|
+
rulings_uri: string;
|
|
93
|
+
scryfall_set_uri: string;
|
|
94
|
+
scryfall_uri: string;
|
|
95
|
+
set: string;
|
|
96
|
+
set_name: string;
|
|
97
|
+
set_search_uri: string;
|
|
98
|
+
set_type: Set_2['set_type'];
|
|
99
|
+
set_uri: string;
|
|
100
|
+
story_spotlight: boolean;
|
|
101
|
+
tcgplayer_id?: number;
|
|
102
|
+
textless: boolean;
|
|
103
|
+
toughness?: string;
|
|
104
|
+
type_line: string;
|
|
105
|
+
uri: string;
|
|
106
|
+
variation: boolean;
|
|
107
|
+
variation_of?: string;
|
|
108
|
+
watermark?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare interface CardFace {
|
|
112
|
+
artist?: string;
|
|
113
|
+
color_indicator?: Color[];
|
|
114
|
+
colors: Color[];
|
|
115
|
+
flavor_text?: string;
|
|
116
|
+
illustration_id?: string;
|
|
117
|
+
image_uris?: ImageUris;
|
|
118
|
+
loyalty?: string;
|
|
119
|
+
mana_cost: string;
|
|
120
|
+
name: string;
|
|
121
|
+
object: 'card_face';
|
|
122
|
+
oracle_text?: string;
|
|
123
|
+
power?: string;
|
|
124
|
+
printed_name?: string;
|
|
125
|
+
printed_text?: string;
|
|
126
|
+
printed_type_line?: string;
|
|
127
|
+
toughness?: string;
|
|
128
|
+
type_line: string;
|
|
129
|
+
watermark?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare interface CardIdentifier {
|
|
133
|
+
collector_number?: string;
|
|
134
|
+
id?: string;
|
|
135
|
+
illustration_id?: string;
|
|
136
|
+
mtgo_id?: number;
|
|
137
|
+
multiverse_id?: number;
|
|
138
|
+
name?: string;
|
|
139
|
+
oracle_id?: string;
|
|
140
|
+
set?: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export declare class CardIdentifierBuilder {
|
|
144
|
+
static byId(id: string): CardIdentifier;
|
|
145
|
+
static byIllustrationId(id: string): CardIdentifier;
|
|
146
|
+
static byMtgoId(id: number): CardIdentifier;
|
|
147
|
+
static byMultiverseId(id: number): CardIdentifier;
|
|
148
|
+
static byName(name: string, set?: string): CardIdentifier;
|
|
149
|
+
static byOracleId(id: string): CardIdentifier;
|
|
150
|
+
static bySet(set: string, collectorNumber: number | string): CardIdentifier;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export declare const Cards: Cards_2;
|
|
154
|
+
|
|
155
|
+
declare class Cards_2 extends MagicQuery {
|
|
156
|
+
autoCompleteName(name: string): Promise<string[]>;
|
|
157
|
+
byArenaId(id: number): Promise<Card | undefined>;
|
|
158
|
+
byId(id: string): Promise<Card | undefined>;
|
|
159
|
+
byMtgoId(id: number): Promise<Card | undefined>;
|
|
160
|
+
byMultiverseId(id: number): Promise<Card | undefined>;
|
|
161
|
+
byName(name: string, fuzzy?: boolean): Promise<Card | undefined>;
|
|
162
|
+
byName(name: string, set?: string, fuzzy?: boolean): Promise<Card | undefined>;
|
|
163
|
+
bySet(setCode: string, collectorNumber: number, lang?: string): Promise<Card | undefined>;
|
|
164
|
+
byTcgPlayerId(id: number): Promise<Card | undefined>;
|
|
165
|
+
collection(...identifiers: CardIdentifier[]): Promise<Card[]>;
|
|
166
|
+
random(): Promise<Card | undefined>;
|
|
167
|
+
search(query: string, options?: SearchOptions | number): MagicPageResult<Card, Cards_2>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export declare interface CardSymbol {
|
|
171
|
+
appears_in_mana_costs: boolean;
|
|
172
|
+
colors: Color[];
|
|
173
|
+
converted_mana_cost?: number;
|
|
174
|
+
english: string;
|
|
175
|
+
funny: boolean;
|
|
176
|
+
gatherer_alternates?: string[];
|
|
177
|
+
loose_variant?: string;
|
|
178
|
+
represents_mana: boolean;
|
|
179
|
+
symbol: string;
|
|
180
|
+
transposable: boolean;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export declare const Catalog: Catalog_2;
|
|
184
|
+
|
|
185
|
+
declare class Catalog_2 extends MagicQuery {
|
|
186
|
+
artifactTypes(): Promise<string[]>;
|
|
187
|
+
artistNames(): Promise<string[]>;
|
|
188
|
+
cardNames(): Promise<string[]>;
|
|
189
|
+
creatureTypes(): Promise<string[]>;
|
|
190
|
+
enchantmentTypes(): Promise<string[]>;
|
|
191
|
+
landTypes(): Promise<string[]>;
|
|
192
|
+
loyalties(): Promise<string[]>;
|
|
193
|
+
planeswalkerTypes(): Promise<string[]>;
|
|
194
|
+
powers(): Promise<string[]>;
|
|
195
|
+
spellTypes(): Promise<string[]>;
|
|
196
|
+
toughnesses(): Promise<string[]>;
|
|
197
|
+
watermarks(): Promise<string[]>;
|
|
198
|
+
wordBank(): Promise<string[]>;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare type Color = keyof typeof Colors;
|
|
202
|
+
|
|
203
|
+
declare enum Colors {
|
|
204
|
+
W = 0,
|
|
205
|
+
B = 1,
|
|
206
|
+
R = 2,
|
|
207
|
+
U = 3,
|
|
208
|
+
G = 4
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export declare enum Format {
|
|
212
|
+
standard = 0,
|
|
213
|
+
future = 1,
|
|
214
|
+
historic = 2,
|
|
215
|
+
pioneer = 3,
|
|
216
|
+
modern = 4,
|
|
217
|
+
legacy = 5,
|
|
218
|
+
pauper = 6,
|
|
219
|
+
vintage = 7,
|
|
220
|
+
penny = 8,
|
|
221
|
+
commander = 9,
|
|
222
|
+
brawl = 10,
|
|
223
|
+
duel = 11,
|
|
224
|
+
oldschool = 12
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export declare enum FrameEffect {
|
|
228
|
+
legendary = 0,
|
|
229
|
+
miracle = 1,
|
|
230
|
+
nyxtouched = 2,
|
|
231
|
+
draft = 3,
|
|
232
|
+
devoid = 4,
|
|
233
|
+
tombstone = 5,
|
|
234
|
+
colorshifted = 6,
|
|
235
|
+
inverted = 7,
|
|
236
|
+
sunmoondfc = 8,
|
|
237
|
+
compasslanddfc = 9,
|
|
238
|
+
originpwdfc = 10,
|
|
239
|
+
mooneldrazidfc = 11,
|
|
240
|
+
moonreversemoondfc = 12,
|
|
241
|
+
showcase = 13,
|
|
242
|
+
extendedart = 14
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export declare enum Game {
|
|
246
|
+
paper = 0,
|
|
247
|
+
arena = 1,
|
|
248
|
+
mtgo = 2
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export declare interface HomepageLink {
|
|
252
|
+
badge?: string;
|
|
253
|
+
created_at: string;
|
|
254
|
+
id: number;
|
|
255
|
+
priority: number;
|
|
256
|
+
text: string;
|
|
257
|
+
updated_at: string;
|
|
258
|
+
uri: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export declare interface ImageUris {
|
|
262
|
+
art_crop: string;
|
|
263
|
+
border_crop: string;
|
|
264
|
+
large: string;
|
|
265
|
+
normal: string;
|
|
266
|
+
png: string;
|
|
267
|
+
small: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export declare enum Layout {
|
|
271
|
+
normal = 0,
|
|
272
|
+
split = 1,
|
|
273
|
+
flip = 2,
|
|
274
|
+
transform = 3,
|
|
275
|
+
modal_dfc = 4,
|
|
276
|
+
meld = 5,
|
|
277
|
+
leveler = 6,
|
|
278
|
+
'class' = 7,
|
|
279
|
+
saga = 8,
|
|
280
|
+
adventure = 9,
|
|
281
|
+
planar = 10,
|
|
282
|
+
scheme = 11,
|
|
283
|
+
vanguard = 12,
|
|
284
|
+
token = 13,
|
|
285
|
+
double_faced_token = 14,
|
|
286
|
+
emblem = 15,
|
|
287
|
+
augment = 16,
|
|
288
|
+
host = 17,
|
|
289
|
+
art_series = 18,
|
|
290
|
+
reversible_card = 19
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export declare type Legalities = {
|
|
294
|
+
[key in keyof typeof Format]: keyof typeof Legality;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
export declare enum Legality {
|
|
298
|
+
legal = 0,
|
|
299
|
+
not_legal = 1,
|
|
300
|
+
restricted = 2,
|
|
301
|
+
banned = 3
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare class MagicPageResult<T, Q extends MagicQuery, P = unknown> {
|
|
305
|
+
private readonly q;
|
|
306
|
+
private readonly apiPath;
|
|
307
|
+
private readonly query;
|
|
308
|
+
private readonly post?;
|
|
309
|
+
private _count;
|
|
310
|
+
private _hasMore;
|
|
311
|
+
constructor(q: Q, apiPath: string, query: PageQuery, post?: P | undefined);
|
|
312
|
+
get count(): number;
|
|
313
|
+
get hasMore(): boolean;
|
|
314
|
+
all(): Promise<T[]>;
|
|
315
|
+
get(limit: number): Promise<T[]>;
|
|
316
|
+
next(): Promise<T[]>;
|
|
317
|
+
page(page: number): Promise<T[]>;
|
|
318
|
+
private setNextPage;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare abstract class MagicQuery {
|
|
322
|
+
static retry: RetryStrategy;
|
|
323
|
+
private static readonly endpoint;
|
|
324
|
+
private static lastQuery;
|
|
325
|
+
private static readonly rateLimit;
|
|
326
|
+
private static canRetry;
|
|
327
|
+
private static debounce;
|
|
328
|
+
private static sleep;
|
|
329
|
+
private static tryQuery;
|
|
330
|
+
query<T = unknown, Y = unknown>(apiPath: TOrArrayOfT<number | string | undefined>, query?: Query, post?: Y, requestOptions?: AxiosRequestConfig): Promise<T | undefined>;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export declare class MagicQueryError extends Error {
|
|
334
|
+
readonly data?: string | SearchError | undefined;
|
|
335
|
+
constructor(data?: string | SearchError | undefined);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export declare interface ManaCost {
|
|
339
|
+
cmc: number;
|
|
340
|
+
colorless: boolean;
|
|
341
|
+
colors: Color[];
|
|
342
|
+
cost: string;
|
|
343
|
+
monocolored: boolean;
|
|
344
|
+
multicolored: boolean;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export declare type PageQuery = {
|
|
348
|
+
[key: string]: QueryValue;
|
|
349
|
+
page: number;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export declare interface Preview {
|
|
353
|
+
previewed_at?: string;
|
|
354
|
+
source?: string;
|
|
355
|
+
source_uri?: string;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export declare interface Prices {
|
|
359
|
+
eur?: string;
|
|
360
|
+
tix?: string;
|
|
361
|
+
usd?: string;
|
|
362
|
+
usd_foil?: string;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export declare enum PromoType {
|
|
366
|
+
tourney = 0,
|
|
367
|
+
prerelease = 1,
|
|
368
|
+
datestamped = 2,
|
|
369
|
+
planeswalkerdeck = 3,
|
|
370
|
+
buyabox = 4,
|
|
371
|
+
judgegift = 5,
|
|
372
|
+
event = 6,
|
|
373
|
+
convention = 7,
|
|
374
|
+
starterdeck = 8,
|
|
375
|
+
instore = 9,
|
|
376
|
+
setpromo = 10,
|
|
377
|
+
fnm = 11,
|
|
378
|
+
openhouse = 12,
|
|
379
|
+
league = 13,
|
|
380
|
+
draftweekend = 14,
|
|
381
|
+
gameday = 15,
|
|
382
|
+
release = 16,
|
|
383
|
+
intropack = 17,
|
|
384
|
+
giftbox = 18,
|
|
385
|
+
duels = 19,
|
|
386
|
+
wizardsplaynetwork = 20,
|
|
387
|
+
premiereshop = 21,
|
|
388
|
+
playerrewards = 22,
|
|
389
|
+
gateway = 23,
|
|
390
|
+
arenaleague = 24
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export declare interface PurchaseUris {
|
|
394
|
+
[key: string]: string | undefined;
|
|
395
|
+
cardhoarder?: string;
|
|
396
|
+
cardmarket?: string;
|
|
397
|
+
tcgplayer?: string;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export declare type Query = {
|
|
401
|
+
[key: string]: QueryValue;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
export declare type QueryValue = boolean | number | string | undefined;
|
|
405
|
+
|
|
406
|
+
export declare enum Rarity {
|
|
407
|
+
common = 0,
|
|
408
|
+
uncommon = 1,
|
|
409
|
+
rare = 2,
|
|
410
|
+
mythic = 3
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export declare interface RelatedCard {
|
|
414
|
+
component: keyof typeof RelatedCardComponent;
|
|
415
|
+
id: string;
|
|
416
|
+
name: string;
|
|
417
|
+
object: 'related_card';
|
|
418
|
+
type_line: string;
|
|
419
|
+
uri: string;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export declare enum RelatedCardComponent {
|
|
423
|
+
token = 0,
|
|
424
|
+
meld_part = 1,
|
|
425
|
+
meld_result = 2,
|
|
426
|
+
combo_piece = 3
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export declare interface RelatedUris {
|
|
430
|
+
[key: string]: string | undefined;
|
|
431
|
+
edhrec?: string;
|
|
432
|
+
gatherer?: string;
|
|
433
|
+
mtgtop8?: string;
|
|
434
|
+
tcgplayer_decks?: string;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export declare type ResultCatalog = ResultData<string>;
|
|
438
|
+
|
|
439
|
+
export declare interface ResultData<T, NOT_FOUND = never> {
|
|
440
|
+
data: T[];
|
|
441
|
+
not_found?: NOT_FOUND[];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export declare interface ResultList<T, NOT_FOUND = never> extends ResultData<T, NOT_FOUND> {
|
|
445
|
+
has_more: boolean;
|
|
446
|
+
next_page: string;
|
|
447
|
+
total_cards: string;
|
|
448
|
+
warnings: string[];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export declare interface RetryStrategy {
|
|
452
|
+
attempts: number;
|
|
453
|
+
/**
|
|
454
|
+
* Whether even `not_found` and `bad_request` errors should be retried.
|
|
455
|
+
* @deprecated Don't use this, this is for unit tests
|
|
456
|
+
*/
|
|
457
|
+
forced?: boolean;
|
|
458
|
+
timeout?: number;
|
|
459
|
+
canRetry?(error?: SearchError): boolean;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export declare interface Ruling {
|
|
463
|
+
comment: string;
|
|
464
|
+
published_at: string;
|
|
465
|
+
source: string;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export declare const Rulings: Rulings_2;
|
|
469
|
+
|
|
470
|
+
declare class Rulings_2 extends MagicQuery {
|
|
471
|
+
byArenaId(id: number): Promise<Ruling[]>;
|
|
472
|
+
byId(id: string): Promise<Ruling[]>;
|
|
473
|
+
byMtgoId(id: number): Promise<Ruling[]>;
|
|
474
|
+
byMultiverseId(id: number): Promise<Ruling[]>;
|
|
475
|
+
bySet(setCode: string, collectorNumber: number | string): Promise<Ruling[]>;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export declare interface SearchError {
|
|
479
|
+
code: string;
|
|
480
|
+
details: string;
|
|
481
|
+
object: 'error';
|
|
482
|
+
status: number;
|
|
483
|
+
warnings?: string[];
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export declare interface SearchOptions {
|
|
487
|
+
dir?: keyof typeof SortDirection;
|
|
488
|
+
include_extras?: boolean;
|
|
489
|
+
include_multilingual?: boolean;
|
|
490
|
+
include_variations?: boolean;
|
|
491
|
+
order?: keyof typeof Sort;
|
|
492
|
+
/**
|
|
493
|
+
* The page to start on. Defaults to `1`, for first page. A page is 175 cards.
|
|
494
|
+
*/
|
|
495
|
+
page?: number;
|
|
496
|
+
unique?: keyof typeof UniqueStrategy;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
declare interface Set_2 {
|
|
500
|
+
block?: string;
|
|
501
|
+
block_code?: string;
|
|
502
|
+
card_count: number;
|
|
503
|
+
code: string;
|
|
504
|
+
digital: boolean;
|
|
505
|
+
foil_only: boolean;
|
|
506
|
+
icon_svg_uri: string;
|
|
507
|
+
id: string;
|
|
508
|
+
mtgo_code?: string;
|
|
509
|
+
name: string;
|
|
510
|
+
parent_set_code?: string;
|
|
511
|
+
released_at?: string;
|
|
512
|
+
scryfall_uri: string;
|
|
513
|
+
search_uri: string;
|
|
514
|
+
set_type: keyof typeof SetType;
|
|
515
|
+
tcgplayer_id?: number;
|
|
516
|
+
uri: string;
|
|
517
|
+
}
|
|
518
|
+
export { Set_2 as Set }
|
|
519
|
+
|
|
520
|
+
export declare const Sets: Sets_2;
|
|
521
|
+
|
|
522
|
+
declare class Sets_2 extends MagicQuery {
|
|
523
|
+
all(): Promise<Set_2[]>;
|
|
524
|
+
byCode(code: string): Promise<Set_2 | undefined>;
|
|
525
|
+
byId(id: string): Promise<Set_2 | undefined>;
|
|
526
|
+
byTcgPlayerId(id: number): Promise<Set_2 | undefined>;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export declare enum SetType {
|
|
530
|
+
core = 0,
|
|
531
|
+
expansion = 1,
|
|
532
|
+
masters = 2,
|
|
533
|
+
masterpiece = 3,
|
|
534
|
+
from_the_vault = 4,
|
|
535
|
+
spellbook = 5,
|
|
536
|
+
premium_deck = 6,
|
|
537
|
+
duel_deck = 7,
|
|
538
|
+
draft_innovation = 8,
|
|
539
|
+
treasure_chest = 9,
|
|
540
|
+
commander = 10,
|
|
541
|
+
planechase = 11,
|
|
542
|
+
archenemy = 12,
|
|
543
|
+
vanguard = 13,
|
|
544
|
+
funny = 14,
|
|
545
|
+
starter = 15,
|
|
546
|
+
box = 16,
|
|
547
|
+
promo = 17,
|
|
548
|
+
token = 18,
|
|
549
|
+
memorabilia = 19,
|
|
550
|
+
alchemy = 20,
|
|
551
|
+
arsenal = 21
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export declare enum Sort {
|
|
555
|
+
name = 0,
|
|
556
|
+
set = 1,
|
|
557
|
+
released = 2,
|
|
558
|
+
rarity = 3,
|
|
559
|
+
color = 4,
|
|
560
|
+
usd = 5,
|
|
561
|
+
tix = 6,
|
|
562
|
+
eur = 7,
|
|
563
|
+
cmc = 8,
|
|
564
|
+
power = 9,
|
|
565
|
+
toughness = 10,
|
|
566
|
+
edhrec = 11,
|
|
567
|
+
artist = 12
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export declare enum SortDirection {
|
|
571
|
+
auto = 0,
|
|
572
|
+
asc = 1,
|
|
573
|
+
desc = 2
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export declare const Symbology: Symbology_2;
|
|
577
|
+
|
|
578
|
+
declare class Symbology_2 extends MagicQuery {
|
|
579
|
+
all(): Promise<CardSymbol[]>;
|
|
580
|
+
parseMana(shorthand: string): Promise<ManaCost | undefined>;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export declare type TOrArrayOfT<T> = T | T[];
|
|
584
|
+
|
|
585
|
+
export declare enum UniqueStrategy {
|
|
586
|
+
cards = 0,
|
|
587
|
+
art = 1,
|
|
588
|
+
prints = 2
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
export { }
|