satori 0.1.2 → 0.2.1

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/dist/index.d.ts CHANGED
@@ -24,15 +24,116 @@ declare type Locale = keyof typeof code;
24
24
  */
25
25
 
26
26
  declare type Weight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
27
- declare type Style = 'normal' | 'italic';
27
+ declare type Style$1 = 'normal' | 'italic';
28
28
  interface FontOptions {
29
29
  data: Buffer | ArrayBuffer;
30
30
  name: string;
31
31
  weight?: Weight;
32
- style?: Style;
32
+ style?: Style$1;
33
33
  lang?: string;
34
34
  }
35
35
 
36
+ declare type Style = {
37
+ [key: string]: string[] | string | number | boolean | Style;
38
+ };
39
+ declare type NotImplemented = (...args: any) => unknown;
40
+ declare type AddedUtilities = Record<string, Style | string>;
41
+ declare type PluginFunction = (obj: {
42
+ addUtilities(utilities: AddedUtilities): unknown;
43
+ /**
44
+ * @deprecated not supported in @jaredh159/twrn
45
+ */
46
+ addComponents: NotImplemented;
47
+ /**
48
+ * @deprecated not supported in @jaredh159/twrn
49
+ */
50
+ addBase: NotImplemented;
51
+ /**
52
+ * @deprecated not supported in @jaredh159/twrn
53
+ */
54
+ addVariant: NotImplemented;
55
+ /**
56
+ * @deprecated not supported in @jaredh159/twrn
57
+ */
58
+ e: NotImplemented;
59
+ /**
60
+ * @deprecated not supported in @jaredh159/twrn
61
+ */
62
+ prefix: NotImplemented;
63
+ /**
64
+ * @deprecated not supported in @jaredh159/twrn
65
+ */
66
+ theme: NotImplemented;
67
+ /**
68
+ * @deprecated not supported in @jaredh159/twrn
69
+ */
70
+ variants: NotImplemented;
71
+ /**
72
+ * @deprecated not supported in @jaredh159/twrn
73
+ */
74
+ config: NotImplemented;
75
+ /**
76
+ * @deprecated not supported in @jaredh159/twrn
77
+ */
78
+ corePlugins: NotImplemented;
79
+ /**
80
+ * @deprecated not supported in @jaredh159/twrn
81
+ */
82
+ matchUtilities: NotImplemented;
83
+ /**
84
+ * @deprecated not supported in @jaredh159/twrn
85
+ */
86
+ postcss: unknown;
87
+ }) => unknown;
88
+
89
+ declare type TwFontSize = string | [string, string] | [string, {
90
+ lineHeight?: string;
91
+ letterSpacing?: string;
92
+ }];
93
+ declare type TwScreen = string | {
94
+ max?: string;
95
+ min?: string;
96
+ };
97
+ declare type TwColors<K extends keyof any = string, V = string> = {
98
+ [key: string]: V | TwColors<K, V>;
99
+ };
100
+ interface TwTheme {
101
+ fontSize?: Record<string, TwFontSize>;
102
+ lineHeight?: Record<string, string>;
103
+ spacing?: Record<string, string>;
104
+ padding?: Record<string, string>;
105
+ margin?: Record<string, string>;
106
+ inset?: Record<string, string>;
107
+ height?: Record<string, string>;
108
+ width?: Record<string, string>;
109
+ maxWidth?: Record<string, string>;
110
+ maxHeight?: Record<string, string>;
111
+ minWidth?: Record<string, string>;
112
+ minHeight?: Record<string, string>;
113
+ letterSpacing?: Record<string, string>;
114
+ borderWidth?: Record<string, string>;
115
+ borderRadius?: Record<string, string>;
116
+ screens?: Record<string, TwScreen>;
117
+ opacity?: Record<string, number | string>;
118
+ flex?: Record<string, string>;
119
+ flexGrow?: Record<string, number | string>;
120
+ flexShrink?: Record<string, number | string>;
121
+ fontWeight?: Record<string, number | string>;
122
+ fontFamily?: Record<string, string | string[]>;
123
+ zIndex?: Record<string, number | string>;
124
+ colors?: TwColors;
125
+ backgroundColor?: TwColors;
126
+ borderColor?: TwColors;
127
+ textColor?: TwColors;
128
+ extend?: Omit<TwTheme, 'extend'>;
129
+ }
130
+ interface TwConfig {
131
+ theme?: TwTheme;
132
+ plugins?: Array<{
133
+ handler: PluginFunction;
134
+ }>;
135
+ }
136
+
36
137
  declare let Yoga: typeof yoga_layout;
37
138
  declare function init(yoga: typeof Yoga): void;
38
139
 
@@ -49,8 +150,9 @@ declare type SatoriOptions = ({
49
150
  debug?: boolean;
50
151
  graphemeImages?: Record<string, string>;
51
152
  loadAdditionalAsset?: (languageCode: string, segment: string) => Promise<FontOptions | string | undefined>;
153
+ tailwindConfig?: TwConfig;
52
154
  };
53
155
 
54
156
  declare function satori(element: ReactNode, options: SatoriOptions): Promise<string>;
55
157
 
56
- export { FontOptions as Font, Style as FontStyle, Weight as FontWeight, Locale, SatoriOptions, satori as default, init };
158
+ export { FontOptions as Font, Style$1 as FontStyle, Weight as FontWeight, Locale, SatoriOptions, satori as default, init };