@@ -145,6 +145,52 @@ export interface ListElementConfig {
145
145
markerTextStyle ?: TextStyle ;
146
146
}
147
147
148
+ /**
149
+ * Configuration for img.
150
+ *
151
+ * @public
152
+ */
153
+ export interface ImgElementConfig {
154
+ /**
155
+ * Support for relative percent-widths.
156
+ *
157
+ * @defaultValue false
158
+ */
159
+ enableExperimentalPercentWidth ?: boolean ;
160
+ /**
161
+ * Default width and height to display while image's dimensions are being retrieved.
162
+ *
163
+ * @remarks Changes to this prop will cause a react tree update. Always
164
+ * memoize it.
165
+ */
166
+ initialDimensions ?: ImageDimensions ;
167
+ }
168
+
169
+ /**
170
+ * Configuration for a.
171
+ *
172
+ * @public
173
+ */
174
+ export interface AElementConfig {
175
+ /**
176
+ * A callback to handle anchors presses.
177
+ *
178
+ * @remarks The `href` argument has been normalized, see {@link useNormalizedUrl}.
179
+ *
180
+ * @defaultValue A function using React Native `Linking.onpenUrl`.
181
+ * @param event - The {@link GestureResponderEvent} event.
182
+ * @param href - The normalized href, see {@link useNormalizedUrl}.
183
+ * @param htmlAttribs - The attributes of the underlying {@link Element}.
184
+ * @param target - The normalized `target` for this hyperlink.
185
+ */
186
+ onPress ?: (
187
+ event : GestureResponderEvent ,
188
+ href : string ,
189
+ htmlAttribs : Record < string , string > ,
190
+ target : '_blank' | '_self' | '_parent' | '_top'
191
+ ) => void ;
192
+ }
193
+
148
194
/**
149
195
* Props for custom renderers. The convention is to declare a field per tag name.
150
196
* In doing so, you can benefit from `useRendererProps('tagname')` in custom renderers.
@@ -163,40 +209,8 @@ export interface ListElementConfig {
163
209
* @public
164
210
*/
165
211
export interface RenderersProps extends Record < string , any > {
166
- a : {
167
- /**
168
- * A callback to handle anchors presses.
169
- *
170
- * @remarks The `href` argument has been normalized, see {@link useNormalizedUrl}.
171
- *
172
- * @defaultValue A function using React Native `Linking.onpenUrl`.
173
- * @param event - The {@link GestureResponderEvent} event.
174
- * @param href - The normalized href, see {@link useNormalizedUrl}.
175
- * @param htmlAttribs - The attributes of the underlying {@link Element}.
176
- * @param target - The normalized `target` for this hyperlink.
177
- */
178
- onPress ?: (
179
- event : GestureResponderEvent ,
180
- href : string ,
181
- htmlAttribs : Record < string , string > ,
182
- target : '_blank' | '_self' | '_parent' | '_top'
183
- ) => void ;
184
- } ;
185
- img : {
186
- /**
187
- * Support for relative percent-widths.
188
- *
189
- * @defaultValue false
190
- */
191
- enableExperimentalPercentWidth ?: boolean ;
192
- /**
193
- * Default width and height to display while image's dimensions are being retrieved.
194
- *
195
- * @remarks Changes to this prop will cause a react tree update. Always
196
- * memoize it.
197
- */
198
- initialDimensions ?: ImageDimensions ;
199
- } ;
212
+ a : AElementConfig ;
213
+ img : ImgElementConfig ;
200
214
ol : ListElementConfig ;
201
215
ul : ListElementConfig ;
202
216
}
0 commit comments