@bubble-labs/capacitor-widgetsbridge-plugin 7.0.1 → 7.0.3

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.
@@ -1,84 +1,103 @@
1
+ /**
2
+ * Provides access to native iOS WidgetKit APIs.
3
+ *
4
+ * @since 7.0.0
5
+ */
1
6
  export interface WidgetsBridgePlugin {
2
7
  /**
3
- * Return the value from user’s defaults database associated with the specified key
8
+ * Return the value from user’s defaults database associated with the specified key.
4
9
  *
5
- * @param {UserDefaultsOptions} options
10
+ * @param options Options including key and group.
6
11
  * @since 0.0.1
7
- * @returns {Promise<DataResults<any>>} Promise represents the value
12
+ * @returns Promise resolving with the retrieved value.
8
13
  */
9
- getItem(options: UserDefaultsOptions): Promise<DataResults<any>>;
14
+ getItem(options: UserDefaultsOptions): Promise<{
15
+ results: string;
16
+ }>;
10
17
  /**
11
- * Set the value to user’s defaults database associated with the specified key
18
+ * Set the value in the user’s defaults database for a specified key.
12
19
  *
13
- * @param {UserDefaultsOptions} options
20
+ * @param options Options including key, value, and group.
14
21
  * @since 0.0.1
15
- * @returns {Promise<DataResults<boolean>>} Promise represents the operation results
22
+ * @returns Promise resolving with operation success.
16
23
  */
17
- setItem(options: UserDefaultsOptions): Promise<DataResults<boolean>>;
24
+ setItem(options: UserDefaultsOptions): Promise<{
25
+ results: boolean;
26
+ }>;
18
27
  /**
19
- * Remove the value from user’s defaults database associated with the specified key
28
+ * Remove the value from user’s defaults database for a specified key.
20
29
  *
21
- * @param {UserDefaultsOptions} options
30
+ * @param options Options including key and group.
22
31
  * @since 0.0.1
23
- * @returns {Promise<DataResults<boolean>>} Promise represents the operation results
32
+ * @returns Promise resolving with operation success.
24
33
  */
25
- removeItem(options: UserDefaultsOptions): Promise<DataResults<boolean>>;
34
+ removeItem(options: UserDefaultsOptions): Promise<{
35
+ results: boolean;
36
+ }>;
26
37
  /**
27
- * Reloads the timelines for all configured widgets belonging to the containing app
38
+ * Reload all configured widget timelines.
28
39
  *
29
40
  * @since 0.0.1
30
- * @returns {Promise<DataResults<boolean>>} Promise represents the operation results
41
+ * @returns Promise resolving with operation success.
31
42
  */
32
- reloadAllTimelines(): Promise<DataResults<boolean>>;
43
+ reloadAllTimelines(): Promise<{
44
+ results: boolean;
45
+ }>;
33
46
  /**
34
- * Reloads the timelines for all widgets of a particular kind
47
+ * Reload widget timelines for a specific kind.
35
48
  *
36
- * @param {TimelinesOptions} options
49
+ * @param options Widget kind identifier.
37
50
  * @since 0.0.1
38
- * @returns {Promise<DataResults<boolean>>} Promise represents the operation results
51
+ * @returns Promise resolving with operation success.
39
52
  */
40
- reloadTimelines(options: TimelinesOptions): Promise<DataResults<boolean>>;
53
+ reloadTimelines(options: TimelinesOptions): Promise<{
54
+ results: boolean;
55
+ }>;
41
56
  /**
42
- * Get current widget configurations
57
+ * Get current widget configurations.
43
58
  *
44
59
  * @since 0.0.1
45
- * @returns {Promise<DataResults<any>>} Promise represents the operation results
60
+ * @returns Promise resolving with configuration data.
46
61
  */
47
- getCurrentConfigurations(): Promise<DataResults<any>>;
62
+ getCurrentConfigurations(): Promise<{
63
+ results: any;
64
+ }>;
48
65
  }
66
+ /**
67
+ * Options for user defaults database operations.
68
+ *
69
+ * @since 0.0.1
70
+ */
49
71
  export interface UserDefaultsOptions {
50
72
  /**
51
- * The key whose value to retrieve from storage.
73
+ * The key whose value to retrieve, set, or remove.
52
74
  *
53
75
  * @since 0.0.1
54
76
  */
55
77
  key: string;
56
78
  /**
57
- * User defaults database name which holds and organizes key/value pairs
79
+ * The user defaults group to store/retrieve data from.
58
80
  *
59
81
  * @since 0.0.1
60
82
  */
61
83
  group: string;
62
84
  /**
63
- * The value to set in storage with the associated key
85
+ * The value to set (for `setItem` only).
64
86
  *
65
87
  * @since 0.0.1
66
88
  */
67
89
  value?: string;
68
90
  }
