@wippy-fe/types-global-proxy 0.0.32 → 0.0.34

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 +25 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -599,6 +599,15 @@ interface SanitizeOptions {
599
599
  extraTags?: Record<string, string[]>;
600
600
  }
601
601
 
602
+ interface BridgeRequestOptions {
603
+ timeoutMs?: number;
604
+ }
605
+ interface ProxyBridgeApi {
606
+ post: (channel: string, payload?: unknown) => void;
607
+ request: <T = unknown>(channel: string, payload?: unknown, options?: BridgeRequestOptions) => Promise<T>;
608
+ on: (channel: string, handler: (payload: unknown) => unknown | Promise<unknown>) => () => void;
609
+ }
610
+
602
611
  declare namespace UploadApi {
603
612
  interface Meta {
604
613
  filename: string;
@@ -1165,6 +1174,19 @@ type Events = {
1165
1174
  };
1166
1175
  declare function createEvents(): <T extends string>(topicPattern: T, callback: T extends KnownTopics ? Events[T] : Events["@message"]) => nanoevents.Unsubscribe;
1167
1176
 
1177
+ interface HtmlInjectOptions {
1178
+ baseUrl?: string;
1179
+ resourceId?: string;
1180
+ resourceType?: AppConfig['context']['resourceType'];
1181
+ route?: string;
1182
+ isNavOwner?: boolean;
1183
+ configOverrides?: AppConfigOverrides;
1184
+ proxyConfig?: ProxyConfig;
1185
+ }
1186
+ interface ProxyHtmlApi {
1187
+ inject: (sourceHtml: string, options?: HtmlInjectOptions) => Promise<string>;
1188
+ }
1189
+
1168
1190
  /**
1169
1191
  * Link classifier — decides whether an href targets:
1170
1192
  * - `host-nav` host-level route claimed by a view page or system route
@@ -1320,6 +1342,7 @@ interface ProxyApiInstance {
1320
1342
  * host will be dropped silently by the parent.
1321
1343
  */
1322
1344
  layout: LayoutApi;
1345
+ bridge: ProxyBridgeApi;
1323
1346
  logout: () => void;
1324
1347
  };
1325
1348
  api: AxiosInstance;
@@ -1342,6 +1365,7 @@ interface ProxyApiInstance {
1342
1365
  logger: LoggerApi;
1343
1366
  state: StateApi;
1344
1367
  ws: ProxyWsApi;
1368
+ html: ProxyHtmlApi;
1345
1369
  loadWebComponent: (componentId: string, tagName?: string) => Promise<void>;
1346
1370
  /**
1347
1371
  * Resolve a registered `view.component`'s custom-element tag name to its
@@ -1430,6 +1454,7 @@ declare global {
1430
1454
  loadWebComponent: () => Promise<ProxyApiInstance['loadWebComponent']>;
1431
1455
  loadByTagName: () => Promise<ProxyApiInstance['loadByTagName']>;
1432
1456
  sanitize: () => Promise<ProxyApiInstance['sanitize']>;
1457
+ html: () => Promise<ProxyApiInstance['html']>;
1433
1458
  };
1434
1459
  tailwind?: {
1435
1460
  config: Partial<typeof _default>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wippy-fe/types-global-proxy",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "Global type declarations for Wippy iframe proxy (window.getWippyApi, $W, etc.)",
5
5
  "license": "UNLICENSED",
6
6
  "types": "index.d.ts"