@wippy-fe/types-global-proxy 0.0.13 → 0.0.15
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 +13 -7
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -419,12 +419,16 @@ type Events = {
|
|
|
419
419
|
};
|
|
420
420
|
declare function createEvents(): <T extends string>(topicPattern: T, callback: T extends KnownTopics ? Events[T] : Events["@message"]) => nanoevents.Unsubscribe;
|
|
421
421
|
|
|
422
|
+
interface StateApiOptions {
|
|
423
|
+
/** Override the default page-level scope. Used by web components with persist-key or nested artifacts. */
|
|
424
|
+
scope?: string;
|
|
425
|
+
}
|
|
422
426
|
interface StateApi {
|
|
423
|
-
get<T = unknown>(key: string)
|
|
424
|
-
set(key: string, value: unknown)
|
|
425
|
-
remove(key: string)
|
|
426
|
-
clear()
|
|
427
|
-
getAll()
|
|
427
|
+
get: <T = unknown>(key: string, options?: StateApiOptions) => Promise<T | null>;
|
|
428
|
+
set: (key: string, value: unknown, options?: StateApiOptions) => Promise<void>;
|
|
429
|
+
remove: (key: string, options?: StateApiOptions) => Promise<void>;
|
|
430
|
+
clear: (options?: StateApiOptions) => Promise<void>;
|
|
431
|
+
getAll: (options?: StateApiOptions) => Promise<Record<string, unknown>>;
|
|
428
432
|
}
|
|
429
433
|
|
|
430
434
|
var session = {
|
|
@@ -841,9 +845,11 @@ declare global {
|
|
|
841
845
|
config: () => Promise<AppConfig>;
|
|
842
846
|
instance: () => Promise<ProxyApiInstance>;
|
|
843
847
|
api: () => Promise<ProxyApiInstance['api']>;
|
|
844
|
-
|
|
848
|
+
/** @deprecated Use `$W.api` instead */
|
|
849
|
+
form: () => Promise<ProxyApiInstance['api']>;
|
|
845
850
|
host: () => Promise<ProxyApiInstance['host']>;
|
|
846
|
-
|
|
851
|
+
/** @deprecated Use `$W.host` instead */
|
|
852
|
+
iframe: () => Promise<ProxyApiInstance['host']>;
|
|
847
853
|
on: () => Promise<ProxyApiInstance['on']>;
|
|
848
854
|
state: () => Promise<ProxyApiInstance['state']>;
|
|
849
855
|
loadWebComponent: () => Promise<ProxyApiInstance['loadWebComponent']>;
|