@ichicraft/widgets-widget-base 1.7.11 → 1.8.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/lib/.DS_Store CHANGED
Binary file
@@ -63,6 +63,16 @@ export interface WidgetContext {
63
63
  * Removes the custom command bar item that was added by the [registerCommandBarItem] function
64
64
  */
65
65
  unregisterCustomCommandBarItem?: () => void;
66
+ /**
67
+ * Raises an event to be handled by the Time-based Events feature of Ichicraft Boards.
68
+ * @param object The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
69
+ * @param action The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
70
+ * @param data Optionally provide extra metadata to be included with the raised event.
71
+ * widgetAlias property (from manifest) and variantTitle property will automatically be added by the widget board.
72
+ */
73
+ raiseEvent?: (object: string, action: string, data?: {
74
+ [key: string]: string;
75
+ }) => void;
66
76
  };
67
77
  /**
68
78
  * Metadata and functions in the context of a widget's definition. A widget definition is
@@ -402,6 +412,30 @@ export interface WidgetManifestConfig {
402
412
  };
403
413
  };
404
414
  };
415
+ /**
416
+ * Everything related to analytics of this widget in Ichicraft Boards
417
+ */
418
+ analytics?: {
419
+ /**
420
+ * A list of time-based events this widget can raise. All the possible events MUST be
421
+ * described in this list for the widget board to be able to pick them up.
422
+ * @ref Use WidgetContext.instance.raiseEvent(object: string, action: string, data?: { [key: string]: string }) to raise these events
423
+ */
424
+ timeBasedEvents: {
425
+ /**
426
+ * The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
427
+ */
428
+ object: string;
429
+ /**
430
+ * The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
431
+ */
432
+ action: string;
433
+ /**
434
+ * A descriptive text used in the Administration panel to describe this event
435
+ */
436
+ description: string;
437
+ }[];
438
+ };
405
439
  }
406
440
  export declare enum DebugComponentType {
407
441
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.7.11",
3
+ "version": "1.8.0",
4
4
  "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",