91
+ /**
92
+ * Options for specifying the widget kind when reloading timelines.
93
+ *
94
+ * @since 0.0.1
95
+ */
69
96
  export interface TimelinesOptions {
70
97
  /**
71
- * A string that identifies the widget and matches the value you used when you created the widget’s configuration
98
+ * The widget kind identifier.
72
99
  *
73
100
  * @since 0.0.1
74
101
  */
75
102
  ofKind: string;
76
103
  }
77
- export interface DataResults<T> {
78
- /**
79
- * Holds response results from native code
80
- *
81
- * @since 0.0.1
82
- */
83
- results: T;
84
- }
@@ -1 +1,4 @@
1
- export type { WidgetsBridgePlugin } from './definitions';
1
+ import type { WidgetsBridgePlugin } from './definitions';
2
+ declare const WidgetsBridgePlugin: WidgetsBridgePlugin;
3
+ export * from './definitions';
4
+ export { WidgetsBridgePlugin };
package/dist/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { registerPlugin } from '@capacitor/core';
2
2
  const WidgetsBridgePlugin = registerPlugin('WidgetsBridgePlugin');
3
- // export { WidgetsBridgePlugin };
3
+ export * from './definitions';
4
+ export { WidgetsBridgePlugin };
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,mBAAmB,GAAG,cAAc,CAAsB,qBAAqB,CAAC,CAAC;AAGvF,kCAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,mBAAmB,GAAG,cAAc,CAAsB,qBAAqB,CAAC,CAAC;AAEvF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,7 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var core = require('@capacitor/core');
4
6
 
5
- core.registerPlugin('WidgetsBridgePlugin');
6
- // export { WidgetsBridgePlugin };
7
+ const WidgetsBridgePlugin = core.registerPlugin('WidgetsBridgePlugin');
8
+
9
+ exports.WidgetsBridgePlugin = WidgetsBridgePlugin;
7
10
  //# sourceMappingURL=plugin.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WidgetsBridgePlugin = registerPlugin('WidgetsBridgePlugin');\n// export { WidgetsBridgePlugin };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;;AAC4BA,mBAAc,CAAC,qBAAqB,EAAE;AAClE;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WidgetsBridgePlugin = registerPlugin('WidgetsBridgePlugin');\nexport * from './definitions';\nexport { WidgetsBridgePlugin };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;;;;AACK,MAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB;;;;"}
package/dist/plugin.js CHANGED
@@ -1,8 +1,13 @@
1
- (function (core) {
1
+ var capacitorWidgetsBridgePlugin = (function (exports, core) {
2
2
  'use strict';
3
3
 
4
- core.registerPlugin('WidgetsBridgePlugin');
5
- // export { WidgetsBridgePlugin };
4
+ const WidgetsBridgePlugin = core.registerPlugin('WidgetsBridgePlugin');
6
5
 
7
- }(capacitorExports));
6
+ exports.WidgetsBridgePlugin = WidgetsBridgePlugin;
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ return exports;
11
+
12
+ }({}, capacitorExports));
8
13
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WidgetsBridgePlugin = registerPlugin('WidgetsBridgePlugin');\n// export { WidgetsBridgePlugin };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;AAC4BA,oBAAc,CAAC,qBAAqB,EAAE;CAClE;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WidgetsBridgePlugin = registerPlugin('WidgetsBridgePlugin');\nexport * from './definitions';\nexport { WidgetsBridgePlugin };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;AACK,OAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bubble-labs/capacitor-widgetsbridge-plugin",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "Capacitor plugin to interact with iOS WidgetKit",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -36,7 +36,7 @@
36
36
  "eslint": "eslint . --ext ts",
37
37
  "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
38
38
  "swiftlint": "node-swiftlint",
39
- "docgen": "docgen --api WidgetsBridgePlugin --output-readme README.md --output-json dist/docs.json",
39
+ "docgen": "echo '[docgen skipped due to map() crash]'",
40
40
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
41
41
  "clean": "rimraf ./dist",
42
42
  "watch": "tsc --watch",
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@capacitor/cli": "^7.0.1",
47
47
  "@capacitor/core": "^7.0.1",
48
- "@capacitor/docgen": "^0.0.10",
48
+ "@capacitor/docgen": "^0.3.0",
49
49
  "@capacitor/ios": "^7.0.1",
50
50
  "@ionic/eslint-config": "^0.3.0",
51
51
  "@ionic/prettier-config": "^1.0.1",
