scryfall-api 4.0.0 → 4.0.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/README.md +2 -2
- package/dist/scryfall-api.d.cts +417 -0
- package/dist/scryfall-api.d.ts +7 -14
- package/package.json +16 -11
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/scryfall-api" rel="nofollow">
|
|
13
|
-
<img src="https://
|
|
13
|
+
<img src="https://img.shields.io/npm/v/scryfall-api?style=flat-square" alt="npm" style="max-width: 100%;">
|
|
14
14
|
</a>
|
|
15
15
|
<a href="https://github.com/MarioMH8/scryfall-api">
|
|
16
|
-
<img src="https://
|
|
16
|
+
<img src="https://img.shields.io/github/issues/mariomh8/scryfall-api?style=flat-square" alt="GitHub issues" style="max-width: 100%;">
|
|
17
17
|
</a>
|
|
18
18
|
</p>
|
|
19
19
|
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definition for Nullable.
|
|
3
|
+
* @type {T | null | undefined} The type can be T, null, or undefined.
|
|
4
|
+
* @template T The type of the value that can be null or undefined.
|
|
5
|
+
*/
|
|
6
|
+
type Nullable<T> = null | T | undefined;
|
|
7
|
+
|
|
8
|
+
type QueryValue = boolean | number | string | undefined;
|
|
9
|
+
interface PageQuery {
|
|
10
|
+
[key: string]: QueryValue;
|
|
11
|
+
page: number;
|
|
12
|
+
}
|
|
13
|
+
declare class MagicPageResult<T> {
|
|
14
|
+
#private;
|
|
15
|
+
private readonly apiPath;
|
|
16
|
+
private readonly query;
|
|
17
|
+
constructor(apiPath: string, query: PageQuery);
|
|
18
|
+
get count(): number;
|
|
19
|
+
get hasMore(): boolean;
|
|
20
|
+
all(): Promise<T[]>;
|
|
21
|
+
get(limit: number): Promise<T[]>;
|
|
22
|
+
next(): Promise<T[]>;
|
|
23
|
+
page(page: number): Promise<T[]>;
|
|
24
|
+
private setNextPage;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface CardIdentifierId {
|
|
28
|
+
id: string;
|
|
29
|
+
}
|
|
30
|
+
interface CardIdentifierIllustrationId {
|
|
31
|
+
illustration_id: string;
|
|
32
|
+
}
|
|
33
|
+
interface CardIdentifierMtgGoId {
|
|
34
|
+
mtgo_id: number;
|
|
35
|
+
}
|
|
36
|
+
interface CardIdentifierMultiverseId {
|
|
37
|
+
multiverse_id: number;
|
|
38
|
+
}
|
|
39
|
+
interface CardIdentifierNameSet {
|
|
40
|
+
name: string;
|
|
41
|
+
set?: string;
|
|
42
|
+
}
|
|
43
|
+
interface CardIdentifierOracleId {
|
|
44
|
+
oracle_id: string;
|
|
45
|
+
}
|
|
46
|
+
interface CardIdentifierCollectorSet {
|
|
47
|
+
collector_number: string;
|
|
48
|
+
set: string;
|
|
49
|
+
}
|
|
50
|
+
type CardIdentifier = CardIdentifierCollectorSet | CardIdentifierId | CardIdentifierIllustrationId | CardIdentifierMtgGoId | CardIdentifierMultiverseId | CardIdentifierNameSet | CardIdentifierOracleId;
|
|
51
|
+
|
|
52
|
+
declare class CardIdentifierApi {
|
|
53
|
+
static byId(id: string): CardIdentifier;
|
|
54
|
+
static byIllustrationId(id: string): CardIdentifier;
|
|
55
|
+
static byMtgoId(id: number): CardIdentifier;
|
|
56
|
+
static byMultiverseId(id: number): CardIdentifier;
|
|
57
|
+
static byName(name: string, set?: string): CardIdentifier;
|
|
58
|
+
static byOracleId(id: string): CardIdentifier;
|
|
59
|
+
static bySet(set: string, collectorNumber: number | string): CardIdentifier;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type CardLanguage = 'ar' | 'de' | 'en' | 'es' | 'fr' | 'grc' | 'he' | 'it' | 'ja' | 'ko' | 'la' | 'ph' | 'pt' | 'ru' | 'sa' | 'zhs' | 'zht';
|
|
63
|
+
type CardLayout = 'adventure' | 'art_series' | 'augment' | 'battle' | 'case' | 'class' | 'double_faced_token' | 'emblem' | 'flip' | 'host' | 'leveler' | 'meld' | 'modal_dfc' | 'mutate' | 'normal' | 'planar' | 'prototype' | 'reversible_card' | 'saga' | 'scheme' | 'split' | 'token' | 'transform' | 'vanguard';
|
|
64
|
+
interface CardCore {
|
|
65
|
+
arena_id?: Nullable<string>;
|
|
66
|
+
cardmarket_id?: Nullable<number>;
|
|
67
|
+
id: string;
|
|
68
|
+
lang: CardLanguage;
|
|
69
|
+
layout: CardLayout;
|
|
70
|
+
mtgo_foil_id?: Nullable<number>;
|
|
71
|
+
mtgo_id?: Nullable<number>;
|
|
72
|
+
multiverse_ids?: Nullable<number[]>;
|
|
73
|
+
object: 'card';
|
|
74
|
+
oracle_id?: Nullable<string>;
|
|
75
|
+
prints_search_uri: string;
|
|
76
|
+
rulings_uri: string;
|
|
77
|
+
scryfall_uri: string;
|
|
78
|
+
tcgplayer_etched_id?: Nullable<number>;
|
|
79
|
+
tcgplayer_id?: Nullable<number>;
|
|
80
|
+
uri: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type Color = 'B' | 'G' | 'R' | 'U' | 'W';
|
|
84
|
+
interface ManaCost {
|
|
85
|
+
cmc: number;
|
|
86
|
+
colorless: boolean;
|
|
87
|
+
colors: Color[];
|
|
88
|
+
cost: string;
|
|
89
|
+
monocolored: boolean;
|
|
90
|
+
multicolored: boolean;
|
|
91
|
+
object: 'mana_cost';
|
|
92
|
+
}
|
|
93
|
+
interface Symbology {
|
|
94
|
+
appears_in_mana_costs: boolean;
|
|
95
|
+
colors: Color[];
|
|
96
|
+
english: string;
|
|
97
|
+
funny: boolean;
|
|
98
|
+
gatherer_alternates?: Nullable<string[]>;
|
|
99
|
+
hybrid: boolean;
|
|
100
|
+
loose_variant?: Nullable<string>;
|
|
101
|
+
mana_value?: Nullable<number>;
|
|
102
|
+
object: 'card_symbol';
|
|
103
|
+
phyrexian: boolean;
|
|
104
|
+
represents_mana: boolean;
|
|
105
|
+
svg_uri?: Nullable<string>;
|
|
106
|
+
symbol: string;
|
|
107
|
+
transposable: boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class SymbologyApi {
|
|
111
|
+
all(): Promise<Symbology[]>;
|
|
112
|
+
parseMana(shorthand: string): Promise<ManaCost>;
|
|
113
|
+
}
|
|
114
|
+
declare const symbology: SymbologyApi;
|
|
115
|
+
|
|
116
|
+
interface ImageUris {
|
|
117
|
+
art_crop: string;
|
|
118
|
+
border_crop: string;
|
|
119
|
+
large: string;
|
|
120
|
+
normal: string;
|
|
121
|
+
png: string;
|
|
122
|
+
small: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
type CardComponent = 'combo_piece' | 'meld_part' | 'meld_result' | 'token';
|
|
126
|
+
type Legality = 'banned' | 'legal' | 'not_legal' | 'restricted';
|
|
127
|
+
interface CardFace {
|
|
128
|
+
artist?: Nullable<string>;
|
|
129
|
+
artist_id?: Nullable<string>;
|
|
130
|
+
cmc?: Nullable<number>;
|
|
131
|
+
color_indicator?: Nullable<Color[]>;
|
|
132
|
+
colors?: Nullable<Color[]>;
|
|
133
|
+
defense?: Nullable<string>;
|
|
134
|
+
flavor_text?: Nullable<string>;
|
|
135
|
+
illustration_id?: Nullable<string>;
|
|
136
|
+
image_uris?: Nullable<ImageUris>;
|
|
137
|
+
layout?: Nullable<string>;
|
|
138
|
+
loyalty?: Nullable<string>;
|
|
139
|
+
mana_cost: string;
|
|
140
|
+
name: string;
|
|
141
|
+
object: 'card_face';
|
|
142
|
+
oracle_id?: Nullable<string>;
|
|
143
|
+
oracle_text?: Nullable<string>;
|
|
144
|
+
power?: Nullable<string>;
|
|
145
|
+
printed_name?: Nullable<string>;
|
|
146
|
+
printed_text?: Nullable<string>;
|
|
147
|
+
printed_type_line?: Nullable<string>;
|
|
148
|
+
toughness?: Nullable<string>;
|
|
149
|
+
type_line?: Nullable<string>;
|
|
150
|
+
watermark?: Nullable<string>;
|
|
151
|
+
}
|
|
152
|
+
interface RelatedCard {
|
|
153
|
+
component: CardComponent;
|
|
154
|
+
id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
object: 'related_card';
|
|
157
|
+
type_line: string;
|
|
158
|
+
uri: string;
|
|
159
|
+
}
|
|
160
|
+
interface Legalities {
|
|
161
|
+
alchemy: Legality;
|
|
162
|
+
brawl: Legality;
|
|
163
|
+
commander: Legality;
|
|
164
|
+
duel: Legality;
|
|
165
|
+
explorer: Legality;
|
|
166
|
+
future: Legality;
|
|
167
|
+
gladiator: Legality;
|
|
168
|
+
historic: Legality;
|
|
169
|
+
legacy: Legality;
|
|
170
|
+
modern: Legality;
|
|
171
|
+
oathbreaker: Legality;
|
|
172
|
+
oldschool: Legality;
|
|
173
|
+
pauper: Legality;
|
|
174
|
+
paupercommander: Legality;
|
|
175
|
+
penny: Legality;
|
|
176
|
+
pioneer: Legality;
|
|
177
|
+
predh: Legality;
|
|
178
|
+
premodern: Legality;
|
|
179
|
+
standard: Legality;
|
|
180
|
+
standardbrawl: Legality;
|
|
181
|
+
timeless: Legality;
|
|
182
|
+
vintage: Legality;
|
|
183
|
+
}
|
|
184
|
+
interface GameplayCard {
|
|
185
|
+
all_parts?: Nullable<RelatedCard[]>;
|
|
186
|
+
card_faces?: Nullable<CardFace[]>;
|
|
187
|
+
cmc: number;
|
|
188
|
+
color_identity: Color[];
|
|
189
|
+
color_indicator?: Nullable<Color[]>;
|
|
190
|
+
colors?: Nullable<Color[]>;
|
|
191
|
+
defense?: Nullable<string>;
|
|
192
|
+
edhrec_rank?: Nullable<number>;
|
|
193
|
+
hand_modifier?: Nullable<string>;
|
|
194
|
+
keywords: string[];
|
|
195
|
+
legalities: Legalities;
|
|
196
|
+
life_modifier?: Nullable<string>;
|
|
197
|
+
loyalty?: Nullable<string>;
|
|
198
|
+
mana_cost?: Nullable<string>;
|
|
199
|
+
name: string;
|
|
200
|
+
oracle_text?: Nullable<string>;
|
|
201
|
+
penny_rank?: Nullable<number>;
|
|
202
|
+
power?: Nullable<string>;
|
|
203
|
+
produced_mana?: Nullable<Color[]>;
|
|
204
|
+
reserved: boolean;
|
|
205
|
+
toughness?: Nullable<string>;
|
|
206
|
+
type_line: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
type SetType = 'alchemy' | 'archenemy' | 'arsenal' | 'box' | 'commander' | 'core' | 'draft_innovation' | 'duel_deck' | 'expansion' | 'from_the_vault' | 'funny' | 'masterpiece' | 'masters' | 'memorabilia' | 'minigame' | 'planechase' | 'premium_deck' | 'promo' | 'spellbook' | 'starter' | 'token' | 'treasure_chest' | 'vanguard';
|
|
210
|
+
interface Set {
|
|
211
|
+
arena_code?: Nullable<string>;
|
|
212
|
+
block?: Nullable<string>;
|
|
213
|
+
block_code?: Nullable<string>;
|
|
214
|
+
card_count: number;
|
|
215
|
+
code: string;
|
|
216
|
+
digital: boolean;
|
|
217
|
+
foil_only: boolean;
|
|
218
|
+
icon_svg_uri: string;
|
|
219
|
+
id: string;
|
|
220
|
+
mtgo_code?: Nullable<string>;
|
|
221
|
+
name: string;
|
|
222
|
+
nonfoil_only: boolean;
|
|
223
|
+
object: 'set';
|
|
224
|
+
parent_set_code?: Nullable<string>;
|
|
225
|
+
printed_size?: Nullable<number>;
|
|
226
|
+
released_at?: Nullable<Date>;
|
|
227
|
+
scryfall_uri: string;
|
|
228
|
+
search_uri: string;
|
|
229
|
+
set_type: SetType;
|
|
230
|
+
tcgplayer_id?: Nullable<number>;
|
|
231
|
+
uri: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
declare class SetApi {
|
|
235
|
+
all(): Promise<Set[]>;
|
|
236
|
+
byCode(code: string): Promise<Set | undefined>;
|
|
237
|
+
byId(id: string): Promise<Set | undefined>;
|
|
238
|
+
byTcgPlayerId(id: number): Promise<Set | undefined>;
|
|
239
|
+
}
|
|
240
|
+
declare const set: SetApi;
|
|
241
|
+
|
|
242
|
+
type BorderColor = 'black' | 'borderless' | 'gold' | 'silver' | 'white';
|
|
243
|
+
type Finish = 'etched' | 'foil' | 'nonfoil';
|
|
244
|
+
type Frame = '1993' | '1997' | '2003' | '2015' | 'future';
|
|
245
|
+
type FrameEffect = 'colorshifted' | 'companion' | 'compasslanddfc' | 'convertdfc' | 'devoid' | 'draft' | 'etched' | 'extendedart' | 'fandfc' | 'inverted' | 'legendary' | 'lesson' | 'miracle' | 'mooneldrazidfc' | 'nyxtouched' | 'originpwdfc' | 'shatteredglass' | 'showcase' | 'snow' | 'sunmoondfc' | 'tombstone' | 'upsidedowndfc' | 'waxingandwaningmoondfc';
|
|
246
|
+
type Game = 'arena' | 'mtgo' | 'paper';
|
|
247
|
+
type ImageStatus = 'highres_scan' | 'lowres' | 'missing' | 'placeholder';
|
|
248
|
+
interface Preview {
|
|
249
|
+
previewed_at: Date;
|
|
250
|
+
source: string;
|
|
251
|
+
source_uri: string;
|
|
252
|
+
}
|
|
253
|
+
interface Prices {
|
|
254
|
+
eur?: Nullable<string>;
|
|
255
|
+
eur_foil?: Nullable<string>;
|
|
256
|
+
tix?: Nullable<string>;
|
|
257
|
+
usd?: Nullable<string>;
|
|
258
|
+
usd_etched?: Nullable<string>;
|
|
259
|
+
usd_foil?: Nullable<string>;
|
|
260
|
+
}
|
|
261
|
+
type PromoType = 'arenaleague' | 'buyabox' | 'convention' | 'datestamped' | 'draftweekend' | 'duels' | 'event' | 'fnm' | 'gameday' | 'gateway' | 'giftbox' | 'instore' | 'intropack' | 'judgegift' | 'league' | 'openhouse' | 'ourney' | 'planeswalkerdeck' | 'playerrewards' | 'premiereshop' | 'prerelease' | 'release' | 'setpromo' | 'starterdeck' | 'wizardsplaynetwork';
|
|
262
|
+
interface PurchaseUris {
|
|
263
|
+
[key: string]: Nullable<string>;
|
|
264
|
+
cardhoarder?: Nullable<string>;
|
|
265
|
+
cardmarket?: Nullable<string>;
|
|
266
|
+
tcgplayer?: Nullable<string>;
|
|
267
|
+
}
|
|
268
|
+
type Rarity = 'bonus' | 'common' | 'mythic' | 'rare' | 'special' | 'uncommon';
|
|
269
|
+
interface RelatedUris {
|
|
270
|
+
[key: string]: Nullable<string>;
|
|
271
|
+
edhrec?: Nullable<string>;
|
|
272
|
+
gatherer?: Nullable<string>;
|
|
273
|
+
mtgtop8?: Nullable<string>;
|
|
274
|
+
tcgplayer_decks?: Nullable<string>;
|
|
275
|
+
tcgplayer_infinite_articles?: Nullable<string>;
|
|
276
|
+
tcgplayer_infinite_decks?: Nullable<string>;
|
|
277
|
+
}
|
|
278
|
+
type SecurityStamp = 'acorn' | 'arena' | 'circle' | 'heart' | 'oval' | 'triangle';
|
|
279
|
+
interface CardPrint {
|
|
280
|
+
artist?: Nullable<string>;
|
|
281
|
+
artist_ids?: Nullable<string[]>;
|
|
282
|
+
attraction_lights?: Nullable<number[]>;
|
|
283
|
+
booster: boolean;
|
|
284
|
+
border_color: BorderColor;
|
|
285
|
+
card_back_id: string;
|
|
286
|
+
collector_number: string;
|
|
287
|
+
content_warning?: Nullable<boolean>;
|
|
288
|
+
digital: boolean;
|
|
289
|
+
finishes: Finish[];
|
|
290
|
+
flavor_name?: Nullable<string>;
|
|
291
|
+
flavor_text?: Nullable<string>;
|
|
292
|
+
frame: Frame;
|
|
293
|
+
frame_effects?: Nullable<FrameEffect[]>;
|
|
294
|
+
full_art: boolean;
|
|
295
|
+
games: Game[];
|
|
296
|
+
highres_image: boolean;
|
|
297
|
+
illustration_id?: Nullable<string>;
|
|
298
|
+
image_status: ImageStatus;
|
|
299
|
+
image_uris?: Nullable<ImageUris>;
|
|
300
|
+
oversized: boolean;
|
|
301
|
+
preview: Preview;
|
|
302
|
+
prices: Prices;
|
|
303
|
+
printed_name?: Nullable<string>;
|
|
304
|
+
printed_text?: Nullable<string>;
|
|
305
|
+
printed_type_line?: Nullable<string>;
|
|
306
|
+
promo: boolean;
|
|
307
|
+
promo_types?: Nullable<PromoType[]>;
|
|
308
|
+
purchase_uris?: Nullable<PurchaseUris>;
|
|
309
|
+
rarity: Rarity;
|
|
310
|
+
related_uris: RelatedUris;
|
|
311
|
+
released_at: Date;
|
|
312
|
+
reprint: boolean;
|
|
313
|
+
scryfall_set_uri: string;
|
|
314
|
+
security_stamp?: Nullable<SecurityStamp>;
|
|
315
|
+
set: string;
|
|
316
|
+
set_id: string;
|
|
317
|
+
set_name: string;
|
|
318
|
+
set_search_uri: string;
|
|
319
|
+
set_type: SetType;
|
|
320
|
+
set_uri: string;
|
|
321
|
+
story_spotlight: boolean;
|
|
322
|
+
textless: boolean;
|
|
323
|
+
variation: boolean;
|
|
324
|
+
variation_of?: Nullable<string>;
|
|
325
|
+
watermark?: Nullable<string>;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
type Card = CardCore & CardPrint & GameplayCard;
|
|
329
|
+
|
|
330
|
+
type CardSearchUnique = 'art' | 'cards' | 'prints';
|
|
331
|
+
type CardSearchOrder = 'artist' | 'cmc' | 'color' | 'edhrec' | 'eur' | 'name' | 'penny' | 'power' | 'rarity' | 'released' | 'review' | 'set' | 'tix' | 'toughness' | 'usd';
|
|
332
|
+
type CardSearchDirection = 'asc' | 'auto' | 'desc';
|
|
333
|
+
type CardSearchFormat = 'csv' | 'json';
|
|
334
|
+
interface CardSearch {
|
|
335
|
+
dir?: CardSearchDirection;
|
|
336
|
+
format?: CardSearchFormat;
|
|
337
|
+
include_extras?: boolean;
|
|
338
|
+
include_multilingual?: boolean;
|
|
339
|
+
include_variations?: boolean;
|
|
340
|
+
order?: CardSearchOrder;
|
|
341
|
+
page?: number;
|
|
342
|
+
pretty?: boolean;
|
|
343
|
+
unique?: CardSearchUnique;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
declare class CardApi {
|
|
347
|
+
autoCompleteName(name: string): Promise<string[]>;
|
|
348
|
+
byArenaId(id: number): Promise<Card | undefined>;
|
|
349
|
+
byId(id: string): Promise<Card | undefined>;
|
|
350
|
+
byMtgoId(id: number): Promise<Card | undefined>;
|
|
351
|
+
byMultiverseId(id: number): Promise<Card | undefined>;
|
|
352
|
+
byName(name: string, fuzzy?: boolean): Promise<Card | undefined>;
|
|
353
|
+
byName(name: string, set?: string, fuzzy?: boolean): Promise<Card | undefined>;
|
|
354
|
+
bySet(setCode: string, collectorNumber: number, lang?: string): Promise<Card | undefined>;
|
|
355
|
+
byTcgPlayerId(id: number): Promise<Card | undefined>;
|
|
356
|
+
collection(...identifiers: CardIdentifier[]): Promise<Card[]>;
|
|
357
|
+
random(): Promise<Card>;
|
|
358
|
+
search(query: string, options?: CardSearch | number): MagicPageResult<Card>;
|
|
359
|
+
}
|
|
360
|
+
declare const cards: CardApi;
|
|
361
|
+
|
|
362
|
+
declare class CatalogApi {
|
|
363
|
+
artifactTypes(): Promise<string[]>;
|
|
364
|
+
artistNames(): Promise<string[]>;
|
|
365
|
+
cardNames(): Promise<string[]>;
|
|
366
|
+
creatureTypes(): Promise<string[]>;
|
|
367
|
+
enchantmentTypes(): Promise<string[]>;
|
|
368
|
+
landTypes(): Promise<string[]>;
|
|
369
|
+
loyalties(): Promise<string[]>;
|
|
370
|
+
planeswalkerTypes(): Promise<string[]>;
|
|
371
|
+
powers(): Promise<string[]>;
|
|
372
|
+
spellTypes(): Promise<string[]>;
|
|
373
|
+
toughnesses(): Promise<string[]>;
|
|
374
|
+
watermarks(): Promise<string[]>;
|
|
375
|
+
wordBank(): Promise<string[]>;
|
|
376
|
+
}
|
|
377
|
+
declare const catalog: CatalogApi;
|
|
378
|
+
|
|
379
|
+
interface Catalog {
|
|
380
|
+
data: string[];
|
|
381
|
+
object: 'catalog';
|
|
382
|
+
total_values: number;
|
|
383
|
+
uri: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
interface Ruling {
|
|
387
|
+
comment: string;
|
|
388
|
+
object: 'ruling';
|
|
389
|
+
oracle_id: string;
|
|
390
|
+
published_at: Date;
|
|
391
|
+
source: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare class RulingApi {
|
|
395
|
+
byArenaId(id: number): Promise<Ruling[]>;
|
|
396
|
+
byId(id: string): Promise<Ruling[]>;
|
|
397
|
+
byMtgoId(id: number): Promise<Ruling[]>;
|
|
398
|
+
byMultiverseId(id: number): Promise<Ruling[]>;
|
|
399
|
+
bySet(setCode: string, collectorNumber: number | string): Promise<Ruling[]>;
|
|
400
|
+
}
|
|
401
|
+
declare const rulings: RulingApi;
|
|
402
|
+
|
|
403
|
+
declare class InvalidScryfallArgumentError extends Error {
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
declare class ScryfallError extends Error {
|
|
407
|
+
readonly code: string;
|
|
408
|
+
readonly status: number;
|
|
409
|
+
readonly type?: null | string | undefined;
|
|
410
|
+
readonly warnings?: null | string[] | undefined;
|
|
411
|
+
constructor(code: string, details: string, status: number, type?: null | string | undefined, warnings?: null | string[] | undefined);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
declare class UnknownScryfallError extends Error {
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export { type BorderColor, type Card, type CardComponent, type CardFace, type CardIdentifier, CardIdentifierApi as CardIdentifierBuilder, type CardIdentifierCollectorSet, type CardIdentifierId, type CardIdentifierIllustrationId, type CardIdentifierMtgGoId, type CardIdentifierMultiverseId, type CardIdentifierNameSet, type CardIdentifierOracleId, type CardLanguage, type CardLayout, type CardSearch, type CardSearchDirection, type CardSearchFormat, type CardSearchOrder, type CardSearchUnique, cards as Cards, type Catalog, catalog as Catalogs, type Color, type Finish, type Frame, type FrameEffect, type Game, type ImageStatus, type ImageUris, InvalidScryfallArgumentError, type Legalities, type Legality, MagicPageResult, type ManaCost, type Preview, type Prices, type PromoType, type PurchaseUris, type Rarity, type RelatedCard, type RelatedUris, type Ruling, rulings as Rulings, ScryfallError, type SecurityStamp, type Set, type SetType, set as Sets, type Symbology, symbology as SymbologyApi, UnknownScryfallError };
|
package/dist/scryfall-api.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @type {T | null | undefined} The type can be T, null, or undefined.
|
|
4
4
|
* @template T The type of the value that can be null or undefined.
|
|
5
5
|
*/
|
|
6
|
-
type Nullable<T> =
|
|
6
|
+
type Nullable<T> = null | T | undefined;
|
|
7
7
|
|
|
8
8
|
type QueryValue = boolean | number | string | undefined;
|
|
9
9
|
interface PageQuery {
|
|
@@ -113,9 +113,7 @@ declare class SymbologyApi {
|
|
|
113
113
|
}
|
|
114
114
|
declare const symbology: SymbologyApi;
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
type Legality = 'banned' | 'legal' | 'not_legal' | 'restricted';
|
|
118
|
-
interface ImageUris$1 {
|
|
116
|
+
interface ImageUris {
|
|
119
117
|
art_crop: string;
|
|
120
118
|
border_crop: string;
|
|
121
119
|
large: string;
|
|
@@ -123,6 +121,9 @@ interface ImageUris$1 {
|
|
|
123
121
|
png: string;
|
|
124
122
|
small: string;
|
|
125
123
|
}
|
|
124
|
+
|
|
125
|
+
type CardComponent = 'combo_piece' | 'meld_part' | 'meld_result' | 'token';
|
|
126
|
+
type Legality = 'banned' | 'legal' | 'not_legal' | 'restricted';
|
|
126
127
|
interface CardFace {
|
|
127
128
|
artist?: Nullable<string>;
|
|
128
129
|
artist_id?: Nullable<string>;
|
|
@@ -132,7 +133,7 @@ interface CardFace {
|
|
|
132
133
|
defense?: Nullable<string>;
|
|
133
134
|
flavor_text?: Nullable<string>;
|
|
134
135
|
illustration_id?: Nullable<string>;
|
|
135
|
-
image_uris?: Nullable<ImageUris
|
|
136
|
+
image_uris?: Nullable<ImageUris>;
|
|
136
137
|
layout?: Nullable<string>;
|
|
137
138
|
loyalty?: Nullable<string>;
|
|
138
139
|
mana_cost: string;
|
|
@@ -244,14 +245,6 @@ type Frame = '1993' | '1997' | '2003' | '2015' | 'future';
|
|
|
244
245
|
type FrameEffect = 'colorshifted' | 'companion' | 'compasslanddfc' | 'convertdfc' | 'devoid' | 'draft' | 'etched' | 'extendedart' | 'fandfc' | 'inverted' | 'legendary' | 'lesson' | 'miracle' | 'mooneldrazidfc' | 'nyxtouched' | 'originpwdfc' | 'shatteredglass' | 'showcase' | 'snow' | 'sunmoondfc' | 'tombstone' | 'upsidedowndfc' | 'waxingandwaningmoondfc';
|
|
245
246
|
type Game = 'arena' | 'mtgo' | 'paper';
|
|
246
247
|
type ImageStatus = 'highres_scan' | 'lowres' | 'missing' | 'placeholder';
|
|
247
|
-
interface ImageUris {
|
|
248
|
-
art_crop: string;
|
|
249
|
-
border_crop: string;
|
|
250
|
-
large: string;
|
|
251
|
-
normal: string;
|
|
252
|
-
png: string;
|
|
253
|
-
small: string;
|
|
254
|
-
}
|
|
255
248
|
interface Preview {
|
|
256
249
|
previewed_at: Date;
|
|
257
250
|
source: string;
|
|
@@ -421,4 +414,4 @@ declare class ScryfallError extends Error {
|
|
|
421
414
|
declare class UnknownScryfallError extends Error {
|
|
422
415
|
}
|
|
423
416
|
|
|
424
|
-
export { type Card, type CardIdentifier, CardIdentifierApi as CardIdentifierBuilder, type CardIdentifierCollectorSet, type CardIdentifierId, type CardIdentifierIllustrationId, type CardIdentifierMtgGoId, type CardIdentifierMultiverseId, type CardIdentifierNameSet, type CardIdentifierOracleId, type CardSearch, type CardSearchDirection, type CardSearchFormat, type CardSearchOrder, type CardSearchUnique, cards as Cards, type Catalog, catalog as Catalogs, type Color, InvalidScryfallArgumentError, MagicPageResult, type ManaCost, type Ruling, rulings as Rulings, ScryfallError, type Set, type SetType, set as Sets, type Symbology, symbology as SymbologyApi, UnknownScryfallError };
|
|
417
|
+
export { type BorderColor, type Card, type CardComponent, type CardFace, type CardIdentifier, CardIdentifierApi as CardIdentifierBuilder, type CardIdentifierCollectorSet, type CardIdentifierId, type CardIdentifierIllustrationId, type CardIdentifierMtgGoId, type CardIdentifierMultiverseId, type CardIdentifierNameSet, type CardIdentifierOracleId, type CardLanguage, type CardLayout, type CardSearch, type CardSearchDirection, type CardSearchFormat, type CardSearchOrder, type CardSearchUnique, cards as Cards, type Catalog, catalog as Catalogs, type Color, type Finish, type Frame, type FrameEffect, type Game, type ImageStatus, type ImageUris, InvalidScryfallArgumentError, type Legalities, type Legality, MagicPageResult, type ManaCost, type Preview, type Prices, type PromoType, type PurchaseUris, type Rarity, type RelatedCard, type RelatedUris, type Ruling, rulings as Rulings, ScryfallError, type SecurityStamp, type Set, type SetType, set as Sets, type Symbology, symbology as SymbologyApi, UnknownScryfallError };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scryfall-api",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "A Javascript library for https://scryfall.com/docs/api written in Typescript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"magic",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/MarioMH8/scryfall-api"
|
|
20
|
+
"url": "git+https://github.com/MarioMH8/scryfall-api.git"
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/MarioMH8/scryfall-api",
|
|
23
23
|
"bugs": {
|
|
@@ -33,9 +33,14 @@
|
|
|
33
33
|
"types": "./dist/scryfall-api.d.ts",
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/scryfall-api.d.ts",
|
|
38
|
+
"default": "./dist/scryfall-api.js"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./dist/scryfall-api.d.cts",
|
|
42
|
+
"default": "./dist/scryfall-api.cjs"
|
|
43
|
+
},
|
|
39
44
|
"default": "./dist/scryfall-api.js"
|
|
40
45
|
}
|
|
41
46
|
},
|
|
@@ -48,12 +53,12 @@
|
|
|
48
53
|
"typecheck": "tsc --noEmit"
|
|
49
54
|
},
|
|
50
55
|
"devDependencies": {
|
|
51
|
-
"@changesets/cli": "2.27.
|
|
52
|
-
"@hexadrop/eslint-config": "0.0.
|
|
56
|
+
"@changesets/cli": "2.27.12",
|
|
57
|
+
"@hexadrop/eslint-config": "0.0.2",
|
|
53
58
|
"@hexadrop/tsconfig": "0.0.5",
|
|
54
|
-
"@types/bun": "1.1
|
|
55
|
-
"eslint": "9.
|
|
56
|
-
"tsup": "8.
|
|
57
|
-
"typescript": "5.
|
|
59
|
+
"@types/bun": "1.2.1",
|
|
60
|
+
"eslint": "9.19.0",
|
|
61
|
+
"tsup": "8.3.6",
|
|
62
|
+
"typescript": "5.7.3"
|
|
58
63
|
}
|
|
59
64
|
}
|