loadCardDesignfunction
A design by its name, loaded when it is first asked for: "english" fetches
the English pattern (about 700 kB, 200 kB compressed) only then. "plain"
and "four-colour" are drawn here and need no loading; they give null. A
design the page registered under the name is given as it is.
Import it
import { loadCardDesign } from "@johnmorrisdotca/toranpu/card-faces";
Definition
function loadCardDesign(name: CardDesignName | string): Promise<CardDesign | null>
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The registered card design or card-back name. |
Returns
Promise<CardDesign | null>
A design by its name, loaded when it is first asked for: "english" fetches the English pattern (about 700 kB, 200 kB compressed) only then. "plain" and "four-colour" are drawn here and need no loading; they give null. A design the page registered under the name is given as it is.
Examples
import { loadCardDesign } from "@johnmorrisdotca/toranpu/card-faces";
console.log((await loadCardDesign("english"))?.name);englishWhat it prints (run when this page was built)