package/dist/docs.json DELETED
@@ -1,378 +0,0 @@
1
- {
2
- "api": {
3
- "name": "WidgetsBridgePlugin",
4
- "slug": "widgetsbridgeplugin",
5
- "docs": "",
6
- "tags": [],
7
- "methods": [
8
- {
9
- "name": "getItem",
10
- "signature": "(options: UserDefaultsOptions) => Promise<DataResults<any>>",
11
- "parameters": [
12
- {
13
- "name": "options",
14
- "docs": "",
15
- "type": "UserDefaultsOptions"
16
- }
17
- ],
18
- "returns": "Promise<DataResults<any>>",
19
- "tags": [
20
- {
21
- "name": "param",
22
- "text": [
23
- {
24
- "text": "options",
25
- "kind": "text"
26
- }
27
- ]
28
- },
29
- {
30
- "name": "since",
31
- "text": [
32
- {
33
- "text": "0.0.1",
34
- "kind": "text"
35
- }
36
- ]
37
- },
38
- {
39
- "name": "returns",
40
- "text": [
41
- {
42
- "text": "Promise represents the value",
43
- "kind": "text"
44
- }
45
- ]
46
- }
47
- ],
48
- "docs": "Return the value from user’s defaults database associated with the specified key",
49
- "complexTypes": [
50
- "DataResults",
51
- "UserDefaultsOptions"
52
- ],
53
- "slug": "getitem"
54
- },
55
- {
56
- "name": "setItem",
57
- "signature": "(options: UserDefaultsOptions) => Promise<DataResults<boolean>>",
58
- "parameters": [
59
- {
60
- "name": "options",
61
- "docs": "",
62
- "type": "UserDefaultsOptions"
63
- }
64
- ],
65
- "returns": "Promise<DataResults<boolean>>",
66
- "tags": [
67
- {
68
- "name": "param",
69
- "text": [
70
- {
71
- "text": "options",
72
- "kind": "text"
73
- }
74
- ]
75
- },
76
- {
77
- "name": "since",
78
- "text": [
79
- {
80
- "text": "0.0.1",
81
- "kind": "text"
82
- }
83
- ]
84
- },
85
- {
86
- "name": "returns",
87
- "text": [
88
- {
89
- "text": "Promise represents the operation results",
90
- "kind": "text"
91
- }
92
- ]
93
- }
94
- ],
95
- "docs": "Set the value to user’s defaults database associated with the specified key",
96
- "complexTypes": [
97
- "DataResults",
98
- "UserDefaultsOptions"
99
- ],
100
- "slug": "setitem"
101
- },
102
- {
103
- "name": "removeItem",
104
- "signature": "(options: UserDefaultsOptions) => Promise<DataResults<boolean>>",
105
- "parameters": [
106
- {
107
- "name": "options",
108
- "docs": "",
109
- "type": "UserDefaultsOptions"
110
- }
111
- ],
112
- "returns": "Promise<DataResults<boolean>>",
113
- "tags": [
114
- {
115
- "name": "param",
116
- "text": [
117
- {
118
- "text": "options",
119
- "kind": "text"
120
- }
121
- ]
122
- },
123
- {
124
- "name": "since",
125
- "text": [
126
- {
127
- "text": "0.0.1",
128
- "kind": "text"
129
- }
130
- ]
131
- },
132
- {
133
- "name": "returns",
134
- "text": [
135
- {
136
- "text": "Promise represents the operation results",
137
- "kind": "text"
138
- }
139
- ]
140
- }
141
- ],
142
- "docs": "Remove the value from user’s defaults database associated with the specified key",
143
- "complexTypes": [
144
- "DataResults",
145
- "UserDefaultsOptions"
146
- ],
147
- "slug": "removeitem"
148
- },
149
- {
150
- "name": "reloadAllTimelines",
151
- "signature": "() => Promise<DataResults<boolean>>",
152
- "parameters": [],
153
- "returns": "Promise<DataResults<boolean>>",
154
- "tags": [
155
- {
156
- "name": "since",
157
- "text": [
158
- {
159
- "text": "0.0.1",
160
- "kind": "text"
161
- }
162
- ]
163
- },
164
- {
165
- "name": "returns",
166
- "text": [
167
- {
168
- "text": "Promise represents the operation results",
169
- "kind": "text"
170
- }
171
- ]
172
- }
173
- ],
174
- "docs": "Reloads the timelines for all configured widgets belonging to the containing app",
175
- "complexTypes": [
176
- "DataResults"
177
- ],
178
- "slug": "reloadalltimelines"
179
- },
180
- {
181
- "name": "reloadTimelines",
182
- "signature": "(options: TimelinesOptions) => Promise<DataResults<boolean>>",
183
- "parameters": [
184
- {
185
- "name": "options",
186
- "docs": "",
187
- "type": "TimelinesOptions"
188
- }
189
- ],
190
- "returns": "Promise<DataResults<boolean>>",
191
- "tags": [
192
- {
193
- "name": "param",
194
- "text": [
195
- {
196
- "text": "options",
197
- "kind": "text"
198
- }
199
- ]
200
- },
201
- {
202
- "name": "since",
203
- "text": [
204
- {
205
- "text": "0.0.1",
206
- "kind": "text"
207
- }
208
- ]
209
- },
210
- {
211
- "name": "returns",
212
- "text": [
213
- {
214
- "text": "Promise represents the operation results",
215
- "kind": "text"
216
- }
217
- ]
218
- }
219
- ],
220
- "docs": "Reloads the timelines for all widgets of a particular kind",
221
- "complexTypes": [
222
- "DataResults",
223
- "TimelinesOptions"
224
- ],
225
- "slug": "reloadtimelines"
226
- },
227
- {
228
- "name": "getCurrentConfigurations",
229
- "signature": "() => Promise<DataResults<any>>",
230
- "parameters": [],
231
- "returns": "Promise<DataResults<any>>",
232
- "tags": [
233
- {
234
- "name": "since",
235
- "text": [
236
- {
237
- "text": "0.0.1",
238
- "kind": "text"
239
- }
240
- ]
241
- },
242
- {
243
- "name": "returns",
244
- "text": [
245
- {
246
- "text": "Promise represents the operation results",
247
- "kind": "text"
248
- }
249
- ]
250
- }
251
- ],
252
- "docs": "Get current widget configurations",
253
- "complexTypes": [
254
- "DataResults"
255
- ],
256
- "slug": "getcurrentconfigurations"
257
- }
258
- ],
259
- "properties": []
260
- },
261
- "interfaces": [
262
- {
263
- "name": "DataResults",
264
- "slug": "dataresults",
265
- "docs": "",
266
- "tags": [],
267
- "methods": [],
268
- "properties": [
269
- {
270
- "name": "results",
271
- "tags": [
272
- {
273
- "text": [
274
- {
275
- "text": "0.0.1",
276
- "kind": "text"
277
- }
278
- ],
279
- "name": "since"
280
- }
281
- ],
282
- "docs": "Holds response results from native code",
283
- "complexTypes": [
284
- "T"
285
- ],
286
- "type": "T"
287
- }
288
- ]
289
- },
290
- {
291
- "name": "UserDefaultsOptions",
292
- "slug": "userdefaultsoptions",
293
- "docs": "",
294
- "tags": [],
295
- "methods": [],
296
- "properties": [
297
- {
298
- "name": "key",
299
- "tags": [
300
- {
301
- "text": [
302
- {
303
- "text": "0.0.1",
304
- "kind": "text"
305
- }
306
- ],
307
- "name": "since"
308
- }
309
- ],
310
- "docs": "The key whose value to retrieve from storage.",
311
- "complexTypes": [],
312
- "type": "string"
313
- },
314
- {
315
- "name": "group",
316
- "tags": [
317
- {
318
- "text": [
319
- {
320
- "text": "0.0.1",
321
- "kind": "text"
322
- }
323
- ],
324
- "name": "since"
325
- }
326
- ],
327
- "docs": "User defaults database name which holds and organizes key/value pairs",
328
- "complexTypes": [],
329
- "type": "string"
330
- },
331
- {
332
- "name": "value",
333
- "tags": [
334
- {
335
- "text": [
336
- {
337
- "text": "0.0.1",
338
- "kind": "text"
339
- }
340
- ],
341
- "name": "since"
342
- }
343
- ],
344
- "docs": "The value to set in storage with the associated key",
345
- "complexTypes": [],
346
- "type": "string | undefined"
347
- }
348
- ]
349
- },
350
- {
351
- "name": "TimelinesOptions",
352
- "slug": "timelinesoptions",
353
- "docs": "",
354
- "tags": [],
355
- "methods": [],
356
- "properties": [
357
- {
358
- "name": "ofKind",
359
- "tags": [
360
- {
361
- "text": [
362
- {
363
- "text": "0.0.1",
364
- "kind": "text"
365
- }
366
- ],
367
- "name": "since"
368
- }
369
- ],
370
- "docs": "A string that identifies the widget and matches the value you used when you created the widget’s configuration",
371
- "complexTypes": [],
372
- "type": "string"
373
- }
374
- ]
375
- }
376
- ],
377
- "enums": []
378
- }