buzzcasting-storage 2.3.1 → 2.5.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.
@@ -40,7 +40,7 @@ export declare class BuzzcastingStorageReader {
40
40
  getSeries: (query: IQuery) => Promise<IResponse>;
41
41
  }
42
42
 
43
- declare interface Category {
43
+ export declare interface Category {
44
44
  type: string;
45
45
  data: string[];
46
46
  }
@@ -49,7 +49,7 @@ export declare const CLOUD = "cloud";
49
49
 
50
50
  export declare const CLOUD_CSS = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;";
51
51
 
52
- declare interface Current {
52
+ declare interface CloudIndicators {
53
53
  total: number;
54
54
  positive: number;
55
55
  negative: number;
@@ -59,7 +59,7 @@ declare interface Current {
59
59
  velocity: number;
60
60
  }
61
61
 
62
- declare interface Dynamics {
62
+ export declare interface Dynamics {
63
63
  engagement?: number;
64
64
  semrush_visits?: number;
65
65
  potential_reach?: number;
@@ -73,7 +73,7 @@ declare interface Dynamics {
73
73
  trending_score?: number;
74
74
  }
75
75
 
76
- declare interface Geo {
76
+ export declare interface Geo {
77
77
  latitude: number;
78
78
  longitude: number;
79
79
  zip: string;
@@ -86,7 +86,10 @@ export declare const GET_DATA = "color:black;background-color:lime;padding:0 4px
86
86
 
87
87
  export declare const HIDE_CSS = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;";
88
88
 
89
- declare interface ICloud {
89
+ /**
90
+ * Cloud
91
+ */
92
+ export declare interface ICloud {
90
93
  labels: Label[];
91
94
  current: any[];
92
95
  previous: any[];
@@ -96,13 +99,13 @@ declare interface ICloud {
96
99
  previous_total: number;
97
100
  }
98
101
 
99
- declare interface IMessages {
102
+ export declare interface IMessages {
100
103
  success?: boolean;
101
104
  message?: string;
102
105
  data?: Message[];
103
106
  }
104
107
 
105
- declare interface IMessagesData {
108
+ export declare interface IMessagesData {
106
109
  messages: IMessages;
107
110
  presentation?: string;
108
111
  slide?: string;
@@ -110,11 +113,14 @@ declare interface IMessagesData {
110
113
  query: IQuery;
111
114
  }
112
115
 
113
- declare interface Indicators {
116
+ export declare interface Indicators {
114
117
  value: number;
115
118
  }
116
119
 
117
- declare interface IQuery {
120
+ /**
121
+ * Query
122
+ */
123
+ export declare interface IQuery {
118
124
  [x: string]: any;
119
125
  topics?: string;
120
126
  dashboard?: string;
@@ -135,14 +141,20 @@ declare interface IQuery {
135
141
  hash?: string;
136
142
  }
137
143
 
138
- declare interface IResponse {
144
+ /**
145
+ * API Response
146
+ */
147
+ export declare interface IResponse {
139
148
  data: IMessagesData | ISeries | ICloud | null;
140
149
  message: string;
141
150
  success: boolean;
142
151
  query?: IQuery;
143
152
  }
144
153
 
145
- declare interface ISeries {
154
+ /**
155
+ * Series Data
156
+ */
157
+ export declare interface ISeries {
146
158
  topic: string;
147
159
  title: string;
148
160
  series: Series[];
@@ -152,12 +164,17 @@ declare interface ISeries {
152
164
  timestamp: number;
153
165
  }
154
166
 
155
- declare interface IStorageOptions {
167
+ /**
168
+ * Storage Options
169
+ */
170
+ export declare interface IStorageOptions {
156
171
  app: string;
172
+ domain?: string;
173
+ channel?: string;
174
+ presentation?: string;
175
+ slide?: string;
157
176
  version: string;
158
177
  storage: string;
159
- slide: string;
160
- presentation?: string;
161
178
  token?: string;
162
179
  bearer?: string;
163
180
  csrf?: string;
@@ -168,22 +185,22 @@ declare interface IStorageOptions {
168
185
  retention?: number;
169
186
  }
170
187
 
171
- declare interface Label {
188
+ export declare interface Label {
172
189
  label: string;
173
190
  count: number;
174
191
  info: string;
175
- current: Current;
176
- previous: Previous;
192
+ current: CloudIndicators;
193
+ previous: CloudIndicators;
177
194
  }
178
195
 
179
- declare interface Medium {
196
+ export declare interface Medium {
180
197
  type: string;
181
198
  url: string;
182
199
  width: number;
183
200
  height: number;
184
201
  }
185
202
 
186
- declare interface Message {
203
+ export declare interface Message {
187
204
  id: string;
188
205
  published: string;
189
206
  harvested: string;
@@ -211,7 +228,7 @@ export declare const MESSAGES = "messages";
211
228
 
212
229
  export declare const MESSAGES_CSS = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;";
213
230
 
214
- declare interface Metrics {
231
+ export declare interface Metrics {
215
232
  doc: number;
216
233
  previous: number;
217
234
  change: number;
@@ -223,17 +240,10 @@ export declare const NONE = "color:transparent;background-color:transparent;";
223
240
 
224
241
  export declare const PRESENTATION_CSS = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;";
225
242
 
226
- declare interface Previous {
227
- total: number;
228
- positive: number;
229
- negative: number;
230
- neutral: number;
231
- engagement: number;
232
- reach: number;
233
- velocity: number;
234
- }
235
-
236
- declare interface Sender {
243
+ /**
244
+ * Messages
245
+ */
246
+ export declare interface Sender {
237
247
  id: string;
238
248
  title: string;
239
249
  name: string;
@@ -251,7 +261,7 @@ declare interface Sender {
251
261
 
252
262
  export declare const SERIES = "series";
253
263
 
254
- declare interface Series {
264
+ export declare interface Series {
255
265
  name: string;
256
266
  label: string;
257
267
  current: number[];
@@ -282,7 +292,7 @@ export declare const SUBSCRIBE = "subscribe";
282
292
 
283
293
  export declare const SUBSCRIBE_CSS = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;";
284
294
 
285
- declare interface Topic {
295
+ export declare interface Topic {
286
296
  topic: string;
287
297
  engagement: number;
288
298
  impressions: number;
@@ -294,6 +304,33 @@ export declare const TOPICS = "topics";
294
304
 
295
305
  export declare const WIDGET = "widget";
296
306
 
307
+ export declare class Widget {
308
+ private storageReader;
309
+ private broadcastChannel;
310
+ private query;
311
+ private readonly listeners;
312
+ /**
313
+ *
314
+ * @param callbacks functions in the widget that will receive the update
315
+ * @param query
316
+ */
317
+ constructor(callbacks: Array<(arg: IResponse) => void>, query: IQuery);
318
+ addListener(cb: (arg: IResponse) => void): void;
319
+ /**
320
+ * Data received from BroadcastChannel
321
+ * @param messageEvent
322
+ */
323
+ startListener(): void;
324
+ subscribe(): void;
325
+ getCloud: () => Promise<IResponse>;
326
+ getMessages: () => Promise<IResponse>;
327
+ getSeries: () => Promise<IResponse>;
328
+ }
329
+
330
+ export declare const WIDGET_CSS = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;";
331
+
332
+ export declare function widgetParams(query: IQuery): IQuery;
333
+
297
334
  export declare const WIDGETS = "widgets";
298
335
 
299
336
  export declare const WS_CSS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;";