satori 0.5.0 → 0.6.0

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
@@ -134,6 +134,21 @@ interface TwConfig {
134
134
  }>;
135
135
  }
136
136
 
137
+ /**
138
+ * This module is used to calculate the layout of the current sub-tree.
139
+ */
140
+
141
+ interface SatoriNode {
142
+ left: number;
143
+ top: number;
144
+ width: number;
145
+ height: number;
146
+ type: string;
147
+ key?: string | number;
148
+ props: Record<string, any>;
149
+ textContent?: string;
150
+ }
151
+
137
152
  declare function init(yoga: Yoga): void;
138
153
 
139
154
  declare type SatoriOptions = ({
@@ -150,8 +165,9 @@ declare type SatoriOptions = ({
150
165
  graphemeImages?: Record<string, string>;
151
166
  loadAdditionalAsset?: (languageCode: string, segment: string) => Promise<string | Array<FontOptions>>;
152
167
  tailwindConfig?: TwConfig;
168
+ onNodeDetected?: (node: SatoriNode) => void;
153
169
  };
154
170
 
155
171
  declare function satori(element: ReactNode, options: SatoriOptions): Promise<string>;
156
172
 
157
- export { FontOptions as Font, Style$1 as FontStyle, Weight as FontWeight, Locale, SatoriOptions, satori as default, init };
173
+ export { FontOptions as Font, Style$1 as FontStyle, Weight as FontWeight, Locale, SatoriNode, SatoriOptions, satori as default, init };