-
Notifications
You must be signed in to change notification settings - Fork 86
/
index.ts
44 lines (42 loc) · 1.19 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { Generator } from "./card";
import { ActivityExtension } from "./exts/activity";
import { AnimationExtension } from "./exts/animation";
import { ContestExtension } from "./exts/contest";
import { FontExtension } from "./exts/font";
import { HeatmapExtension } from "./exts/heatmap";
import { RemoteStyleExtension } from "./exts/remote-style";
import { ThemeExtension, supported } from "./exts/theme";
import { Config } from "./types";
/**
* Generate a card.
* @param config The configuration of the card
* @returns The card (svg)
*/
export async function generate(config: Partial<Config>): Promise<string> {
const generator = new Generator();
return await generator.generate({
username: "jacoblincool",
site: "us",
width: 500,
height: 200,
css: [],
extensions: [FontExtension, AnimationExtension, ThemeExtension],
animation: true,
font: "baloo_2",
theme: "light",
...config,
});
}
export default generate;
export {
ActivityExtension,
AnimationExtension,
Config,
ContestExtension,
FontExtension,
Generator,
HeatmapExtension,
RemoteStyleExtension,
ThemeExtension,
supported,
};