@hubui/client 0.1.0

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.
@@ -0,0 +1,42 @@
1
+ /**
2
+ * HubUI Client SDK - Error Classes
3
+ * @hubui/client
4
+ */
5
+ /**
6
+ * Base error class for all HubUI errors
7
+ */
8
+ export declare class HubUIError extends Error {
9
+ code: string;
10
+ constructor(message: string, code?: string);
11
+ }
12
+ /**
13
+ * Error codes used throughout the SDK
14
+ */
15
+ export declare const ErrorCodes: {
16
+ readonly CONNECTION_FAILED: "CONNECTION_FAILED";
17
+ readonly CONNECTION_TIMEOUT: "CONNECTION_TIMEOUT";
18
+ readonly CONNECTION_LOST: "CONNECTION_LOST";
19
+ readonly INVALID_API_KEY: "INVALID_API_KEY";
20
+ readonly INVALID_AGENT_ID: "INVALID_AGENT_ID";
21
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
22
+ readonly INVALID_CONFIG: "INVALID_CONFIG";
23
+ readonly MISSING_AGENT_ID: "MISSING_AGENT_ID";
24
+ readonly MISSING_API_KEY: "MISSING_API_KEY";
25
+ readonly INVALID_MODE: "INVALID_MODE";
26
+ readonly MICROPHONE_ACCESS_DENIED: "MICROPHONE_ACCESS_DENIED";
27
+ readonly AUDIO_DEVICE_ERROR: "AUDIO_DEVICE_ERROR";
28
+ readonly SESSION_NOT_CONNECTED: "SESSION_NOT_CONNECTED";
29
+ readonly SESSION_ALREADY_CONNECTED: "SESSION_ALREADY_CONNECTED";
30
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
31
+ readonly TOKEN_FETCH_FAILED: "TOKEN_FETCH_FAILED";
32
+ readonly UNKNOWN: "UNKNOWN";
33
+ };
34
+ export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
35
+ /**
36
+ * Create a HubUIError with a specific code
37
+ */
38
+ export declare function createError(message: string, code: ErrorCode): HubUIError;
39
+ /**
40
+ * Wrap unknown errors in HubUIError
41
+ */
42
+ export declare function wrapError(error: unknown): HubUIError;