@feliperohdee/satori 0.0.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.cjs +6 -0
- package/dist/index.cjs.LEGAL.txt +0 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +73 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +6 -0
- package/dist/index.js.LEGAL.txt +0 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx/index.cjs +2 -0
- package/dist/jsx/index.cjs.LEGAL.txt +0 -0
- package/dist/jsx/index.cjs.map +1 -0
- package/dist/jsx/index.d.cts +14 -0
- package/dist/jsx/index.d.ts +14 -0
- package/dist/jsx/index.js +2 -0
- package/dist/jsx/index.js.LEGAL.txt +0 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/jsx-runtime.cjs +2 -0
- package/dist/jsx/jsx-runtime.cjs.LEGAL.txt +0 -0
- package/dist/jsx/jsx-runtime.cjs.map +1 -0
- package/dist/jsx/jsx-runtime.d.cts +1 -0
- package/dist/jsx/jsx-runtime.d.ts +1 -0
- package/dist/jsx/jsx-runtime.js +2 -0
- package/dist/jsx/jsx-runtime.js.LEGAL.txt +0 -0
- package/dist/jsx/jsx-runtime.js.map +1 -0
- package/dist/jsx-runtime-C4tBh6k7.d.ts +1305 -0
- package/dist/jsx-runtime-d92ed26c.d.ts +1305 -0
- package/dist/standalone.cjs +6 -0
- package/dist/standalone.cjs.LEGAL.txt +0 -0
- package/dist/standalone.cjs.map +1 -0
- package/dist/standalone.d.cts +73 -0
- package/dist/standalone.d.ts +73 -0
- package/dist/standalone.js +6 -0
- package/dist/standalone.js.LEGAL.txt +0 -0
- package/dist/standalone.js.map +1 -0
- package/package.json +98 -0
- package/yoga.wasm +0 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
type InitInput = string | Request | URL | Response | BufferSource | Buffer | WebAssembly.Module | Promise<Response | BufferSource | Buffer | WebAssembly.Module>;
|
|
36
|
+
|
|
37
|
+
declare function init(input: InitInput): Promise<void>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This module is used to calculate the layout of the current sub-tree.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
interface SatoriNode {
|
|
44
|
+
left: number;
|
|
45
|
+
top: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
type: string;
|
|
49
|
+
key?: string | number;
|
|
50
|
+
props: Record<string, any>;
|
|
51
|
+
textContent?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type SatoriOptions = ({
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
} | {
|
|
58
|
+
width: number;
|
|
59
|
+
} | {
|
|
60
|
+
height: number;
|
|
61
|
+
}) & {
|
|
62
|
+
fonts: FontOptions[];
|
|
63
|
+
embedFont?: boolean;
|
|
64
|
+
debug?: boolean;
|
|
65
|
+
graphemeImages?: Record<string, string>;
|
|
66
|
+
loadAdditionalAsset?: (languageCode: string, segment: string) => Promise<string | Array<FontOptions>>;
|
|
67
|
+
onNodeDetected?: (node: SatoriNode) => void;
|
|
68
|
+
pointScaleFactor?: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
declare function satori(element: ReactNode, options: SatoriOptions): Promise<string>;
|
|
72
|
+
|
|
73
|
+
export { type FontOptions as Font, type FontStyle, type Weight as FontWeight, type Locale, type SatoriNode, type SatoriOptions, satori as default, init };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
type InitInput = string | Request | URL | Response | BufferSource | Buffer | WebAssembly.Module | Promise<Response | BufferSource | Buffer | WebAssembly.Module>;
|
|
36
|
+
|
|
37
|
+
declare function init(input: InitInput): Promise<void>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This module is used to calculate the layout of the current sub-tree.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
interface SatoriNode {
|
|
44
|
+
left: number;
|
|
45
|
+
top: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
type: string;
|
|
49
|
+
key?: string | number;
|
|
50
|
+
props: Record<string, any>;
|
|
51
|
+
textContent?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type SatoriOptions = ({
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
} | {
|
|
58
|
+
width: number;
|
|
59
|
+
} | {
|
|
60
|
+
height: number;
|
|
61
|
+
}) & {
|
|
62
|
+
fonts: FontOptions[];
|
|
63
|
+
embedFont?: boolean;
|
|
64
|
+
debug?: boolean;
|
|
65
|
+
graphemeImages?: Record<string, string>;
|
|
66
|
+
loadAdditionalAsset?: (languageCode: string, segment: string) => Promise<string | Array<FontOptions>>;
|
|
67
|
+
onNodeDetected?: (node: SatoriNode) => void;
|
|
68
|
+
pointScaleFactor?: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
declare function satori(element: ReactNode, options: SatoriOptions): Promise<string>;
|
|
72
|
+
|
|
73
|
+
export { type FontOptions as Font, type FontStyle, type Weight as FontWeight, type Locale, type SatoriNode, type SatoriOptions, satori as default, init };
|