satori 0.33.5 → 0.34.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/README.md +49 -0
- package/dist/canvas-afafb49b.d.ts +16 -0
- package/dist/experimental.cjs +8 -0
- package/dist/experimental.cjs.LEGAL.txt +4 -0
- package/dist/experimental.cjs.map +1 -0
- package/dist/experimental.d.cts +29 -0
- package/dist/experimental.d.ts +29 -0
- package/dist/experimental.js +8 -0
- package/dist/experimental.js.LEGAL.txt +4 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -175
- package/dist/index.d.ts +2 -175
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/jsx/index.d.cts +2 -2
- package/dist/jsx/index.d.ts +2 -2
- package/dist/jsx/jsx-runtime.d.cts +1 -1
- package/dist/jsx/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime-28d3932e.d.ts +1324 -0
- package/dist/{jsx-runtime-d92ed26c.d.ts → jsx-runtime-9a51f310.d.ts} +7 -0
- package/dist/satori-dd73c891.d.ts +175 -0
- package/dist/standalone.cjs +7 -7
- package/dist/standalone.cjs.map +1 -1
- package/dist/standalone.d.cts +1 -1
- package/dist/standalone.d.ts +1 -1
- package/dist/standalone.js +7 -7
- package/dist/standalone.js.map +1 -1
- package/package.json +12 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { a as WebGLCanvasRenderer } from './canvas-afafb49b.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @file
|
|
3
5
|
* HTML elements and CSS properties that Satori supports.
|
|
@@ -362,6 +364,11 @@ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
362
364
|
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
363
365
|
height?: number | string | undefined;
|
|
364
366
|
width?: number | string | undefined;
|
|
367
|
+
/**
|
|
368
|
+
* Experimental, Satori-specific: draws the canvas content with WebGL2. Only
|
|
369
|
+
* rendered by `satori/experimental`, with its `createWebGLContext` option.
|
|
370
|
+
*/
|
|
371
|
+
webgl?: WebGLCanvasRenderer | undefined;
|
|
365
372
|
}
|
|
366
373
|
interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
367
374
|
span?: number | undefined;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const code: {
|
|
4
|
+
readonly 'ja-JP': RegExp;
|
|
5
|
+
readonly 'ko-KR': RegExp;
|
|
6
|
+
readonly 'zh-CN': RegExp;
|
|
7
|
+
readonly 'zh-TW': RegExp;
|
|
8
|
+
readonly 'zh-HK': RegExp;
|
|
9
|
+
readonly 'th-TH': RegExp;
|
|
10
|
+
readonly 'bn-IN': RegExp;
|
|
11
|
+
readonly 'ar-AR': RegExp;
|
|
12
|
+
readonly 'ta-IN': RegExp;
|
|
13
|
+
readonly 'ml-IN': RegExp;
|
|
14
|
+
readonly 'he-IL': RegExp;
|
|
15
|
+
readonly 'te-IN': RegExp;
|
|
16
|
+
readonly devanagari: RegExp;
|
|
17
|
+
readonly kannada: RegExp;
|
|
18
|
+
};
|
|
19
|
+
type Locale = keyof typeof code;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* This class handles everything related to fonts.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
type Weight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
26
|
+
type FontStyle = 'normal' | 'italic';
|
|
27
|
+
interface FontOptions {
|
|
28
|
+
data: Buffer | ArrayBuffer;
|
|
29
|
+
name: string;
|
|
30
|
+
weight?: Weight;
|
|
31
|
+
style?: FontStyle;
|
|
32
|
+
lang?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare type Style = {
|
|
36
|
+
[key: string]: string[] | string | number | boolean | Style;
|
|
37
|
+
};
|
|
38
|
+
declare type NotImplemented = (...args: any) => unknown;
|
|
39
|
+
declare type AddedUtilities = Record<string, Style | string>;
|
|
40
|
+
declare type PluginFunction = (obj: {
|
|
41
|
+
addUtilities(utilities: AddedUtilities): unknown;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
44
|
+
*/
|
|
45
|
+
addComponents: NotImplemented;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
48
|
+
*/
|
|
49
|
+
addBase: NotImplemented;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
52
|
+
*/
|
|
53
|
+
addVariant: NotImplemented;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
56
|
+
*/
|
|
57
|
+
e: NotImplemented;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
60
|
+
*/
|
|
61
|
+
prefix: NotImplemented;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
64
|
+
*/
|
|
65
|
+
theme: NotImplemented;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
68
|
+
*/
|
|
69
|
+
variants: NotImplemented;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
72
|
+
*/
|
|
73
|
+
config: NotImplemented;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
76
|
+
*/
|
|
77
|
+
corePlugins: NotImplemented;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
80
|
+
*/
|
|
81
|
+
matchUtilities: NotImplemented;
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated not supported in @jaredh159/twrn
|
|
84
|
+
*/
|
|
85
|
+
postcss: unknown;
|
|
86
|
+
}) => unknown;
|
|
87
|
+
|
|
88
|
+
declare type TwFontSize = string | [string, string] | [string, {
|
|
89
|
+
lineHeight?: string;
|
|
90
|
+
letterSpacing?: string;
|
|
91
|
+
}];
|
|
92
|
+
declare type TwScreen = string | {
|
|
93
|
+
max?: string;
|
|
94
|
+
min?: string;
|
|
95
|
+
};
|
|
96
|
+
declare type TwColors<K extends keyof any = string, V = string> = {
|
|
97
|
+
[key: string]: V | TwColors<K, V>;
|
|
98
|
+
};
|
|
99
|
+
interface TwTheme {
|
|
100
|
+
fontSize?: Record<string, TwFontSize>;
|
|
101
|
+
lineHeight?: Record<string, string>;
|
|
102
|
+
spacing?: Record<string, string>;
|
|
103
|
+
padding?: Record<string, string>;
|
|
104
|
+
margin?: Record<string, string>;
|
|
105
|
+
inset?: Record<string, string>;
|
|
106
|
+
height?: Record<string, string>;
|
|
107
|
+
width?: Record<string, string>;
|
|
108
|
+
maxWidth?: Record<string, string>;
|
|
109
|
+
maxHeight?: Record<string, string>;
|
|
110
|
+
minWidth?: Record<string, string>;
|
|
111
|
+
minHeight?: Record<string, string>;
|
|
112
|
+
letterSpacing?: Record<string, string>;
|
|
113
|
+
borderWidth?: Record<string, string>;
|
|
114
|
+
borderRadius?: Record<string, string>;
|
|
115
|
+
screens?: Record<string, TwScreen>;
|
|
116
|
+
opacity?: Record<string, number | string>;
|
|
117
|
+
flex?: Record<string, string>;
|
|
118
|
+
flexGrow?: Record<string, number | string>;
|
|
119
|
+
flexShrink?: Record<string, number | string>;
|
|
120
|
+
fontWeight?: Record<string, number | string>;
|
|
121
|
+
fontFamily?: Record<string, string | string[]>;
|
|
122
|
+
zIndex?: Record<string, number | string>;
|
|
123
|
+
colors?: TwColors;
|
|
124
|
+
backgroundColor?: TwColors;
|
|
125
|
+
borderColor?: TwColors;
|
|
126
|
+
textColor?: TwColors;
|
|
127
|
+
extend?: Omit<TwTheme, 'extend'>;
|
|
128
|
+
}
|
|
129
|
+
interface TwConfig {
|
|
130
|
+
theme?: TwTheme;
|
|
131
|
+
plugins?: Array<{
|
|
132
|
+
handler: PluginFunction;
|
|
133
|
+
}>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
type InitInput = string | Request | URL | Response | BufferSource | Buffer | WebAssembly.Module | Promise<Response | BufferSource | Buffer | WebAssembly.Module>;
|
|
137
|
+
|
|
138
|
+
declare function init(input: InitInput): Promise<void>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* This module is used to calculate the layout of the current sub-tree.
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
interface SatoriNode {
|
|
145
|
+
left: number;
|
|
146
|
+
top: number;
|
|
147
|
+
width: number;
|
|
148
|
+
height: number;
|
|
149
|
+
type: string;
|
|
150
|
+
key?: string | number;
|
|
151
|
+
props: Record<string, any>;
|
|
152
|
+
textContent?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
type SatoriOptions = ({
|
|
156
|
+
width: number;
|
|
157
|
+
height: number;
|
|
158
|
+
} | {
|
|
159
|
+
width: number;
|
|
160
|
+
} | {
|
|
161
|
+
height: number;
|
|
162
|
+
}) & {
|
|
163
|
+
fonts: FontOptions[];
|
|
164
|
+
embedFont?: boolean;
|
|
165
|
+
debug?: boolean;
|
|
166
|
+
graphemeImages?: Record<string, string>;
|
|
167
|
+
loadAdditionalAsset?: (languageCode: string, segment: string) => Promise<string | Array<FontOptions>>;
|
|
168
|
+
tailwindConfig?: TwConfig;
|
|
169
|
+
onNodeDetected?: (node: SatoriNode) => void;
|
|
170
|
+
pointScaleFactor?: number;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
declare const satori: (element: ReactNode, options: SatoriOptions) => Promise<string>;
|
|
174
|
+
|
|
175
|
+
export { FontOptions as F, Locale as L, SatoriOptions as S, Weight as W, FontStyle as a, SatoriNode as b, init as i, satori as s };
|