Skip to content

Commit 1a615dd

Browse files
committed
expand documentation, readme, and exports
1 parent 6a32011 commit 1a615dd

28 files changed

Lines changed: 1612 additions & 58 deletions

File tree

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@ This library documents the definitive comprehensive typings of [the Scryfall API
44

55
This library uses [semver] for versioning. These versions only describe this library, not the Scryfall API as a whole.
66

7-
[semver]: https://semver.org/
8-
[api]: https://scryfall.com/docs/api
9-
107
## Usage
118

12-
Each object or type exported by this library corresponds to a Scryfall API object.
9+
Each type and enum exported by this library corresponds to a Scryfall API object and its values.
10+
11+
Points of interest:
1312

14-
-
13+
- [ScryfallCard](src/objects/Card/Card.ts) describes [Cards](https://scryfall.com/docs/api/cards) and their faces. Each individual card layout is managed via type narrowing on the `layout` field.
14+
- [ScryfallCatalog](src/objects/Catalog/Catalog.ts) describes [the catalogs](https://scryfall.com/docs/api/catalogs).
15+
- [ScryfallError](src/objects/Error/Error.ts) describes [error responses](https://scryfall.com/docs/api/errors).
16+
- [ScryfallList](src/objects/List/List.ts) describes [lists](https://scryfall.com/docs/api/lists), and provides shortcuts to describe the common types of lists.
17+
- [ScryfallMigration](src/objects/Migration/Migration.ts) describes [migrations](https://scryfall.com/docs/api/migrations).
18+
- [ScryfallSet](src/objects/Set/Set.ts) describes [card sets](https://scryfall.com/docs/api/sets).
1519

16-
## Details
20+
If the API provides an object, this library provides it as well. (If it doesn't, please [tell us][issues]!)
1721

18-
All exported types are prefixed with `Scryfall`, so that we can declare e.g. `ScryfallSet`, `ScryfallObject`, and `ScryfallError` without clashing with the built-in `Set`, `Object`, and `Error` types.
22+
All primary types and values are prefixed with `Scryfall` to avoid conflict with the standard library (e.g. `Object`, `Error`, `Set`) and to minimise conflict with your other libraries and dependencies (e.g. `Color`, `LanguageCode`). If we didn't have the prefix you'd be forced to append one yourself one on import, so we've defaulted to including it.
1923

20-
Enum fields are always defined in two ways: as the Enum, and as an Enum-like string. This permits you to interact with this system using our enums, just strings, or your own enums—whatever you'd prefer.
24+
Enum fields are described both in terms of an enum and a set of strings in order to give you the option of interacting with that field with either one.
25+
26+
[semver]: https://semver.org/
27+
[api]: https://scryfall.com/docs/api
28+
[issues]: https://github.com/scryfall/api-types/issues
Lines changed: 357 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,357 @@
1+
import { ScryfallCard } from "src";
2+
3+
const Undercity: ScryfallCard.DoubleFacedToken = {
4+
object: "card",
5+
id: "2c65185b-6cf0-451d-985e-56aa45d9a57d",
6+
oracle_id: "36b61021-72f0-4c22-a41d-9b2f093d7ca8",
7+
multiverse_ids: [],
8+
name: "The Initiative // Undercity",
9+
lang: "en",
10+
released_at: "2022-06-10",
11+
uri: "https://api.scryfall.com/cards/2c65185b-6cf0-451d-985e-56aa45d9a57d",
12+
scryfall_uri: "https://scryfall.com/card/tclb/20/the-initiative-undercity?utm_source=api",
13+
layout: "double_faced_token",
14+
highres_image: true,
15+
image_status: "highres_scan",
16+
cmc: 0.0,
17+
type_line: "Card // Dungeon — Undercity",
18+
color_identity: [],
19+
keywords: ["Goad", "Treasure", "Scry"],
20+
card_faces: [
21+
{
22+
object: "card_face",
23+
name: "The Initiative",
24+
mana_cost: "",
25+
type_line: "Card",
26+
oracle_text:
27+
"Whenever one or more creatures a player controls deal combat damage to you, that player takes the initiative.\nWhenever you take the initiative and at the beginning of your upkeep, venture into Undercity. (If you're in a dungeon, advance to the next room. If you're not, enter Undercity. You can take the initiative even if you already have it.)",
28+
colors: [],
29+
artist: "Ioannis Fiore",
30+
artist_id: "0af22200-d1b0-41dc-bb3f-386e661c3ad5",
31+
illustration_id: "8b197591-b8b8-47b5-9b0d-ce9d0bcb2ec0",
32+
image_uris: {
33+
small: "https://cards.scryfall.io/small/front/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
34+
normal: "https://cards.scryfall.io/normal/front/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
35+
large: "https://cards.scryfall.io/large/front/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
36+
png: "https://cards.scryfall.io/png/front/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.png?1676232820",
37+
art_crop: "https://cards.scryfall.io/art_crop/front/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
38+
border_crop:
39+
"https://cards.scryfall.io/border_crop/front/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
40+
},
41+
},
42+
{
43+
object: "card_face",
44+
name: "Undercity",
45+
flavor_name: "",
46+
mana_cost: "",
47+
type_line: "Dungeon — Undercity",
48+
oracle_text:
49+
'You can\'t enter this dungeon unless you "venture into Undercity."\nSecret Entrance — Search your library for a basic land card, reveal it, put it into your hand, then shuffle. (Leads to: Forge, Lost Well)\nForge — Put two +1/+1 counters on target creature. (Leads to: Trap!, Arena)\nLost Well — Scry 2. (Leads to: Arena, Stash)\nTrap! — Target player loses 5 life. (Leads to: Archives)\nArena — Goad target creature. (Leads to: Archives, Catacombs)\nStash — Create a Treasure token. (Leads to: Catacombs)\nArchives — Draw a card. (Leads to: Throne of the Dead Three)\nCatacombs — Create a 4/1 black Skeleton creature token with menace. (Leads to: Throne of the Dead Three)\nThrone of the Dead Three — Reveal the top ten cards of your library. Put a creature card from among them onto the battlefield with three +1/+1 counters on it. It gains hexproof until your next turn. Then shuffle.',
50+
colors: [],
51+
artist: "Ioannis Fiore",
52+
artist_id: "0af22200-d1b0-41dc-bb3f-386e661c3ad5",
53+
illustration_id: "67f7437e-458e-4b5a-8d51-5d06e93b282f",
54+
image_uris: {
55+
small: "https://cards.scryfall.io/small/back/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
56+
normal: "https://cards.scryfall.io/normal/back/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
57+
large: "https://cards.scryfall.io/large/back/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
58+
png: "https://cards.scryfall.io/png/back/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.png?1676232820",
59+
art_crop: "https://cards.scryfall.io/art_crop/back/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
60+
border_crop:
61+
"https://cards.scryfall.io/border_crop/back/2/c/2c65185b-6cf0-451d-985e-56aa45d9a57d.jpg?1676232820",
62+
},
63+
},
64+
],
65+
all_parts: [
66+
{
67+
object: "related_card",
68+
id: "0cbf06f5-d1c7-474c-8f09-72f5ad0c8120",
69+
component: "combo_piece",
70+
name: "Explore the Underdark",
71+
type_line: "Sorcery",
72+
uri: "https://api.scryfall.com/cards/0cbf06f5-d1c7-474c-8f09-72f5ad0c8120",
73+
},
74+
{
75+
object: "related_card",
76+
id: "47a6569e-ab96-4c84-8985-57769be3cc35",
77+
component: "combo_piece",
78+
name: "Ravenloft Adventurer",
79+
type_line: "Creature — Human Rogue Assassin",
80+
uri: "https://api.scryfall.com/cards/47a6569e-ab96-4c84-8985-57769be3cc35",
81+
},
82+
{
83+
object: "related_card",
84+
id: "0c4f76ae-e93b-4ca1-ac62-753707f6319e",
85+
component: "combo_piece",
86+
name: "Trailblazer's Torch",
87+
type_line: "Artifact — Equipment",
88+
uri: "https://api.scryfall.com/cards/0c4f76ae-e93b-4ca1-ac62-753707f6319e",
89+
},
90+
{
91+
object: "related_card",
92+
id: "d06d9d83-d1e6-4499-a1ac-6f865159f6b6",
93+
component: "combo_piece",
94+
name: "Stirring Bard",
95+
type_line: "Creature — Dragon Bard",
96+
uri: "https://api.scryfall.com/cards/d06d9d83-d1e6-4499-a1ac-6f865159f6b6",
97+
},
98+
{
99+
object: "related_card",
100+
id: "ab8324aa-f356-42bc-9664-46803bc8a93b",
101+
component: "combo_piece",
102+
name: "Goliath Paladin",
103+
type_line: "Creature — Giant Knight",
104+
uri: "https://api.scryfall.com/cards/ab8324aa-f356-42bc-9664-46803bc8a93b",
105+
},
106+
{
107+
object: "related_card",
108+
id: "f8ca369b-4e04-4c80-923b-1212183419d8",
109+
component: "combo_piece",
110+
name: "Undercellar Sweep",
111+
type_line: "Enchantment",
112+
uri: "https://api.scryfall.com/cards/f8ca369b-4e04-4c80-923b-1212183419d8",
113+
},
114+
{
115+
object: "related_card",
116+
id: "8aeee54a-5e16-4519-b04a-49eaaf896b9a",
117+
component: "combo_piece",
118+
name: "Passageway Seer",
119+
type_line: "Creature — Tiefling Warlock",
120+
uri: "https://api.scryfall.com/cards/8aeee54a-5e16-4519-b04a-49eaaf896b9a",
121+
},
122+
{
123+
object: "related_card",
124+
id: "d68382cd-da62-4c85-a5b3-3594a3302280",
125+
component: "combo_piece",
126+
name: "Undermountain Adventurer",
127+
type_line: "Creature — Giant Warrior",
128+
uri: "https://api.scryfall.com/cards/d68382cd-da62-4c85-a5b3-3594a3302280",
129+
},
130+
{
131+
object: "related_card",
132+
id: "2c65185b-6cf0-451d-985e-56aa45d9a57d",
133+
component: "combo_piece",
134+
name: "The Initiative // Undercity",
135+
type_line: "Card // Dungeon — Undercity",
136+
uri: "https://api.scryfall.com/cards/2c65185b-6cf0-451d-985e-56aa45d9a57d",
137+
},
138+
{
139+
object: "related_card",
140+
id: "770b988d-4f31-4746-8c23-4ed8d9a6b393",
141+
component: "token",
142+
name: "Treasure",
143+
type_line: "Token Artifact — Treasure",
144+
uri: "https://api.scryfall.com/cards/770b988d-4f31-4746-8c23-4ed8d9a6b393",
145+
},
146+
{
147+
object: "related_card",
148+
id: "6f9de8d1-03f9-491b-8871-d297a0543de9",
149+
component: "combo_piece",
150+
name: "Tomb of Horrors Adventurer",
151+
type_line: "Creature — Elf Monk",
152+
uri: "https://api.scryfall.com/cards/6f9de8d1-03f9-491b-8871-d297a0543de9",
153+
},
154+
{
155+
object: "related_card",
156+
id: "95ec8866-8374-4b17-93db-f3cf9f01fec3",
157+
component: "combo_piece",
158+
name: "White Plume Adventurer",
159+
type_line: "Creature — Orc Cleric",
160+
uri: "https://api.scryfall.com/cards/95ec8866-8374-4b17-93db-f3cf9f01fec3",
161+
},
162+
{
163+
object: "related_card",
164+
id: "c909c8d2-72c3-40b5-a74c-e78b0e8fceda",
165+
component: "combo_piece",
166+
name: "Rilsa Rael, Kingpin",
167+
type_line: "Legendary Creature — Human Rogue",
168+
uri: "https://api.scryfall.com/cards/c909c8d2-72c3-40b5-a74c-e78b0e8fceda",
169+
},
170+
{
171+
object: "related_card",
172+
id: "7fee3f76-20a8-4621-84fb-ddf79c955532",
173+
component: "combo_piece",
174+
name: "Seasoned Dungeoneer",
175+
type_line: "Creature — Human Warrior",
176+
uri: "https://api.scryfall.com/cards/7fee3f76-20a8-4621-84fb-ddf79c955532",
177+
},
178+
{
179+
object: "related_card",
180+
id: "5a470690-a05d-4311-963c-50cbf779846d",
181+
component: "combo_piece",
182+
name: "Sarevok's Tome",
183+
type_line: "Artifact",
184+
uri: "https://api.scryfall.com/cards/5a470690-a05d-4311-963c-50cbf779846d",
185+
},
186+
{
187+
object: "related_card",
188+
id: "a2bf9736-b5f5-4fd4-8406-9f57fefd86e7",
189+
component: "combo_piece",
190+
name: "Underdark Explorer",
191+
type_line: "Creature — Lizard Warrior",
192+
uri: "https://api.scryfall.com/cards/a2bf9736-b5f5-4fd4-8406-9f57fefd86e7",
193+
},
194+
{
195+
object: "related_card",
196+
id: "0669a2bb-11c7-45d8-9299-09246ff4e72c",
197+
component: "combo_piece",
198+
name: "Loot Dispute",
199+
type_line: "Enchantment",
200+
uri: "https://api.scryfall.com/cards/0669a2bb-11c7-45d8-9299-09246ff4e72c",
201+
},
202+
{
203+
object: "related_card",
204+
id: "cf4c245f-af2f-46a7-81f3-670a04940901",
205+
component: "token",
206+
name: "Skeleton",
207+
type_line: "Token Creature — Skeleton",
208+
uri: "https://api.scryfall.com/cards/cf4c245f-af2f-46a7-81f3-670a04940901",
209+
},
210+
{
211+
object: "related_card",
212+
id: "0bdf1222-2fc5-4dae-a7a5-6ba774b02843",
213+
component: "combo_piece",
214+
name: "Bloodboil Sorcerer",
215+
type_line: "Creature — Human Shaman",
216+
uri: "https://api.scryfall.com/cards/0bdf1222-2fc5-4dae-a7a5-6ba774b02843",
217+
},
218+
{
219+
object: "related_card",
220+
id: "20f939d8-3d41-4d8b-baea-7f022104c704",
221+
component: "combo_piece",
222+
name: "Vicious Battlerager",
223+
type_line: "Creature — Dwarf Barbarian",
224+
uri: "https://api.scryfall.com/cards/20f939d8-3d41-4d8b-baea-7f022104c704",
225+
},
226+
{
227+
object: "related_card",
228+
id: "2a83882c-3e03-4e85-aaac-97fa1d08a772",
229+
component: "combo_piece",
230+
name: "Aarakocra Sneak",
231+
type_line: "Creature — Bird Rogue",
232+
uri: "https://api.scryfall.com/cards/2a83882c-3e03-4e85-aaac-97fa1d08a772",
233+
},
234+
{
235+
object: "related_card",
236+
id: "aa74e656-480a-4c1b-963d-1b207075c27f",
237+
component: "combo_piece",
238+
name: "Dungeoneer's Pack",
239+
type_line: "Artifact",
240+
uri: "https://api.scryfall.com/cards/aa74e656-480a-4c1b-963d-1b207075c27f",
241+
},
242+
{
243+
object: "related_card",
244+
id: "08737950-4662-4d36-a1ea-6fd87e38c02b",
245+
component: "combo_piece",
246+
name: "From the Catacombs",
247+
type_line: "Sorcery",
248+
uri: "https://api.scryfall.com/cards/08737950-4662-4d36-a1ea-6fd87e38c02b",
249+
},
250+
{
251+
object: "related_card",
252+
id: "f4072640-0f9b-4f0a-84cc-eda415cc92e7",
253+
component: "combo_piece",
254+
name: "Avenging Hunter",
255+
type_line: "Creature — Dragon Ranger",
256+
uri: "https://api.scryfall.com/cards/f4072640-0f9b-4f0a-84cc-eda415cc92e7",
257+
},
258+
{
259+
object: "related_card",
260+
id: "e909fe36-e95c-4094-9029-a292a8fcf73a",
261+
component: "combo_piece",
262+
name: "Caves of Chaos Adventurer",
263+
type_line: "Creature — Human Barbarian",
264+
uri: "https://api.scryfall.com/cards/e909fe36-e95c-4094-9029-a292a8fcf73a",
265+
},
266+
{
267+
object: "related_card",
268+
id: "c959ab97-0727-4589-bfd9-d78dd8ebd86b",
269+
component: "combo_piece",
270+
name: "Feywild Caretaker",
271+
type_line: "Creature — Orc Wizard",
272+
uri: "https://api.scryfall.com/cards/c959ab97-0727-4589-bfd9-d78dd8ebd86b",
273+
},
274+
],
275+
legalities: {
276+
standard: "not_legal",
277+
future: "not_legal",
278+
historic: "not_legal",
279+
gladiator: "not_legal",
280+
pioneer: "not_legal",
281+
explorer: "not_legal",
282+
modern: "not_legal",
283+
legacy: "not_legal",
284+
pauper: "not_legal",
285+
vintage: "not_legal",
286+
penny: "not_legal",
287+
commander: "not_legal",
288+
oathbreaker: "not_legal",
289+
brawl: "not_legal",
290+
historicbrawl: "not_legal",
291+
alchemy: "not_legal",
292+
paupercommander: "not_legal",
293+
duel: "not_legal",
294+
oldschool: "not_legal",
295+
premodern: "not_legal",
296+
predh: "not_legal",
297+
},
298+
games: ["paper"],
299+
reserved: false,
300+
foil: true,
301+
nonfoil: true,
302+
finishes: ["nonfoil", "foil"],
303+
oversized: false,
304+
promo: false,
305+
reprint: false,
306+
variation: false,
307+
set_id: "942706db-55db-4d8b-8337-deca3a4b522c",
308+
set: "tclb",
309+
set_name: "Battle for Baldur's Gate Tokens",
310+
set_type: "token",
311+
set_uri: "https://api.scryfall.com/sets/942706db-55db-4d8b-8337-deca3a4b522c",
312+
set_search_uri: "https://api.scryfall.com/cards/search?order=set&q=e%3Atclb&unique=prints",
313+
scryfall_set_uri: "https://scryfall.com/sets/tclb?utm_source=api",
314+
rulings_uri: "https://api.scryfall.com/cards/2c65185b-6cf0-451d-985e-56aa45d9a57d/rulings",
315+
prints_search_uri:
316+
"https://api.scryfall.com/cards/search?order=released&q=oracleid%3A36b61021-72f0-4c22-a41d-9b2f093d7ca8&unique=prints",
317+
collector_number: "20",
318+
digital: false,
319+
rarity: "common",
320+
artist: "Ioannis Fiore",
321+
artist_ids: ["0af22200-d1b0-41dc-bb3f-386e661c3ad5"],
322+
border_color: "black",
323+
frame: "2015",
324+
frame_effects: ["inverted"],
325+
full_art: false,
326+
textless: false,
327+
booster: false,
328+
story_spotlight: false,
329+
preview: {
330+
source: "Wizards of the Coast",
331+
source_uri: "https://www.twitch.tv/videos/1486418408",
332+
previewed_at: "2022-05-17",
333+
},
334+
prices: {
335+
usd: null,
336+
usd_foil: null,
337+
usd_etched: null,
338+
eur: null,
339+
eur_foil: null,
340+
tix: null,
341+
},
342+
related_uris: {
343+
tcgplayer_infinite_articles:
344+
"https://infinite.tcgplayer.com/search?contentMode=article&game=magic&partner=scryfall&q=The+Initiative+%2F%2F+Undercity&utm_campaign=affiliate&utm_medium=api&utm_source=scryfall",
345+
tcgplayer_infinite_decks:
346+
"https://infinite.tcgplayer.com/search?contentMode=deck&game=magic&partner=scryfall&q=The+Initiative+%2F%2F+Undercity&utm_campaign=affiliate&utm_medium=api&utm_source=scryfall",
347+
edhrec: "https://edhrec.com/route/?cc=The+Initiative+%2F%2F+Undercity",
348+
},
349+
purchase_uris: {
350+
tcgplayer:
351+
"https://www.tcgplayer.com/search/magic/product?productLineName=magic&q=The+Initiative+%2F%2F+Undercity&utm_campaign=affiliate&utm_medium=api&utm_source=scryfall&view=grid",
352+
cardmarket:
353+
"https://www.cardmarket.com/en/Magic/Products/Search?referrer=scryfall&searchString=The+Initiative+%2F%2F+Undercity&utm_campaign=card_prices&utm_medium=text&utm_source=scryfall",
354+
cardhoarder:
355+
"https://www.cardhoarder.com/cards?affiliate_id=scryfall&data%5Bsearch%5D=The+Initiative+%2F%2F+Undercity&ref=card-profile&utm_campaign=affiliate&utm_medium=card&utm_source=scryfall",
356+
},
357+
};

0 commit comments

Comments
 (0)