@telia-ace/widget-core-flamingo 1.1.70-rc.9 → 1.1.70
Sign up to get free protection for your applications and to get access to all the features.
- package/components/trigger.component.d.ts +7 -0
- package/index.d.ts +1 -1
- package/index.js +45 -33
- package/index.mjs +564 -435
- package/models/application.d.ts +2 -0
- package/models/environment.d.ts +12 -0
- package/models/site.d.ts +3 -1
- package/package.json +1 -1
- package/services/site-api.d.ts +6 -0
- package/services/storage.service.d.ts +12 -3
- package/services/widget-api.d.ts +10 -0
package/models/application.d.ts
CHANGED
@@ -4,6 +4,7 @@ import { Wrapper } from '../components/wrapper.component';
|
|
4
4
|
import { ComponentPlatform } from '../services/component-platform';
|
5
5
|
import { StorageService } from '../services/storage.service';
|
6
6
|
import { TextsService } from '../services/texts.service';
|
7
|
+
import { WidgetAPI } from '../services/widget-api';
|
7
8
|
import { ApplicationOptions, PluginType, RenderStrategy, TriggerIcon, WidgetAnchor, WidgetConfig } from '../types';
|
8
9
|
import { Container } from './container';
|
9
10
|
export declare class Application {
|
@@ -24,6 +25,7 @@ export declare class Application {
|
|
24
25
|
private componentResolver;
|
25
26
|
private components;
|
26
27
|
trigger: Trigger | null;
|
28
|
+
api: WidgetAPI;
|
27
29
|
constructor(id: string, name: string, container: Container, settings: WidgetConfig, options: ApplicationOptions);
|
28
30
|
activate(): Promise<void>;
|
29
31
|
private loadPlugins;
|
package/models/environment.d.ts
CHANGED
@@ -1,13 +1,25 @@
|
|
1
1
|
import { Application } from './application';
|
2
2
|
import { Container } from './container';
|
3
3
|
import { ApplicationOptions, PluginType, WidgetConfig } from '../types';
|
4
|
+
import { WidgetAPI } from '../services/widget-api';
|
5
|
+
import { SiteAPI } from '../services/site-api';
|
6
|
+
import { Site } from './site';
|
7
|
+
export type WidgetAPIHandler = (widget?: WidgetAPI) => void;
|
8
|
+
export type SiteConfigurationHandler = (site: SiteAPI) => void;
|
4
9
|
export declare class Environment {
|
5
10
|
applications: Application[];
|
6
11
|
container: Container;
|
12
|
+
private bootstrapped;
|
13
|
+
private site;
|
14
|
+
widgetAPIHandlers: Map<string, WidgetAPIHandler[]>;
|
15
|
+
siteConfigurationHandlers: SiteConfigurationHandler[];
|
7
16
|
constructor();
|
8
17
|
bootstrap(): Promise<void>;
|
9
18
|
private activate;
|
10
19
|
private notifyWidgetsOfCreation;
|
20
|
+
configure(delegate: SiteConfigurationHandler): void;
|
21
|
+
widget(name: string, delegate: WidgetAPIHandler): void;
|
11
22
|
registerApp(id: string, name: string, config: WidgetConfig, options: ApplicationOptions): void;
|
23
|
+
registerSite(site: Site): void;
|
12
24
|
plugin(plugin: PluginType): this;
|
13
25
|
}
|
package/models/site.d.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
import { SiteAPI } from '../services/site-api';
|
1
2
|
import { InitConfig } from '../types';
|
2
3
|
import { Environment } from './environment';
|
3
4
|
export declare class Site {
|
4
|
-
|
5
|
+
environment?: Environment;
|
5
6
|
private configurations;
|
6
7
|
private url?;
|
7
8
|
private httpClient;
|
9
|
+
api: SiteAPI;
|
8
10
|
constructor(urlOrConfig: string | InitConfig);
|
9
11
|
load(url: string): Promise<void>;
|
10
12
|
loadFromConfig(config: InitConfig): void;
|
package/package.json
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
+
export declare enum StorageCategory {
|
2
|
+
Mandatory = "mandatory",
|
3
|
+
Preferences = "preferences",
|
4
|
+
Analytics = "analytics"
|
5
|
+
}
|
1
6
|
export declare class StorageService {
|
7
|
+
private storage;
|
8
|
+
private policy;
|
2
9
|
private widgetId;
|
3
|
-
constructor(widgetId: string);
|
4
|
-
|
5
|
-
set(key: string, value: string): void;
|
10
|
+
constructor(widgetId: string, storageType: 'localStorage' | 'sessionStorage', policy: Record<StorageCategory, boolean>);
|
11
|
+
set<T>(key: string, value: T, category: StorageCategory): void;
|
6
12
|
get<T>(key: string): T | null;
|
13
|
+
removeItem(key: string): void;
|
14
|
+
updatePolicy(newPolicy: Record<StorageCategory, boolean>): void;
|
15
|
+
private _prefixKey;
|
7
16
|
}
|