@divkitframework/divkit 18.0.0 → 20.0.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/README.md CHANGED
@@ -203,8 +203,13 @@ Function, optional.
203
203
 
204
204
  Callback for errors and warnings for manual processing.
205
205
 
206
- ```js
207
- function onError({error}) {
206
+ ```ts
207
+ function onError(detauls: {
208
+ error: Error & {
209
+ level: 'error' | 'warn';
210
+ additional: Record<string, unknown>;
211
+ };
212
+ }) {
208
213
  console.log(error.level, error.additional, error.message);
209
214
  }
210
215
  ```
@@ -217,10 +222,24 @@ Function, optional.
217
222
 
218
223
  Used for logging clicks (for elements with `action`) and visibility logging (for elements with `visibility_action`).
219
224
 
220
- ```js
221
- function onStat(details) {
222
- // details.type: 'click' | 'visible'
223
- // details.action: action | visibility_action
225
+ ```ts
226
+ function onStat(details: {
227
+ type: 'click' | 'visible';
228
+ action: Action | VisibilityAction;
229
+ }) {
230
+ }
231
+ ```
232
+
233
+ #### onCustomAction
234
+
235
+ `/client` and `/client-hydratable`
236
+
237
+ Function, optional.
238
+
239
+ Callback for a component with an action that contains non-standard protocols.
240
+
241
+ ```ts
242
+ function onCustomAction(action: Action): void {
224
243
  }
225
244
  ```
226
245
 
@@ -230,6 +249,20 @@ function onStat(details) {
230
249
 
231
250
  The default value is `auto`. Tweaks for mouse or touch events.
232
251
 
252
+ #### mix
253
+
254
+ String, optional.
255
+
256
+ An additional class added to the root element.
257
+
258
+ #### customization
259
+
260
+ Object, optional.
261
+
262
+ Currently supported properties:
263
+ * `galleryLeftClass` — left scroll button class on desktop
264
+ * `galleryRightClass` — right scroll button class on desktop
265
+
233
266
 
234
267
  #### theme (EXPERIMENTAL)
235
268