@tinycloud/web-sdk 0.0.0-beta-20260401001229
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/LICENSE.md +320 -0
- package/README.md +151 -0
- package/dist/adapters/BrowserENSResolver.d.ts +10 -0
- package/dist/adapters/BrowserENSResolver.d.ts.map +1 -0
- package/dist/adapters/BrowserNotificationHandler.d.ts +11 -0
- package/dist/adapters/BrowserNotificationHandler.d.ts.map +1 -0
- package/dist/adapters/BrowserSessionStorage.d.ts +9 -0
- package/dist/adapters/BrowserSessionStorage.d.ts.map +1 -0
- package/dist/adapters/BrowserWalletSigner.d.ts +22 -0
- package/dist/adapters/BrowserWalletSigner.d.ts.map +1 -0
- package/dist/adapters/BrowserWasmBindings.d.ts +23 -0
- package/dist/adapters/BrowserWasmBindings.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/authorization/WebSpaceCreationHandler.d.ts +40 -0
- package/dist/authorization/WebSpaceCreationHandler.d.ts.map +1 -0
- package/dist/authorization/index.d.ts +10 -0
- package/dist/authorization/index.d.ts.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.LICENSE.txt +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.LICENSE.txt +21 -0
- package/dist/index.mjs.map +1 -0
- package/dist/modules/Storage/index.d.ts +2 -0
- package/dist/modules/Storage/index.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts +24 -0
- package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/index.d.ts +3 -0
- package/dist/modules/Storage/tinycloud/index.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/module.d.ts +11 -0
- package/dist/modules/Storage/tinycloud/module.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/types.d.ts +64 -0
- package/dist/modules/Storage/tinycloud/types.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/types.schema.d.ts +159 -0
- package/dist/modules/Storage/tinycloud/types.schema.d.ts.map +1 -0
- package/dist/modules/WasmInitializer.d.ts +26 -0
- package/dist/modules/WasmInitializer.d.ts.map +1 -0
- package/dist/modules/index.d.ts +5 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/keys/index.d.ts +6 -0
- package/dist/modules/keys/index.d.ts.map +1 -0
- package/dist/modules/registry/Registry.d.ts +59 -0
- package/dist/modules/registry/Registry.d.ts.map +1 -0
- package/dist/modules/tcw.d.ts +142 -0
- package/dist/modules/tcw.d.ts.map +1 -0
- package/dist/notifications/ErrorHandler.d.ts +32 -0
- package/dist/notifications/ErrorHandler.d.ts.map +1 -0
- package/dist/notifications/ModalManager.d.ts +15 -0
- package/dist/notifications/ModalManager.d.ts.map +1 -0
- package/dist/notifications/NodeSelectionModal.d.ts +29 -0
- package/dist/notifications/NodeSelectionModal.d.ts.map +1 -0
- package/dist/notifications/SpaceCreationModal.d.ts +28 -0
- package/dist/notifications/SpaceCreationModal.d.ts.map +1 -0
- package/dist/notifications/ToastContainer.d.ts +16 -0
- package/dist/notifications/ToastContainer.d.ts.map +1 -0
- package/dist/notifications/ToastElement.d.ts +22 -0
- package/dist/notifications/ToastElement.d.ts.map +1 -0
- package/dist/notifications/ToastManager.d.ts +36 -0
- package/dist/notifications/ToastManager.d.ts.map +1 -0
- package/dist/notifications/index.d.ts +9 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/types.d.ts +37 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/notifications/types.schema.d.ts +224 -0
- package/dist/notifications/types.schema.d.ts.map +1 -0
- package/dist/providers/config.d.ts +44 -0
- package/dist/providers/config.d.ts.map +1 -0
- package/dist/providers/extension.d.ts +64 -0
- package/dist/providers/extension.d.ts.map +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/types.d.ts +657 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/utils.d.ts +20 -0
- package/dist/providers/utils.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +9 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/multiaddr.d.ts +36 -0
- package/dist/utils/multiaddr.d.ts.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface SpaceCreationModalOptions {
|
|
2
|
+
onCreateSpace: () => Promise<void>;
|
|
3
|
+
onDismiss?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface SpaceCreationResult {
|
|
6
|
+
success: boolean;
|
|
7
|
+
dismissed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class TinyCloudSpaceModal extends HTMLElement {
|
|
10
|
+
private options;
|
|
11
|
+
private isVisible;
|
|
12
|
+
private isCreating;
|
|
13
|
+
private resolveResult;
|
|
14
|
+
private completionPromise;
|
|
15
|
+
constructor(options: SpaceCreationModalOptions);
|
|
16
|
+
getCompletionPromise(): Promise<SpaceCreationResult>;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
private render;
|
|
20
|
+
private getModalStyles;
|
|
21
|
+
private setupEventListeners;
|
|
22
|
+
private handleKeyDown;
|
|
23
|
+
private handleCreateSpace;
|
|
24
|
+
private show;
|
|
25
|
+
private hide;
|
|
26
|
+
private dismiss;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=SpaceCreationModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpaceCreationModal.d.ts","sourceRoot":"","sources":["../../src/notifications/SpaceCreationModal.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,aAAa,CAAwD;IAC7E,OAAO,CAAC,iBAAiB,CAA+B;gBAE5C,OAAO,EAAE,yBAAyB;IAYvC,oBAAoB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI3D,iBAAiB;IAKjB,oBAAoB;IAIpB,OAAO,CAAC,MAAM;IAqDd,OAAO,CAAC,cAAc;IAuOtB,OAAO,CAAC,mBAAmB;IAgC3B,OAAO,CAAC,aAAa,CAInB;YAEY,iBAAiB;IAsB/B,OAAO,CAAC,IAAI;IAUZ,OAAO,CAAC,IAAI;IAaZ,OAAO,CAAC,OAAO;CAKhB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class TinyCloudToastContainer extends HTMLElement {
|
|
2
|
+
private toastManager;
|
|
3
|
+
private position;
|
|
4
|
+
private unsubscribe?;
|
|
5
|
+
constructor();
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
private render;
|
|
9
|
+
private getStyles;
|
|
10
|
+
private setupEventListeners;
|
|
11
|
+
private updateToasts;
|
|
12
|
+
private updatePosition;
|
|
13
|
+
private pauseTimers;
|
|
14
|
+
private resumeTimers;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ToastContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastContainer.d.ts","sourceRoot":"","sources":["../../src/notifications/ToastContainer.ts"],"names":[],"mappings":"AAIA,qBAAa,uBAAwB,SAAQ,WAAW;IACtD,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,WAAW,CAAC,CAAa;;IAQjC,iBAAiB;IAOjB,oBAAoB;IAIpB,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,SAAS;IAqFjB,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,YAAY;IA0CpB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,YAAY;CAUrB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Toast } from './types';
|
|
2
|
+
export declare class TinyCloudToastElement extends HTMLElement {
|
|
3
|
+
private toast;
|
|
4
|
+
private dismissTimer?;
|
|
5
|
+
private isDismissing;
|
|
6
|
+
private isPaused;
|
|
7
|
+
private pausedAt;
|
|
8
|
+
private remainingTime;
|
|
9
|
+
constructor(toast: Toast);
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
private render;
|
|
13
|
+
private getToastStyles;
|
|
14
|
+
private getIcon;
|
|
15
|
+
private setupEventListeners;
|
|
16
|
+
private startDismissTimer;
|
|
17
|
+
pauseTimer(): void;
|
|
18
|
+
resumeTimer(): void;
|
|
19
|
+
private playEnterAnimation;
|
|
20
|
+
private dismiss;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ToastElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastElement.d.ts","sourceRoot":"","sources":["../../src/notifications/ToastElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAGhD,qBAAa,qBAAsB,SAAQ,WAAW;IACpD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,aAAa,CAAa;gBAEtB,KAAK,EAAE,KAAK;IAOxB,iBAAiB;IAOjB,oBAAoB;IAMpB,OAAO,CAAC,MAAM;IAqBd,OAAO,CAAC,cAAc;IA2NtB,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,iBAAiB;IAQlB,UAAU,IAAI,IAAI;IAQlB,WAAW,IAAI,IAAI;IAe1B,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,OAAO;CAsBhB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Toast, ToastConfig } from './types';
|
|
2
|
+
export declare class ToastManager {
|
|
3
|
+
private static instance;
|
|
4
|
+
private toasts;
|
|
5
|
+
private subscribers;
|
|
6
|
+
private container;
|
|
7
|
+
private config;
|
|
8
|
+
private debounceTimers;
|
|
9
|
+
private toastHashes;
|
|
10
|
+
private constructor();
|
|
11
|
+
static getInstance(config?: ToastConfig): ToastManager;
|
|
12
|
+
initialize(): void;
|
|
13
|
+
add(toast: Omit<Toast, 'id' | 'timestamp'>): string;
|
|
14
|
+
remove(id: string): void;
|
|
15
|
+
clear(): void;
|
|
16
|
+
subscribe(callback: (toasts: Toast[]) => void): () => void;
|
|
17
|
+
private enforceMaxVisible;
|
|
18
|
+
private notify;
|
|
19
|
+
private generateId;
|
|
20
|
+
private hashToast;
|
|
21
|
+
private findDuplicateToast;
|
|
22
|
+
private updateToast;
|
|
23
|
+
}
|
|
24
|
+
export declare const toast: {
|
|
25
|
+
success: (title: string, options?: Partial<Toast>) => string;
|
|
26
|
+
error: (title: string, options?: Partial<Toast>) => string;
|
|
27
|
+
warning: (title: string, options?: Partial<Toast>) => string;
|
|
28
|
+
info: (title: string, options?: Partial<Toast>) => string;
|
|
29
|
+
loading: (title: string, options?: Partial<Toast>) => string;
|
|
30
|
+
promise: <T>(promise: Promise<T>, messages: {
|
|
31
|
+
loading: string;
|
|
32
|
+
success: string;
|
|
33
|
+
error: string;
|
|
34
|
+
}) => Promise<T>;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=ToastManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastManager.d.ts","sourceRoot":"","sources":["../../src/notifications/ToastManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElD,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,WAAW,CAA6C;IAChE,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,WAAW,CAAkC;IAErD,OAAO;WASO,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,YAAY;IAOtD,UAAU,IAAI,IAAI;IAQlB,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,MAAM;IAwCnD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAyBxB,KAAK,IAAI,IAAI;IASb,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI;IAKjE,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,WAAW;CAcpB;AAED,eAAO,MAAM,KAAK;qBACC,MAAM,YAAY,OAAO,CAAC,KAAK,CAAC;mBAGlC,MAAM,YAAY,OAAO,CAAC,KAAK,CAAC;qBAG9B,MAAM,YAAY,OAAO,CAAC,KAAK,CAAC;kBAGnC,MAAM,YAAY,OAAO,CAAC,KAAK,CAAC;qBAG7B,MAAM,YAAY,OAAO,CAAC,KAAK,CAAC;cAGvC,CAAC,WACA,OAAO,CAAC,CAAC,CAAC,YACT;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAC5D,OAAO,CAAC,CAAC,CAAC;CA4Bd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { ToastManager, toast } from './ToastManager';
|
|
3
|
+
export { TinyCloudToastContainer } from './ToastContainer';
|
|
4
|
+
export { TinyCloudToastElement } from './ToastElement';
|
|
5
|
+
export { SDKErrorHandler, dispatchSDKEvent } from './ErrorHandler';
|
|
6
|
+
export { TinyCloudSpaceModal, type SpaceCreationModalOptions, type SpaceCreationResult } from './SpaceCreationModal';
|
|
7
|
+
export { TinyCloudNodeSelectionModal, type NodeSelectionModalOptions, type NodeSelectionResult } from './NodeSelectionModal';
|
|
8
|
+
export { ModalManager, showSpaceCreationModal, showNodeSelectionModal } from './ModalManager';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,KAAK,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACrH,OAAO,EAAE,2BAA2B,EAAE,KAAK,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC7H,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
2
|
+
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
3
|
+
export interface ToastAction {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface Toast {
|
|
8
|
+
id: string;
|
|
9
|
+
type: ToastType;
|
|
10
|
+
title: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
duration?: number;
|
|
13
|
+
action?: ToastAction;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ToastConfig {
|
|
17
|
+
position?: ToastPosition;
|
|
18
|
+
duration?: number;
|
|
19
|
+
maxVisible?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface NotificationConfig {
|
|
22
|
+
popups?: boolean;
|
|
23
|
+
throwErrors?: boolean;
|
|
24
|
+
position?: ToastPosition;
|
|
25
|
+
duration?: number;
|
|
26
|
+
maxVisible?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface SDKErrorDetail {
|
|
29
|
+
category: string;
|
|
30
|
+
message: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SDKEventDetail {
|
|
34
|
+
message: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/notifications/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7E,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for TinyCloud notification and modal types.
|
|
3
|
+
*
|
|
4
|
+
* These schemas provide runtime validation for toast notifications,
|
|
5
|
+
* notification configuration, and modal types. Types are derived from
|
|
6
|
+
* schemas using z.infer<>.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
/**
|
|
12
|
+
* Toast notification type.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ToastTypeSchema: z.ZodEnum<["success", "error", "warning", "info", "loading"]>;
|
|
15
|
+
export type ToastType = z.infer<typeof ToastTypeSchema>;
|
|
16
|
+
/**
|
|
17
|
+
* Toast position on screen.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ToastPositionSchema: z.ZodEnum<["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"]>;
|
|
20
|
+
export type ToastPosition = z.infer<typeof ToastPositionSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* Action button for a toast notification.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ToastActionSchema: z.ZodObject<{
|
|
25
|
+
label: z.ZodString;
|
|
26
|
+
onClick: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
label?: string;
|
|
29
|
+
onClick?: (...args: unknown[]) => unknown;
|
|
30
|
+
}, {
|
|
31
|
+
label?: string;
|
|
32
|
+
onClick?: (...args: unknown[]) => unknown;
|
|
33
|
+
}>;
|
|
34
|
+
export type ToastAction = z.infer<typeof ToastActionSchema>;
|
|
35
|
+
/**
|
|
36
|
+
* Toast notification.
|
|
37
|
+
*/
|
|
38
|
+
export declare const ToastSchema: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
type: z.ZodEnum<["success", "error", "warning", "info", "loading"]>;
|
|
41
|
+
title: z.ZodString;
|
|
42
|
+
description: z.ZodOptional<z.ZodString>;
|
|
43
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
action: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
label: z.ZodString;
|
|
46
|
+
onClick: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
label?: string;
|
|
49
|
+
onClick?: (...args: unknown[]) => unknown;
|
|
50
|
+
}, {
|
|
51
|
+
label?: string;
|
|
52
|
+
onClick?: (...args: unknown[]) => unknown;
|
|
53
|
+
}>>;
|
|
54
|
+
timestamp: z.ZodNumber;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
type?: "error" | "success" | "warning" | "info" | "loading";
|
|
57
|
+
description?: string;
|
|
58
|
+
id?: string;
|
|
59
|
+
title?: string;
|
|
60
|
+
duration?: number;
|
|
61
|
+
action?: {
|
|
62
|
+
label?: string;
|
|
63
|
+
onClick?: (...args: unknown[]) => unknown;
|
|
64
|
+
};
|
|
65
|
+
timestamp?: number;
|
|
66
|
+
}, {
|
|
67
|
+
type?: "error" | "success" | "warning" | "info" | "loading";
|
|
68
|
+
description?: string;
|
|
69
|
+
id?: string;
|
|
70
|
+
title?: string;
|
|
71
|
+
duration?: number;
|
|
72
|
+
action?: {
|
|
73
|
+
label?: string;
|
|
74
|
+
onClick?: (...args: unknown[]) => unknown;
|
|
75
|
+
};
|
|
76
|
+
timestamp?: number;
|
|
77
|
+
}>;
|
|
78
|
+
export type Toast = z.infer<typeof ToastSchema>;
|
|
79
|
+
/**
|
|
80
|
+
* Toast configuration.
|
|
81
|
+
*/
|
|
82
|
+
export declare const ToastConfigSchema: z.ZodObject<{
|
|
83
|
+
position: z.ZodOptional<z.ZodEnum<["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"]>>;
|
|
84
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
maxVisible: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
duration?: number;
|
|
88
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
89
|
+
maxVisible?: number;
|
|
90
|
+
}, {
|
|
91
|
+
duration?: number;
|
|
92
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
93
|
+
maxVisible?: number;
|
|
94
|
+
}>;
|
|
95
|
+
export type ToastConfig = z.infer<typeof ToastConfigSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* Notification configuration.
|
|
98
|
+
*/
|
|
99
|
+
export declare const NotificationConfigSchema: z.ZodObject<{
|
|
100
|
+
popups: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
throwErrors: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
position: z.ZodOptional<z.ZodEnum<["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"]>>;
|
|
103
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
maxVisible: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
duration?: number;
|
|
107
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
108
|
+
maxVisible?: number;
|
|
109
|
+
popups?: boolean;
|
|
110
|
+
throwErrors?: boolean;
|
|
111
|
+
}, {
|
|
112
|
+
duration?: number;
|
|
113
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
114
|
+
maxVisible?: number;
|
|
115
|
+
popups?: boolean;
|
|
116
|
+
throwErrors?: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
export type NotificationConfig = z.infer<typeof NotificationConfigSchema>;
|
|
119
|
+
/**
|
|
120
|
+
* SDK error detail.
|
|
121
|
+
*/
|
|
122
|
+
export declare const SDKErrorDetailSchema: z.ZodObject<{
|
|
123
|
+
category: z.ZodString;
|
|
124
|
+
message: z.ZodString;
|
|
125
|
+
description: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
message?: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
category?: string;
|
|
130
|
+
}, {
|
|
131
|
+
message?: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
category?: string;
|
|
134
|
+
}>;
|
|
135
|
+
export type SDKErrorDetail = z.infer<typeof SDKErrorDetailSchema>;
|
|
136
|
+
/**
|
|
137
|
+
* SDK event detail.
|
|
138
|
+
*/
|
|
139
|
+
export declare const SDKEventDetailSchema: z.ZodObject<{
|
|
140
|
+
message: z.ZodString;
|
|
141
|
+
description: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
message?: string;
|
|
144
|
+
description?: string;
|
|
145
|
+
}, {
|
|
146
|
+
message?: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
}>;
|
|
149
|
+
export type SDKEventDetail = z.infer<typeof SDKEventDetailSchema>;
|
|
150
|
+
/**
|
|
151
|
+
* Options for the space creation modal.
|
|
152
|
+
*/
|
|
153
|
+
export declare const SpaceCreationModalOptionsSchema: z.ZodObject<{
|
|
154
|
+
/** Async function called when user clicks "Create Space" */
|
|
155
|
+
onCreateSpace: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
156
|
+
/** Optional callback when modal is dismissed */
|
|
157
|
+
onDismiss: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
onCreateSpace?: (...args: unknown[]) => unknown;
|
|
160
|
+
onDismiss?: (...args: unknown[]) => unknown;
|
|
161
|
+
}, {
|
|
162
|
+
onCreateSpace?: (...args: unknown[]) => unknown;
|
|
163
|
+
onDismiss?: (...args: unknown[]) => unknown;
|
|
164
|
+
}>;
|
|
165
|
+
export type SpaceCreationModalOptions = z.infer<typeof SpaceCreationModalOptionsSchema>;
|
|
166
|
+
/**
|
|
167
|
+
* Result from the space creation modal.
|
|
168
|
+
*/
|
|
169
|
+
export declare const SpaceCreationResultSchema: z.ZodObject<{
|
|
170
|
+
/** Whether space creation was successful */
|
|
171
|
+
success: z.ZodBoolean;
|
|
172
|
+
/** Whether the modal was dismissed without creating */
|
|
173
|
+
dismissed: z.ZodBoolean;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
success?: boolean;
|
|
176
|
+
dismissed?: boolean;
|
|
177
|
+
}, {
|
|
178
|
+
success?: boolean;
|
|
179
|
+
dismissed?: boolean;
|
|
180
|
+
}>;
|
|
181
|
+
export type SpaceCreationResult = z.infer<typeof SpaceCreationResultSchema>;
|
|
182
|
+
/**
|
|
183
|
+
* Validation error type.
|
|
184
|
+
*/
|
|
185
|
+
export interface ValidationError {
|
|
186
|
+
code: string;
|
|
187
|
+
message: string;
|
|
188
|
+
issues?: unknown[];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Result type for validation operations.
|
|
192
|
+
*/
|
|
193
|
+
export type ValidationResult<T> = {
|
|
194
|
+
ok: true;
|
|
195
|
+
data: T;
|
|
196
|
+
} | {
|
|
197
|
+
ok: false;
|
|
198
|
+
error: ValidationError;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Validates Toast.
|
|
202
|
+
*/
|
|
203
|
+
export declare function validateToast(data: unknown): ValidationResult<Toast>;
|
|
204
|
+
/**
|
|
205
|
+
* Validates ToastConfig.
|
|
206
|
+
*/
|
|
207
|
+
export declare function validateToastConfig(data: unknown): ValidationResult<ToastConfig>;
|
|
208
|
+
/**
|
|
209
|
+
* Validates NotificationConfig.
|
|
210
|
+
*/
|
|
211
|
+
export declare function validateNotificationConfig(data: unknown): ValidationResult<NotificationConfig>;
|
|
212
|
+
/**
|
|
213
|
+
* Validates SpaceCreationModalOptions.
|
|
214
|
+
*/
|
|
215
|
+
export declare function validateSpaceCreationModalOptions(data: unknown): ValidationResult<SpaceCreationModalOptions>;
|
|
216
|
+
/**
|
|
217
|
+
* Validates SpaceCreationResult.
|
|
218
|
+
*/
|
|
219
|
+
export declare function validateSpaceCreationResult(data: unknown): ValidationResult<SpaceCreationResult>;
|
|
220
|
+
/**
|
|
221
|
+
* Validates SDKErrorDetail.
|
|
222
|
+
*/
|
|
223
|
+
export declare function validateSDKErrorDetail(data: unknown): ValidationResult<SDKErrorDetail>;
|
|
224
|
+
//# sourceMappingURL=types.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.schema.d.ts","sourceRoot":"","sources":["../../src/notifications/types.schema.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client configuration types for TCW.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import type { SiweConfig } from "@tinycloud/sdk-core";
|
|
7
|
+
import type { RPCProvider, ServerRoutes } from "./types";
|
|
8
|
+
/** Core config for TCW. */
|
|
9
|
+
export interface ClientConfig {
|
|
10
|
+
/** Connection to a cryptographic keypair and/or network. */
|
|
11
|
+
providers?: ClientProviders;
|
|
12
|
+
/** Optional session configuration for the SIWE message. */
|
|
13
|
+
siweConfig?: SiweConfig;
|
|
14
|
+
/** Whether or not ENS resolution is enabled. True means resolve all on client. */
|
|
15
|
+
resolveEns?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** The URL of the server running tcw-server. Providing this field enables SIWE server communication */
|
|
18
|
+
export type ServerHost = string;
|
|
19
|
+
/** The tcw-powered server configuration settings */
|
|
20
|
+
export type ProviderServer = {
|
|
21
|
+
host: ServerHost;
|
|
22
|
+
/** Optional configuration for the server's routes. */
|
|
23
|
+
routes?: ServerRoutes;
|
|
24
|
+
};
|
|
25
|
+
/** Web3 provider configuration settings */
|
|
26
|
+
export interface ProviderWeb3 {
|
|
27
|
+
/**
|
|
28
|
+
* window.ethereum for Metamask;
|
|
29
|
+
* web3modal.connect() for Web3Modal;
|
|
30
|
+
* const signer = useSigner(); const provider = signer.provider; from Wagmi for Rainbowkit
|
|
31
|
+
* */
|
|
32
|
+
driver: any;
|
|
33
|
+
}
|
|
34
|
+
/** TCW web3 configuration settings */
|
|
35
|
+
export interface ClientProviders {
|
|
36
|
+
/** Web3 wallet provider */
|
|
37
|
+
web3?: ProviderWeb3;
|
|
38
|
+
/** JSON RPC provider configurations */
|
|
39
|
+
rpc?: RPCProvider;
|
|
40
|
+
/** Optional reference to server running tcw-server.
|
|
41
|
+
* Providing this field enables communication with tcw-server */
|
|
42
|
+
server?: ProviderServer;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/providers/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzD,2BAA2B;AAC3B,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,uGAAuG;AACvG,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,oDAAoD;AACpD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,sDAAsD;IACtD,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IAC3B;;;;SAIK;IACL,MAAM,EAAE,GAAG,CAAC;CACb;AAED,sCAAsC;AACtC,MAAM,WAAW,eAAe;IAC9B,2BAA2B;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,uCAAuC;IACvC,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB;oEACgE;IAChE,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-coupled extension types.
|
|
3
|
+
*
|
|
4
|
+
* These types stay in web-sdk because they depend on browser-specific
|
|
5
|
+
* APIs (@tinycloud/web-sdk-wasm, ethers Web3Provider, axios).
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import { tcwSession } from "@tinycloud/web-sdk-wasm";
|
|
10
|
+
import { AxiosInstance } from "axios";
|
|
11
|
+
import { ethers } from "ethers";
|
|
12
|
+
import type { ClientSession, SiweConfig } from "@tinycloud/sdk-core";
|
|
13
|
+
import type { ClientConfig } from "./config";
|
|
14
|
+
/** Extra SIWE fields. */
|
|
15
|
+
export type ExtraFields = tcwSession.ExtraFields;
|
|
16
|
+
/** Overrides for the session configuration. */
|
|
17
|
+
export type ConfigOverrides = {
|
|
18
|
+
siwe?: SiweConfig;
|
|
19
|
+
};
|
|
20
|
+
/** Interface to an intermediate TCW state: connected, but not signed-in. */
|
|
21
|
+
export interface IConnected {
|
|
22
|
+
/** Instance of TCWSessionManager. */
|
|
23
|
+
builder: tcwSession.TCWSessionManager;
|
|
24
|
+
/** TCWConfig object. */
|
|
25
|
+
config: ClientConfig;
|
|
26
|
+
/** List of enabled extensions. */
|
|
27
|
+
extensions: Extension[];
|
|
28
|
+
/** Web3 provider. */
|
|
29
|
+
provider: ethers.providers.Web3Provider;
|
|
30
|
+
/** Promise that is initialized on construction to run the "afterConnect" methods of extensions. */
|
|
31
|
+
afterConnectHooksPromise: Promise<void>;
|
|
32
|
+
/** Method to verify if extension is enabled. */
|
|
33
|
+
isExtensionEnabled: (namespace: string) => boolean;
|
|
34
|
+
/** Axios instance. */
|
|
35
|
+
api?: AxiosInstance;
|
|
36
|
+
/** Method to apply the "afterConnect" methods and the delegated capabilities of the extensions. */
|
|
37
|
+
applyExtensions: () => Promise<void>;
|
|
38
|
+
/** Method to apply the "afterSignIn" methods of the extensions. */
|
|
39
|
+
afterSignIn: (session: ClientSession) => Promise<void>;
|
|
40
|
+
/** Method to request the user to sign in. */
|
|
41
|
+
signIn: () => Promise<ClientSession>;
|
|
42
|
+
/** Method to request the user to sign out. */
|
|
43
|
+
signOut: (session: ClientSession) => Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
/** Interface for an extension to TCW. */
|
|
46
|
+
export interface Extension {
|
|
47
|
+
/** [recap] Capability namespace. */
|
|
48
|
+
namespace?: string;
|
|
49
|
+
/** [recap] Default delegated actions in capability namespace. */
|
|
50
|
+
defaultActions?(): Promise<string[]>;
|
|
51
|
+
/** [recap] Delegated actions by target in capability namespace. */
|
|
52
|
+
targetedActions?(): Promise<{
|
|
53
|
+
[target: string]: string[];
|
|
54
|
+
}>;
|
|
55
|
+
/** [recap] Extra metadata to help validate the capability. */
|
|
56
|
+
extraFields?(): Promise<ExtraFields>;
|
|
57
|
+
/** Hook to run after TCW has connected to the user's wallet.
|
|
58
|
+
* This can return an object literal to override the session configuration before the user
|
|
59
|
+
* signs in. */
|
|
60
|
+
afterConnect?(tcw: IConnected): Promise<ConfigOverrides>;
|
|
61
|
+
/** Hook to run after TCW has signed in. */
|
|
62
|
+
afterSignIn?(session: ClientSession): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/providers/extension.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,yBAAyB;AACzB,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;AAEjD,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,qCAAqC;IACrC,OAAO,EAAE,UAAU,CAAC,iBAAiB,CAAC;IACtC,wBAAwB;IACxB,MAAM,EAAE,YAAY,CAAC;IACrB,kCAAkC;IAClC,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC;IACxC,mGAAmG;IACnG,wBAAwB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,gDAAgD;IAChD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,sBAAsB;IACtB,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,mGAAmG;IACnG,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,mEAAmE;IACnE,WAAW,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,6CAA6C;IAC7C,MAAM,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IACrC,8CAA8C;IAC9C,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED,yCAAyC;AACzC,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,cAAc,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,mEAAmE;IACnE,eAAe,CAAC,IAAI,OAAO,CAAC;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC5D,8DAA8D;IAC9D,WAAW,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC;;mBAEe;IACf,YAAY,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACzD,2CAA2C;IAC3C,WAAW,CAAC,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider types, configuration, utilities, and extension interfaces.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export * from "./types";
|
|
7
|
+
export * from "./config";
|
|
8
|
+
export * from "./utils";
|
|
9
|
+
export * from "./extension";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|