@wippy-fe/types-global-proxy 0.0.17 → 0.0.18

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 +88 -90
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4,21 +4,6 @@ import { ConfirmationOptions } from 'primevue/confirmationoptions';
4
4
  import { ToastMessageOptions } from 'primevue/toast';
5
5
  import * as tailwindcss_types_config from 'tailwindcss/types/config';
6
6
 
7
- var session = {
8
- type: "non-persistent"
9
- };
10
- var history = "browser";
11
- var env = {
12
- APP_API_URL: "",
13
- APP_AUTH_API_URL: "",
14
- APP_WEBSOCKET_URL: ""
15
- };
16
- var featureRS = {
17
- session: session,
18
- history: history,
19
- env: env
20
- };
21
-
22
7
  var chat = {
23
8
  emptyState: {
24
9
  title: "No chat session selected",
@@ -101,7 +86,6 @@ var textRS = {
101
86
  keeper: keeper
102
87
  };
103
88
 
104
- type I18NFeatureTypes = typeof featureRS;
105
89
  type I18NTextTypes = typeof textRS;
106
90
 
107
91
  /**
@@ -187,30 +171,50 @@ type ApiRoutesOverride = {
187
171
  };
188
172
  };
189
173
 
190
- interface AppFeatures extends I18NFeatureTypes {
191
- /**
192
- * If to remember auth details or not
193
- */
194
- session: {
195
- type: 'non-persistent' | 'cookie';
196
- };
197
- history: 'browser' | 'hash';
198
- env: {
199
- APP_API_URL: string;
200
- APP_AUTH_API_URL: string;
201
- APP_WEBSOCKET_URL: string;
202
- };
203
- axiosDefaults?: Partial<AxiosDefaults>;
204
- routePrefix?: string;
174
+ interface IconDef {
175
+ body: string;
176
+ width: number;
177
+ height: number;
178
+ }
179
+ interface CssVariablesMap {
180
+ [key: string]: string | Record<string, string> | undefined;
181
+ '@dark'?: Record<string, string>;
182
+ '@light'?: Record<string, string>;
183
+ }
184
+ interface AppAuthConfig {
185
+ token: string;
186
+ expiresAt: string;
187
+ }
188
+ interface ThemingScope {
189
+ cssVariables?: CssVariablesMap;
190
+ customCSS?: string;
191
+ /** @deprecated Use `iconSets` instead */
192
+ icons?: Record<string, IconDef>;
193
+ /** Named icon collections. Each key is an Iconify prefix. */
194
+ iconSets?: Record<string, Record<string, IconDef>>;
195
+ }
196
+ interface HostThemingScope extends ThemingScope {
197
+ i18n?: Partial<I18NTextTypes>;
198
+ }
199
+ interface ChildrenThemingScope {
200
+ cssVariables?: CssVariablesMap;
201
+ customCSS?: string;
202
+ }
203
+ interface AppCustomization {
204
+ customCSS?: string;
205
+ cssVariables?: CssVariablesMap;
206
+ i18n?: Partial<I18NTextTypes>;
207
+ /** @deprecated Use `iconSets` instead. Icons registered under the 'custom' prefix. */
208
+ icons?: Record<string, IconDef>;
209
+ /** Named icon collections. Each key is an Iconify prefix, value is a map of icon name → definition. */
210
+ iconSets?: Record<string, Record<string, IconDef>>;
211
+ }
212
+ interface HostConfig {
205
213
  showAdmin?: boolean;
206
214
  allowSelectModel?: boolean;
207
215
  startNavOpen?: boolean;
208
216
  hideNavBar?: boolean;
209
217
  disableRightPanel?: boolean;
210
- /**
211
- * Hide the session selector dropdown in chat views
212
- * @default false
213
- */
214
218
  hideSessionSelector?: boolean;
215
219
  additionalNavItems?: Array<PageApi.Page>;
216
220
  chat?: {
@@ -221,67 +225,61 @@ interface AppFeatures extends I18NFeatureTypes {
221
225
  };
222
226
  };
223
227
  apiRoutes?: ApiRoutesOverride;
224
- /**
225
- * Additional HTML tags to whitelist in the sanitizer.
226
- * Map of tag name to allowed attribute names.
227
- * 'class' is always implicitly allowed for every tag.
228
- */
229
- allowAdditionalTags?: Record<string, string[]>;
230
- /**
231
- * LRU cache configuration for child iframe state preservation.
232
- * @default { maxPages: 50, maxSizePerPage: 2097152 }
233
- */
234
228
  stateCache?: {
235
- /** Maximum number of page/artifact state buckets to keep. @default 50 */
236
229
  maxPages?: number;
237
- /** Maximum JSON-serialized size per page in bytes. @default 2097152 (2 MB) */
238
230
  maxSizePerPage?: number;
239
231
  };
232
+ allowAdditionalTags?: Record<string, string[]>;
233
+ session?: {
234
+ type: 'non-persistent' | 'cookie';
235
+ };
236
+ history?: 'browser' | 'hash';
240
237
  }
241
- interface AppAuthConfig {
242
- token: string;
243
- expiresAt: string;
244
- }
245
- interface CssVariablesMap {
246
- [key: string]: string | Record<string, string> | undefined;
247
- '@dark'?: Record<string, string>;
248
- '@light'?: Record<string, string>;
238
+ interface AppContext {
239
+ resourceId: string;
240
+ resourceType: 'page' | 'artifact';
241
+ route?: string;
242
+ parentResourceId?: string;
243
+ nestingDepth?: number;
244
+ layoutPanelId?: string;
245
+ layoutId?: string;
246
+ extensions?: Record<string, unknown>;
249
247
  }
250
- interface AppCustomization {
251
- customCSS?: string;
252
- cssVariables?: CssVariablesMap;
253
- i18n?: Partial<I18NTextTypes>;
254
- icons?: Record<string, {
255
- body: string;
256
- width: number;
257
- height: number;
258
- }>;
259
- }
260
- type DeepPartial<T> = T extends object ? {
261
- [P in keyof T]?: DeepPartial<T[P]>;
262
- } : T;
263
- interface AppConfigOverrides {
264
- customization?: Partial<AppCustomization>;
265
- feature?: DeepPartial<AppFeatures>;
248
+ interface AppEnv {
249
+ APP_API_URL: string;
250
+ APP_AUTH_API_URL: string;
251
+ APP_WEBSOCKET_URL: string;
266
252
  }
267
253
  interface AppConfig {
268
- artifactId?: string;
269
- /**
270
- * Starting app or artifact/page path
271
- */
272
- path?: string;
273
- /**
274
- * App features like history mode, session type, etc.
275
- */
276
- feature?: AppFeatures;
277
- /**
278
- * Auth configuration
279
- */
254
+ $schema: string;
280
255
  auth: AppAuthConfig;
281
- /**
282
- * App customization like i18n texts, css variables, custom css, etc.
283
- */
284
- customization?: AppCustomization;
256
+ env: AppEnv;
257
+ axiosDefaults?: Partial<AxiosDefaults>;
258
+ routePrefix?: string;
259
+ theming: {
260
+ global?: ThemingScope;
261
+ host?: HostThemingScope;
262
+ children?: ChildrenThemingScope;
263
+ };
264
+ hostConfig: HostConfig;
265
+ context: AppContext;
266
+ }
267
+ interface ChildAppConfig {
268
+ $schema: string;
269
+ auth: AppAuthConfig;
270
+ env: AppEnv;
271
+ axiosDefaults?: Partial<AxiosDefaults>;
272
+ routePrefix?: string;
273
+ apiRoutes?: ApiRoutesOverride;
274
+ customization: AppCustomization;
275
+ context: AppContext;
276
+ configOverrides?: AppConfigOverrides;
277
+ }
278
+ interface AppConfigOverrides {
279
+ customization?: Partial<AppCustomization>;
280
+ axiosDefaults?: Partial<AxiosDefaults>;
281
+ routePrefix?: string;
282
+ apiRoutes?: ApiRoutesOverride;
285
283
  }
286
284
 
287
285
  declare namespace PageApi {
@@ -796,7 +794,7 @@ interface FormResult {
796
794
  }
797
795
  type LimitedConfirmationOptions = Omit<ConfirmationOptions, 'target' | 'appendTo' | 'onShow' | 'onHide'>;
798
796
  interface ProxyApiInstance {
799
- config: AppConfig;
797
+ config: ChildAppConfig;
800
798
  /** @deprecated, use `host` instead */
801
799
  iframe: {
802
800
  toast: (message: ToastMessageOptions) => void;
@@ -876,7 +874,7 @@ declare const GLOBAL_API_PROVIDER: "__WIPPY_APP_API__";
876
874
  declare const GLOBAL_WEB_COMPONENT_CACHE: "__WIPPY_WEB_COMPONENT_CACHE__";
877
875
  declare global {
878
876
  interface Window {
879
- [GLOBAL_CONFIG_VAR]: AppConfig;
877
+ [GLOBAL_CONFIG_VAR]: AppConfig | ChildAppConfig;
880
878
  [GLOBAL_API_PROVIDER]: ProxyApiInstance;
881
879
  [GLOBAL_PROXY_CONFIG_VAR]?: ProxyConfig;
882
880
  [GLOBAL_CONFIG_OVERRIDES_VAR]?: AppConfigOverrides;
@@ -923,7 +921,7 @@ declare global {
923
921
  */
924
922
  initWippyApi: () => Promise<ProxyApiInstance>;
925
923
  $W: {
926
- config: () => Promise<AppConfig>;
924
+ config: () => Promise<ChildAppConfig>;
927
925
  instance: () => Promise<ProxyApiInstance>;
928
926
  api: () => Promise<ProxyApiInstance['api']>;
929
927
  /** @deprecated Use `$W.api` instead */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wippy-fe/types-global-proxy",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Global type declarations for Wippy iframe proxy (window.getWippyApi, $W, etc.)",
5
5
  "license": "UNLICENSED",
6
6
  "types": "index.d.ts"