@wippy-fe/types-global-proxy 0.0.18 → 0.0.20
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.
- package/index.d.ts +34 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -750,6 +750,37 @@ type Events = {
|
|
|
750
750
|
};
|
|
751
751
|
declare function createEvents(): <T extends string>(topicPattern: T, callback: T extends KnownTopics ? Events[T] : Events["@message"]) => nanoevents.Unsubscribe;
|
|
752
752
|
|
|
753
|
+
declare const LogLevel: {
|
|
754
|
+
readonly Emergency: 0;
|
|
755
|
+
readonly Alert: 1;
|
|
756
|
+
readonly Critical: 2;
|
|
757
|
+
readonly Error: 3;
|
|
758
|
+
readonly Warning: 4;
|
|
759
|
+
readonly Notice: 5;
|
|
760
|
+
readonly Info: 6;
|
|
761
|
+
readonly Debug: 7;
|
|
762
|
+
};
|
|
763
|
+
type LogLevelValue = typeof LogLevel[keyof typeof LogLevel];
|
|
764
|
+
interface Breadcrumb {
|
|
765
|
+
category?: string;
|
|
766
|
+
message?: string;
|
|
767
|
+
data?: Record<string, unknown>;
|
|
768
|
+
level?: LogLevelValue;
|
|
769
|
+
type?: 'default' | 'http' | 'navigation' | 'user' | 'error';
|
|
770
|
+
timestamp?: number;
|
|
771
|
+
}
|
|
772
|
+
interface LoggerApi {
|
|
773
|
+
debug: (message: string, data?: Record<string, unknown>) => void;
|
|
774
|
+
info: (message: string, data?: Record<string, unknown>) => void;
|
|
775
|
+
warn: (message: string, data?: Record<string, unknown>) => void;
|
|
776
|
+
error: (message: string, data?: Record<string, unknown>) => void;
|
|
777
|
+
captureException: (error: unknown, extra?: Record<string, unknown>) => void;
|
|
778
|
+
captureMessage: (message: string, level?: LogLevelValue, extra?: Record<string, unknown>) => void;
|
|
779
|
+
addBreadcrumb: (breadcrumb: Breadcrumb) => void;
|
|
780
|
+
setContext: (name: string, data: Record<string, unknown> | null) => void;
|
|
781
|
+
setTag: (key: string, value: string | null) => void;
|
|
782
|
+
}
|
|
783
|
+
|
|
753
784
|
interface StateApiOptions {
|
|
754
785
|
/** Override the default page-level scope. Used by web components with persist-key or nested artifacts. */
|
|
755
786
|
scope?: string;
|
|
@@ -841,6 +872,7 @@ interface ProxyApiInstance {
|
|
|
841
872
|
submit: (data: FormData | Record<string, unknown>) => Promise<FormResult>;
|
|
842
873
|
};
|
|
843
874
|
on: ReturnType<typeof createEvents>;
|
|
875
|
+
logger: LoggerApi;
|
|
844
876
|
state: StateApi;
|
|
845
877
|
ws: ProxyWsApi;
|
|
846
878
|
loadWebComponent: (componentId: string, tagName?: string) => Promise<void>;
|
|
@@ -864,6 +896,7 @@ interface ProxyConfig {
|
|
|
864
896
|
iconifyIcons: boolean;
|
|
865
897
|
refreshWhenVisible: boolean;
|
|
866
898
|
historyPolyfill: boolean;
|
|
899
|
+
errorCapture: boolean;
|
|
867
900
|
};
|
|
868
901
|
}
|
|
869
902
|
|
|
@@ -930,6 +963,7 @@ declare global {
|
|
|
930
963
|
/** @deprecated Use `$W.host` instead */
|
|
931
964
|
iframe: () => Promise<ProxyApiInstance['host']>;
|
|
932
965
|
on: () => Promise<ProxyApiInstance['on']>;
|
|
966
|
+
logger: () => Promise<ProxyApiInstance['logger']>;
|
|
933
967
|
state: () => Promise<ProxyApiInstance['state']>;
|
|
934
968
|
ws: () => Promise<ProxyApiInstance['ws']>;
|
|
935
969
|
loadWebComponent: () => Promise<ProxyApiInstance['loadWebComponent']>;
|
package/package.json
CHANGED