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

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 +38 -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,23 @@ 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 StateApi {
423
+ get<T = unknown>(key: string): Promise<T | null>;
424
+ set(key: string, value: unknown): Promise<void>;
425
+ remove(key: string): Promise<void>;
426
+ clear(): Promise<void>;
427
+ getAll(): Promise<Record<string, unknown>>;
428
+ }
429
+
418
430
  var session = {
419
431
  type: "non-persistent"
420
432
  };
@@ -632,6 +644,22 @@ interface AppFeatures extends I18NFeatureTypes {
632
644
  };
633
645
  };
634
646
  apiRoutes?: ApiRoutesOverride;
647
+ /**
648
+ * Additional HTML tags to whitelist in the sanitizer.
649
+ * Map of tag name to allowed attribute names.
650
+ * 'class' is always implicitly allowed for every tag.
651
+ */
652
+ allowAdditionalTags?: Record<string, string[]>;
653
+ /**
654
+ * LRU cache configuration for child iframe state preservation.
655
+ * @default { maxPages: 50, maxSizePerPage: 2097152 }
656
+ */
657
+ stateCache?: {
658
+ /** Maximum number of page/artifact state buckets to keep. @default 50 */
659
+ maxPages?: number;
660
+ /** Maximum JSON-serialized size per page in bytes. @default 2097152 (2 MB) */
661
+ maxSizePerPage?: number;
662
+ };
635
663
  }
636
664
  interface AppAuthConfig {
637
665
  token: string;
@@ -736,6 +764,7 @@ interface ProxyApiInstance {
736
764
  submit: (data: FormData | Record<string, unknown>) => Promise<FormResult>;
737
765
  };
738
766
  on: ReturnType<typeof createEvents>;
767
+ state: StateApi;
739
768
  loadWebComponent: (componentId: string, tagName?: string) => Promise<void>;
740
769
  }
741
770
 
@@ -783,19 +812,13 @@ declare const _default: {
783
812
  theme: {
784
813
  extend: {
785
814
  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
- };
815
+ secondary: Record<string, string>;
816
+ danger: Record<string, string>;
817
+ success: Record<string, string>;
818
+ warn: Record<string, string>;
819
+ info: Record<string, string>;
820
+ help: Record<string, string>;
821
+ accent: Record<string, string>;
799
822
  };
800
823
  };
801
824
  };
@@ -822,6 +845,7 @@ declare global {
822
845
  host: () => Promise<ProxyApiInstance['host']>;
823
846
  iframe: () => Promise<ProxyApiInstance['iframe']>;
824
847
  on: () => Promise<ProxyApiInstance['on']>;
848
+ state: () => Promise<ProxyApiInstance['state']>;
825
849
  loadWebComponent: () => Promise<ProxyApiInstance['loadWebComponent']>;
826
850
  };
827
851
  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.13",
4
4
  "description": "Global type declarations for Wippy iframe proxy (window.getWippyApi, $W, etc.)",
5
5
  "types": "index.d.ts"
6
6
  }