@wippy-fe/types-global-proxy 0.0.12 → 0.0.14

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.
Files changed (2) hide show
  1. package/index.d.ts +42 -14
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -402,7 +402,7 @@ interface WsMessage_Upload extends WsMessageBase {
402
402
  }
403
403
  type WsMessage = WsMessage_Welcome | WsMessage_Pages | WsMessage_Page | WsMessage_SessionMessage | WsMessage_Session | WsMessage_SessionClosed | WsMessage_Error | WsMessage_Artifact | WsMessage_SessionOpen | WsMessage_Action | WsMessage_Registry | WsMessage_RegistryEntry | WsMessage_Upload;
404
404
 
405
- type KnownTopics = '@history' | '@visibility' | '@message';
405
+ type KnownTopics = '@history' | '@visibility' | '@message' | '@state-error';
406
406
  type Events = {
407
407
  /** Emitted when pages are updated */
408
408
  '@history': (data: {
@@ -410,11 +410,27 @@ type Events = {
410
410
  }) => void;
411
411
  '@visibility': (visible: boolean) => void;
412
412
  '@message': (data: WsMessage) => void;
413
+ '@state-error': (data: {
414
+ error: string;
415
+ key?: string;
416
+ }) => void;
413
417
  } & {
414
418
  [K in string as K extends KnownTopics ? never : K]: (data: WsMessage) => void;
415
419
  };
416
420
  declare function createEvents(): <T extends string>(topicPattern: T, callback: T extends KnownTopics ? Events[T] : Events["@message"]) => nanoevents.Unsubscribe;
417
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
+ }
426
+ interface StateApi {
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>>;
432
+ }
433
+
418
434
  var session = {
419
435
  type: "non-persistent"
420
436
  };
@@ -632,6 +648,22 @@ interface AppFeatures extends I18NFeatureTypes {
632
648
  };
633
649
  };
634
650
  apiRoutes?: ApiRoutesOverride;
651
+ /**
652
+ * Additional HTML tags to whitelist in the sanitizer.
653
+ * Map of tag name to allowed attribute names.
654
+ * 'class' is always implicitly allowed for every tag.
655
+ */
656
+ allowAdditionalTags?: Record<string, string[]>;
657
+ /**
658
+ * LRU cache configuration for child iframe state preservation.
659
+ * @default { maxPages: 50, maxSizePerPage: 2097152 }
660
+ */
661
+ stateCache?: {
662
+ /** Maximum number of page/artifact state buckets to keep. @default 50 */
663
+ maxPages?: number;
664
+ /** Maximum JSON-serialized size per page in bytes. @default 2097152 (2 MB) */
665
+ maxSizePerPage?: number;
666
+ };
635
667
  }
636
668
  interface AppAuthConfig {
637
669
  token: string;
@@ -736,6 +768,7 @@ interface ProxyApiInstance {
736
768
  submit: (data: FormData | Record<string, unknown>) => Promise<FormResult>;
737
769
  };
738
770
  on: ReturnType<typeof createEvents>;
771
+ state: StateApi;
739
772
  loadWebComponent: (componentId: string, tagName?: string) => Promise<void>;
740
773
  }
741
774
 
@@ -783,19 +816,13 @@ declare const _default: {
783
816
  theme: {
784
817
  extend: {
785
818
  colors: {
786
- secondary: {
787
- 50: string;
788
- 100: string;
789
- 200: string;
790
- 300: string;
791
- 400: string;
792
- 500: string;
793
- 600: string;
794
- 700: string;
795
- 800: string;
796
- 900: string;
797
- 950: string;
798
- };
819
+ secondary: Record<string, string>;
820
+ danger: Record<string, string>;
821
+ success: Record<string, string>;
822
+ warn: Record<string, string>;
823
+ info: Record<string, string>;
824
+ help: Record<string, string>;
825
+ accent: Record<string, string>;
799
826
  };
800
827
  };
801
828
  };
@@ -822,6 +849,7 @@ declare global {
822
849
  host: () => Promise<ProxyApiInstance['host']>;
823
850
  iframe: () => Promise<ProxyApiInstance['iframe']>;
824
851
  on: () => Promise<ProxyApiInstance['on']>;
852
+ state: () => Promise<ProxyApiInstance['state']>;
825
853
  loadWebComponent: () => Promise<ProxyApiInstance['loadWebComponent']>;
826
854
  };
827
855
  tailwind?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wippy-fe/types-global-proxy",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Global type declarations for Wippy iframe proxy (window.getWippyApi, $W, etc.)",
5
5
  "types": "index.d.ts"
6
6
  }