@voltius/plugin-types 0.36.0 → 0.38.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/index.d.ts +30 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -320,12 +320,40 @@ export interface PluginTransfer {
|
|
|
320
320
|
owner?: string;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
+
export type SyncProviderStatus = "idle" | "syncing" | "success" | "error" | "offline";
|
|
324
|
+
|
|
325
|
+
export type SyncProviderAvailability = "active" | "not_configured" | "disabled" | "locked" | "needs_upgrade";
|
|
326
|
+
|
|
327
|
+
/** What a sync provider plugin publishes under `publishState("sync-state", …)`. */
|
|
328
|
+
export interface SyncProviderState {
|
|
329
|
+
status: SyncProviderStatus;
|
|
330
|
+
lastSync: Date | string | number | null;
|
|
331
|
+
error: string | null;
|
|
332
|
+
blobSizeBytes: number | null;
|
|
333
|
+
configured: boolean;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** What a sync provider plugin passes to `plugins.expose`. */
|
|
337
|
+
export interface SyncProviderPublicApi {
|
|
338
|
+
syncNow(): Promise<void>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface SyncProviderSummary {
|
|
342
|
+
id: string;
|
|
343
|
+
label: string;
|
|
344
|
+
availability: SyncProviderAvailability;
|
|
345
|
+
status: SyncProviderStatus;
|
|
346
|
+
lastSync: string | null;
|
|
347
|
+
error: string | null;
|
|
348
|
+
}
|
|
349
|
+
|
|
323
350
|
export interface PluginSyncState {
|
|
324
|
-
status:
|
|
351
|
+
status: SyncProviderStatus;
|
|
325
352
|
lastSync: string | null;
|
|
326
353
|
error: string | null;
|
|
327
354
|
cloudActive: boolean;
|
|
328
355
|
blobSizeBytes: number | null;
|
|
356
|
+
providers: SyncProviderSummary[];
|
|
329
357
|
}
|
|
330
358
|
|
|
331
359
|
export interface PluginHostPing {
|
|
@@ -1268,7 +1296,7 @@ export interface PluginAPI {
|
|
|
1268
1296
|
/** Publish a plain, serialisable state snapshot for host UI to read, keyed
|
|
1269
1297
|
* by `<pluginId>::<key>`. Host surfaces subscribe to this instead of
|
|
1270
1298
|
* importing the plugin's runtime module. Cleared on unload/disable. */
|
|
1271
|
-
publishState(key:
|
|
1299
|
+
publishState<K extends string>(key: K, value: K extends "sync-state" ? SyncProviderState : unknown): void;
|
|
1272
1300
|
};
|
|
1273
1301
|
|
|
1274
1302
|
// Plugin-scoped key-value storage
|