@howone/sdk 0.2.19 → 0.2.21
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/dist/index.d.mts +973 -0
- package/dist/index.d.ts +973 -0
- package/dist/index.js +4305 -4315
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4305 -4315
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,973 @@
|
|
|
1
|
+
import React$1, { Component, ReactNode } from 'react';
|
|
2
|
+
import * as axios from 'axios';
|
|
3
|
+
import { AxiosResponse, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosInstance } from 'axios';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import { ToastOptions } from 'react-toastify';
|
|
6
|
+
|
|
7
|
+
interface FloatingButtonProps {
|
|
8
|
+
text?: string;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const FloatingButton: React$1.FC<FloatingButtonProps>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 发送验证码请求接口
|
|
16
|
+
*/
|
|
17
|
+
interface SendCodeRequest {
|
|
18
|
+
/** 邮箱地址 */
|
|
19
|
+
email: string;
|
|
20
|
+
/** 来源 URL */
|
|
21
|
+
from_url: string;
|
|
22
|
+
/** 应用 ID(可选) */
|
|
23
|
+
app_id?: string;
|
|
24
|
+
/** 应用名称(可选) */
|
|
25
|
+
app_name?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 发送验证码响应接口
|
|
29
|
+
*/
|
|
30
|
+
interface SendCodeResponse {
|
|
31
|
+
/** 是否成功 */
|
|
32
|
+
success: boolean;
|
|
33
|
+
/** 消息(可选) */
|
|
34
|
+
message?: string;
|
|
35
|
+
/** 过期时间(秒)(可选) */
|
|
36
|
+
expiresIn?: number;
|
|
37
|
+
/** 状态码(可选,用于处理业务逻辑错误) */
|
|
38
|
+
code?: number;
|
|
39
|
+
/** 数据对象(可选,用于处理业务逻辑错误) */
|
|
40
|
+
data?: {
|
|
41
|
+
success: boolean;
|
|
42
|
+
message?: string;
|
|
43
|
+
code?: number;
|
|
44
|
+
};
|
|
45
|
+
/** 追踪 ID(可选) */
|
|
46
|
+
traceId?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 邮箱登录请求接口
|
|
50
|
+
*/
|
|
51
|
+
interface EmailLoginRequest {
|
|
52
|
+
/** 邮箱地址 */
|
|
53
|
+
email: string;
|
|
54
|
+
/** 验证码 */
|
|
55
|
+
code: string;
|
|
56
|
+
/** 来源 URL */
|
|
57
|
+
from_url: string;
|
|
58
|
+
/** 应用 ID(可选) */
|
|
59
|
+
app_id?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 邮箱登录响应接口
|
|
63
|
+
*/
|
|
64
|
+
interface EmailLoginResponse {
|
|
65
|
+
/** 是否成功 */
|
|
66
|
+
success: boolean;
|
|
67
|
+
/** JWT token(可选) */
|
|
68
|
+
token?: string;
|
|
69
|
+
/** 用户信息(可选) */
|
|
70
|
+
user?: {
|
|
71
|
+
email: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
};
|
|
74
|
+
/** 重定向 URL(可选) */
|
|
75
|
+
redirect_url?: string;
|
|
76
|
+
/** 消息(可选) */
|
|
77
|
+
message?: string;
|
|
78
|
+
/** 状态码(可选,用于处理业务逻辑错误) */
|
|
79
|
+
code?: number;
|
|
80
|
+
/** 数据对象(可选,用于处理业务逻辑错误) */
|
|
81
|
+
data?: {
|
|
82
|
+
success: boolean;
|
|
83
|
+
message?: string;
|
|
84
|
+
code?: number;
|
|
85
|
+
};
|
|
86
|
+
/** 追踪 ID(可选) */
|
|
87
|
+
traceId?: number;
|
|
88
|
+
}
|
|
89
|
+
declare class UnifiedAuthService {
|
|
90
|
+
private readonly API_BASE_URL;
|
|
91
|
+
/**
|
|
92
|
+
* 初始化 Google 登录流程
|
|
93
|
+
* @returns 包含 token 和用户信息的 Promise
|
|
94
|
+
*/
|
|
95
|
+
initiateGoogleLogin(): Promise<{
|
|
96
|
+
token: string;
|
|
97
|
+
user?: any;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* 打开 OAuth 认证弹窗
|
|
101
|
+
* @param authUrl 认证 URL
|
|
102
|
+
* @returns 包含 token 和用户信息的 Promise
|
|
103
|
+
*/
|
|
104
|
+
private openOAuthPopup;
|
|
105
|
+
/**
|
|
106
|
+
* 初始化 GitHub 登录流程
|
|
107
|
+
* @returns 包含 token 和用户信息的 Promise
|
|
108
|
+
*/
|
|
109
|
+
initiateGitHubLogin(): Promise<{
|
|
110
|
+
token: string;
|
|
111
|
+
user?: any;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* 发送邮箱验证码
|
|
115
|
+
* @param email 邮箱地址
|
|
116
|
+
* @param appName 应用名称(可选)
|
|
117
|
+
* @returns 发送结果 Promise
|
|
118
|
+
*/
|
|
119
|
+
sendEmailVerificationCode(email: string, appName?: string): Promise<SendCodeResponse>;
|
|
120
|
+
/**
|
|
121
|
+
* 邮箱验证码登录
|
|
122
|
+
* @param email 邮箱地址
|
|
123
|
+
* @param code 验证码
|
|
124
|
+
* @returns 登录结果 Promise
|
|
125
|
+
*/
|
|
126
|
+
loginWithEmailCode(email: string, code: string): Promise<EmailLoginResponse>;
|
|
127
|
+
/**
|
|
128
|
+
* 获取验证码状态(调试用)
|
|
129
|
+
* @param email 邮箱地址
|
|
130
|
+
* @returns 验证码状态 Promise
|
|
131
|
+
*/
|
|
132
|
+
getCodeStatus(email: string): Promise<any>;
|
|
133
|
+
private generateAppId;
|
|
134
|
+
/**
|
|
135
|
+
* 检查 OAuth 回调
|
|
136
|
+
* 从 URL 参数中获取 token 和错误信息
|
|
137
|
+
* @returns 包含 token、用户信息和错误的对象
|
|
138
|
+
*/
|
|
139
|
+
checkOAuthCallback(): {
|
|
140
|
+
success: boolean;
|
|
141
|
+
token?: string;
|
|
142
|
+
error?: string;
|
|
143
|
+
user?: any;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* 验证 token 是否有效
|
|
147
|
+
* @param token JWT token
|
|
148
|
+
* @returns 包含有效状态和用户信息的 Promise
|
|
149
|
+
*/
|
|
150
|
+
verifyToken(token: string): Promise<{
|
|
151
|
+
valid: boolean;
|
|
152
|
+
user?: any;
|
|
153
|
+
}>;
|
|
154
|
+
private getSavedAuthData;
|
|
155
|
+
/**
|
|
156
|
+
* 保存认证数据到本地存储
|
|
157
|
+
*/
|
|
158
|
+
private saveAuthData;
|
|
159
|
+
/**
|
|
160
|
+
* 退出登录
|
|
161
|
+
* @param token JWT token
|
|
162
|
+
*/
|
|
163
|
+
logout(token: string): Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
declare const unifiedAuth: UnifiedAuthService;
|
|
166
|
+
declare const unifiedOAuth: UnifiedAuthService;
|
|
167
|
+
declare function sendEmailVerificationCode(email: string, appName?: string): Promise<SendCodeResponse>;
|
|
168
|
+
declare function loginWithEmailCode(email: string, code: string): Promise<EmailLoginResponse>;
|
|
169
|
+
declare function getCodeStatus(email: string): Promise<any>;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* AI Workflow 服务(精简版,仅支持按 ID 的 path 风格执行)
|
|
173
|
+
*
|
|
174
|
+
* 说明:模板仅需要一种执行接口,形如 POST {baseUrl}/workflow/{workflowId}/execute
|
|
175
|
+
*/
|
|
176
|
+
interface AIWorkflowResponse {
|
|
177
|
+
success: boolean;
|
|
178
|
+
status?: number;
|
|
179
|
+
output?: Record<string, unknown>;
|
|
180
|
+
error?: string;
|
|
181
|
+
metadata?: Record<string, unknown>;
|
|
182
|
+
}
|
|
183
|
+
interface AIWorkflowClientOptions {
|
|
184
|
+
baseUrl?: string;
|
|
185
|
+
apiKey?: string;
|
|
186
|
+
headers?: Record<string, string>;
|
|
187
|
+
fetchImpl?: typeof fetch;
|
|
188
|
+
}
|
|
189
|
+
declare class AIWorkflowClient {
|
|
190
|
+
private readonly baseUrl;
|
|
191
|
+
private readonly apiKey?;
|
|
192
|
+
private readonly headers;
|
|
193
|
+
private readonly fetchImpl;
|
|
194
|
+
constructor(options?: AIWorkflowClientOptions);
|
|
195
|
+
private buildHeaders;
|
|
196
|
+
private safeJson;
|
|
197
|
+
/**
|
|
198
|
+
* 按 ID 执行工作流:POST {baseUrl}/workflow/{workflowId}/execute
|
|
199
|
+
* body: { input, options }
|
|
200
|
+
*/
|
|
201
|
+
executeWorkflow(workflowId: string, inputs: Record<string, unknown>, options?: Record<string, unknown>): Promise<AIWorkflowResponse | null>;
|
|
202
|
+
}
|
|
203
|
+
declare function createAIWorkflowClient(options?: AIWorkflowClientOptions): AIWorkflowClient;
|
|
204
|
+
declare const aiWorkflow: AIWorkflowClient;
|
|
205
|
+
|
|
206
|
+
interface RequestInterceptors<T = AxiosResponse> {
|
|
207
|
+
requestInterceptor?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
208
|
+
requestInterceptorCatch?: (error: any) => any;
|
|
209
|
+
responseInterceptor?: (res: T) => T;
|
|
210
|
+
responseInterceptorCatch?: (error: any) => any;
|
|
211
|
+
}
|
|
212
|
+
interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
|
|
213
|
+
interceptors?: RequestInterceptors<T>;
|
|
214
|
+
showLoading?: boolean;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
declare class Request {
|
|
218
|
+
instance: AxiosInstance;
|
|
219
|
+
interceptors?: RequestInterceptors;
|
|
220
|
+
abortControllers: Map<string, AbortController>;
|
|
221
|
+
constructor(config: RequestConfig);
|
|
222
|
+
cancelRequest(url: string): void;
|
|
223
|
+
cancelAllRequests(): void;
|
|
224
|
+
request<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
225
|
+
get<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
226
|
+
post<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
227
|
+
delete<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
228
|
+
put<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
229
|
+
patch<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
interface AxiosAIWorkflowOptions {
|
|
233
|
+
baseUrl?: string;
|
|
234
|
+
basePath?: string;
|
|
235
|
+
apiKey?: string;
|
|
236
|
+
timeout?: number;
|
|
237
|
+
headers?: Record<string, string>;
|
|
238
|
+
requestInstance?: Request;
|
|
239
|
+
/** 'body' (default) or 'path' for /workflow/{id}/execute */
|
|
240
|
+
workflowEndpointStyle?: 'body' | 'path';
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Create an AI workflow client backed by the project's Request (axios) wrapper.
|
|
244
|
+
* If `requestInstance` is provided it will be used directly; otherwise a new Request will be created.
|
|
245
|
+
*/
|
|
246
|
+
declare function createAIWorkflowClientAxios(options?: AxiosAIWorkflowOptions): {
|
|
247
|
+
executeWorkflow(workflowId: string, inputs: Record<string, unknown>, opts?: Record<string, unknown>): Promise<AIWorkflowResponse>;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
type Visibility = 'private' | 'project' | 'public' | 'shared';
|
|
251
|
+
interface Artifact {
|
|
252
|
+
id: string;
|
|
253
|
+
ownerId?: string | null;
|
|
254
|
+
projectId?: string | null;
|
|
255
|
+
visibility: Visibility;
|
|
256
|
+
storageUrl: string;
|
|
257
|
+
thumbnailUrl?: string;
|
|
258
|
+
input?: any;
|
|
259
|
+
output?: any;
|
|
260
|
+
model?: string;
|
|
261
|
+
metadata?: Record<string, any>;
|
|
262
|
+
createdAt?: string;
|
|
263
|
+
likes?: number;
|
|
264
|
+
stats?: {
|
|
265
|
+
views?: number;
|
|
266
|
+
};
|
|
267
|
+
sharedWith?: string[];
|
|
268
|
+
}
|
|
269
|
+
interface ArtifactCreateInput {
|
|
270
|
+
storageUrl: string;
|
|
271
|
+
thumbnailUrl?: string;
|
|
272
|
+
visibility?: Visibility;
|
|
273
|
+
metadata?: Record<string, any>;
|
|
274
|
+
model?: string;
|
|
275
|
+
ownerId?: string;
|
|
276
|
+
projectId?: string;
|
|
277
|
+
}
|
|
278
|
+
interface ArtifactListQuery {
|
|
279
|
+
ownerId?: string;
|
|
280
|
+
projectId?: string;
|
|
281
|
+
visibility?: Visibility;
|
|
282
|
+
limit?: number;
|
|
283
|
+
cursor?: string;
|
|
284
|
+
}
|
|
285
|
+
interface AccessContext {
|
|
286
|
+
userId?: string | null;
|
|
287
|
+
projectId?: string | null;
|
|
288
|
+
tokenScopes?: string[];
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Basic client-side permission check for an artifact.
|
|
292
|
+
* Note: final authorization must be enforced on the server. This is a convenience helper.
|
|
293
|
+
*/
|
|
294
|
+
declare function canAccessArtifact(a: Artifact, ctx?: AccessContext): boolean;
|
|
295
|
+
|
|
296
|
+
declare function createArtifactsClient(req: Request): {
|
|
297
|
+
create(input: ArtifactCreateInput): Promise<Artifact>;
|
|
298
|
+
list(query?: ArtifactListQuery): Promise<Artifact[]>;
|
|
299
|
+
get(id: string): Promise<Artifact>;
|
|
300
|
+
setVisibility(id: string, visibility: string): Promise<void>;
|
|
301
|
+
delete(id: string): Promise<void>;
|
|
302
|
+
canAccessLocal(a: Artifact, ctx: AccessContext): boolean;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
declare const AUTH_TOKEN_KEY = "auth_token";
|
|
306
|
+
declare function setToken(token: string | null): void;
|
|
307
|
+
declare function getToken(): string | null;
|
|
308
|
+
declare function parseUserFromToken(token: string | null): {
|
|
309
|
+
id: string;
|
|
310
|
+
email: string;
|
|
311
|
+
name: string;
|
|
312
|
+
avatar: string;
|
|
313
|
+
} | null;
|
|
314
|
+
declare function isTokenValid(token: string | null): boolean;
|
|
315
|
+
declare function useAuth(): {
|
|
316
|
+
token: string | null;
|
|
317
|
+
user: {
|
|
318
|
+
id: string;
|
|
319
|
+
email: string;
|
|
320
|
+
name: string;
|
|
321
|
+
avatar: string;
|
|
322
|
+
} | null;
|
|
323
|
+
isAuthenticated: boolean;
|
|
324
|
+
logout: () => void;
|
|
325
|
+
};
|
|
326
|
+
type AuthState$1 = {
|
|
327
|
+
user: ReturnType<typeof parseUserFromToken> | null;
|
|
328
|
+
isLoading: boolean;
|
|
329
|
+
};
|
|
330
|
+
declare function onAuthStateChanged(cb: (state: AuthState$1) => void): () => void;
|
|
331
|
+
|
|
332
|
+
type Environment = 'local' | 'dev' | 'prod';
|
|
333
|
+
type envs = {
|
|
334
|
+
AUTH_ROOT_VALUE: string;
|
|
335
|
+
baseUrl: string;
|
|
336
|
+
aiBaseUrl: string;
|
|
337
|
+
};
|
|
338
|
+
declare function setEnvironment(e: Environment): envs;
|
|
339
|
+
declare function getEnvironment(): Environment;
|
|
340
|
+
declare function getEnvs(): envs;
|
|
341
|
+
declare function setDefaultProjectId(id: string | null): void;
|
|
342
|
+
declare function getDefaultProjectId(): string | null;
|
|
343
|
+
declare function getGlobalEnvironment(): Environment | null;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Higher-level factory: createClient
|
|
347
|
+
* - minimal surface compatible with `createClient({ projectId, authRequired })`
|
|
348
|
+
* - returns executeWorkflow, request, aiRequest and a tiny auth helper (set/get token)
|
|
349
|
+
*/
|
|
350
|
+
declare function createClient(opts: {
|
|
351
|
+
projectId: string;
|
|
352
|
+
env?: 'local' | 'dev' | 'prod';
|
|
353
|
+
authRequired?: boolean;
|
|
354
|
+
mode?: "auto" | "standalone" | "embedded";
|
|
355
|
+
auth?: {
|
|
356
|
+
mode?: "none" | "managed" | "headless";
|
|
357
|
+
getToken?: () => Promise<string | null>;
|
|
358
|
+
tokenInjection?: {
|
|
359
|
+
allowedOrigins?: string[];
|
|
360
|
+
waitMs?: number;
|
|
361
|
+
clearUrlParamsAfterInjectionMs?: number;
|
|
362
|
+
clearAllUrlParams?: boolean;
|
|
363
|
+
sensitiveParams?: string[];
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
}): {
|
|
367
|
+
projectId: string;
|
|
368
|
+
request: {
|
|
369
|
+
instance: axios.AxiosInstance;
|
|
370
|
+
request: (config: RequestConfig) => Promise<AxiosResponse<any, any>>;
|
|
371
|
+
get: (config: RequestConfig) => Promise<AxiosResponse<any, any>>;
|
|
372
|
+
post: (config: RequestConfig) => Promise<AxiosResponse<any, any>>;
|
|
373
|
+
put: (config: RequestConfig) => Promise<AxiosResponse<any, any>>;
|
|
374
|
+
patch: (config: RequestConfig) => Promise<AxiosResponse<any, any>>;
|
|
375
|
+
delete: (config: RequestConfig) => Promise<AxiosResponse<any, any>>;
|
|
376
|
+
cancelRequest: (url: string) => void;
|
|
377
|
+
cancelAllRequests: () => void;
|
|
378
|
+
};
|
|
379
|
+
aiRequest: Request;
|
|
380
|
+
workflowRequest: {
|
|
381
|
+
get: <T = any>(config: RequestConfig<T>) => Promise<T>;
|
|
382
|
+
post: (config: RequestConfig) => Promise<AxiosResponse<any, any>>;
|
|
383
|
+
put: <T = any>(config: RequestConfig<T>) => Promise<T>;
|
|
384
|
+
delete: <T = any>(config: RequestConfig<T>) => Promise<T>;
|
|
385
|
+
request: <T = any>(config: RequestConfig<T>) => Promise<T>;
|
|
386
|
+
cancelRequest: (url: string) => void;
|
|
387
|
+
cancelAllRequests: () => void;
|
|
388
|
+
};
|
|
389
|
+
artifacts: {
|
|
390
|
+
create(input: ArtifactCreateInput): Promise<Artifact>;
|
|
391
|
+
list(query?: ArtifactListQuery): Promise<Artifact[]>;
|
|
392
|
+
get(id: string): Promise<Artifact>;
|
|
393
|
+
setVisibility(id: string, visibility: string): Promise<void>;
|
|
394
|
+
delete(id: string): Promise<void>;
|
|
395
|
+
};
|
|
396
|
+
me: () => Promise<{
|
|
397
|
+
id: string;
|
|
398
|
+
email: string;
|
|
399
|
+
name: string;
|
|
400
|
+
avatar: string;
|
|
401
|
+
} | null>;
|
|
402
|
+
auth: {
|
|
403
|
+
setToken: (t: string | null) => void;
|
|
404
|
+
getToken: () => string | null;
|
|
405
|
+
isAuthenticated: () => boolean;
|
|
406
|
+
login: (redirect?: string) => void;
|
|
407
|
+
logout: () => void;
|
|
408
|
+
};
|
|
409
|
+
sanitizeUrl: (o?: {
|
|
410
|
+
clearAll?: boolean;
|
|
411
|
+
sensitiveParams?: string[];
|
|
412
|
+
}) => void;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
interface LoginFormProps {
|
|
416
|
+
onLoginSuccess?: () => void;
|
|
417
|
+
appName?: string;
|
|
418
|
+
className?: string;
|
|
419
|
+
}
|
|
420
|
+
declare const LoginForm: React$1.FC<LoginFormProps>;
|
|
421
|
+
|
|
422
|
+
type Theme$1 = "dark" | "light" | "system";
|
|
423
|
+
type HowoneContextValue = {
|
|
424
|
+
user: ReturnType<typeof parseUserFromToken> | null;
|
|
425
|
+
token: string | null;
|
|
426
|
+
isAuthenticated: boolean;
|
|
427
|
+
logout: () => void;
|
|
428
|
+
};
|
|
429
|
+
interface HowOneProviderProps {
|
|
430
|
+
children: React$1.ReactNode;
|
|
431
|
+
autoRedirect?: boolean;
|
|
432
|
+
showFloatingButton?: boolean;
|
|
433
|
+
projectId?: string;
|
|
434
|
+
defaultTheme?: Theme$1;
|
|
435
|
+
themeStorageKey?: string;
|
|
436
|
+
forceDefaultTheme?: boolean;
|
|
437
|
+
redirectOnUnauthenticated?: boolean;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* HowOneProvider - All-in-one application provider
|
|
441
|
+
*
|
|
442
|
+
* Includes:
|
|
443
|
+
* - Authentication management with auto-redirect to auth page
|
|
444
|
+
* - Theme management (dark/light/system)
|
|
445
|
+
* - Toast notifications
|
|
446
|
+
* - Floating button (shows "Login" when unauthenticated)
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* ```tsx
|
|
450
|
+
* <HowOneProvider
|
|
451
|
+
* defaultTheme="dark"
|
|
452
|
+
* themeStorageKey="my-app-theme"
|
|
453
|
+
* showFloatingButton={true}
|
|
454
|
+
* redirectOnUnauthenticated={true}
|
|
455
|
+
* >
|
|
456
|
+
* <App />
|
|
457
|
+
* </HowOneProvider>
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
declare const HowOneProvider: React$1.FC<HowOneProviderProps>;
|
|
461
|
+
declare function useHowoneContext(): HowoneContextValue;
|
|
462
|
+
|
|
463
|
+
type AuthState = {
|
|
464
|
+
user: Record<string, unknown> | null;
|
|
465
|
+
isLoading: boolean;
|
|
466
|
+
};
|
|
467
|
+
declare class HowoneAuthClient {
|
|
468
|
+
private listeners;
|
|
469
|
+
private loading;
|
|
470
|
+
private emit;
|
|
471
|
+
onAuthStateChanged(listener: (state: AuthState) => void): () => void;
|
|
472
|
+
login(): void;
|
|
473
|
+
logout(): void;
|
|
474
|
+
getUser(): {
|
|
475
|
+
id: string;
|
|
476
|
+
email: string;
|
|
477
|
+
name: string;
|
|
478
|
+
avatar: string;
|
|
479
|
+
} | null;
|
|
480
|
+
setToken(token: string | null): void;
|
|
481
|
+
}
|
|
482
|
+
declare const howone: {
|
|
483
|
+
auth: HowoneAuthClient;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
interface LoadingProps {
|
|
487
|
+
size?: 'sm' | 'md' | 'lg';
|
|
488
|
+
text?: string;
|
|
489
|
+
className?: string;
|
|
490
|
+
fullScreen?: boolean;
|
|
491
|
+
}
|
|
492
|
+
declare const Loading: React$1.FC<LoadingProps>;
|
|
493
|
+
interface LoadingSpinnerProps {
|
|
494
|
+
size?: 'sm' | 'md' | 'lg';
|
|
495
|
+
className?: string;
|
|
496
|
+
}
|
|
497
|
+
declare const LoadingSpinner: React$1.FC<LoadingSpinnerProps>;
|
|
498
|
+
|
|
499
|
+
interface ErrorBoundaryState {
|
|
500
|
+
hasError: boolean;
|
|
501
|
+
error?: Error;
|
|
502
|
+
errorInfo?: React$1.ErrorInfo;
|
|
503
|
+
}
|
|
504
|
+
interface ErrorBoundaryProps {
|
|
505
|
+
children: ReactNode;
|
|
506
|
+
fallback?: React$1.ComponentType<{
|
|
507
|
+
error?: Error;
|
|
508
|
+
retry?: () => void;
|
|
509
|
+
}>;
|
|
510
|
+
onError?: (error: Error, errorInfo: React$1.ErrorInfo) => void;
|
|
511
|
+
}
|
|
512
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
513
|
+
constructor(props: ErrorBoundaryProps);
|
|
514
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
515
|
+
componentDidCatch(error: Error, errorInfo: React$1.ErrorInfo): void;
|
|
516
|
+
handleRetry: () => void;
|
|
517
|
+
render(): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<React$1.ReactNode> | null | undefined;
|
|
518
|
+
}
|
|
519
|
+
interface ErrorFallbackProps {
|
|
520
|
+
error?: Error;
|
|
521
|
+
retry?: () => void;
|
|
522
|
+
}
|
|
523
|
+
declare const DefaultErrorFallback: React$1.FC<ErrorFallbackProps>;
|
|
524
|
+
|
|
525
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
526
|
+
type ButtonVariant = "solid" | "ghost" | "flat";
|
|
527
|
+
interface ClayxButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
528
|
+
isIconOnly?: boolean;
|
|
529
|
+
size?: ButtonSize;
|
|
530
|
+
variant?: ButtonVariant;
|
|
531
|
+
children?: React$1.ReactNode;
|
|
532
|
+
}
|
|
533
|
+
declare const ClayxButton: React$1.FC<ClayxButtonProps>;
|
|
534
|
+
|
|
535
|
+
declare function showLimitUpgradeToast(message: string, onUpgrade: () => void): void;
|
|
536
|
+
|
|
537
|
+
type Theme = "dark" | "light" | "system";
|
|
538
|
+
type ThemeProviderProps = {
|
|
539
|
+
children: React.ReactNode;
|
|
540
|
+
defaultTheme?: Theme;
|
|
541
|
+
storageKey?: string;
|
|
542
|
+
forceDefault?: boolean;
|
|
543
|
+
};
|
|
544
|
+
type ThemeProviderState = {
|
|
545
|
+
theme: Theme;
|
|
546
|
+
setTheme: (theme: Theme) => void;
|
|
547
|
+
};
|
|
548
|
+
declare function ThemeProvider({ children, defaultTheme, storageKey, forceDefault, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
549
|
+
declare const useTheme: () => ThemeProviderState;
|
|
550
|
+
|
|
551
|
+
interface ThemeToggleProps {
|
|
552
|
+
className?: string;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* 主题切换按钮组件
|
|
556
|
+
* 使用项目内部的主题系统,在浅色主题显示太阳图标,深色主题显示月亮图标
|
|
557
|
+
*/
|
|
558
|
+
declare function ThemeToggle({ className }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
|
|
559
|
+
|
|
560
|
+
declare function GlobalToastContainer(): react_jsx_runtime.JSX.Element;
|
|
561
|
+
|
|
562
|
+
interface ToastParams {
|
|
563
|
+
title?: string;
|
|
564
|
+
message?: string;
|
|
565
|
+
render?: (closeToast: () => void) => React$1.ReactNode;
|
|
566
|
+
component?: React$1.ReactNode;
|
|
567
|
+
options?: Partial<ToastOptions>;
|
|
568
|
+
}
|
|
569
|
+
declare const ClayxToast: {
|
|
570
|
+
success: (params: ToastParams) => void;
|
|
571
|
+
error: (params: ToastParams) => void;
|
|
572
|
+
warning: (params: ToastParams) => void;
|
|
573
|
+
info: (params: ToastParams) => void;
|
|
574
|
+
default: (params: ToastParams) => void;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
interface SourceLocation {
|
|
578
|
+
file: string;
|
|
579
|
+
line: number;
|
|
580
|
+
component: string;
|
|
581
|
+
}
|
|
582
|
+
interface ElementSelectionData {
|
|
583
|
+
sourceLocation: SourceLocation | null;
|
|
584
|
+
element: {
|
|
585
|
+
tagName: string;
|
|
586
|
+
className: string;
|
|
587
|
+
id: string;
|
|
588
|
+
text: string;
|
|
589
|
+
};
|
|
590
|
+
rect: {
|
|
591
|
+
top: number;
|
|
592
|
+
left: number;
|
|
593
|
+
width: number;
|
|
594
|
+
height: number;
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
interface ElementSelectorProps {
|
|
598
|
+
active: boolean;
|
|
599
|
+
onSelect?: (data: ElementSelectionData) => void;
|
|
600
|
+
onCancel?: () => void;
|
|
601
|
+
}
|
|
602
|
+
declare const ElementSelector: React$1.FC<ElementSelectorProps>;
|
|
603
|
+
|
|
604
|
+
interface ElementSelectorProviderProps {
|
|
605
|
+
children: React$1.ReactNode;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* 元素选择器提供者组件
|
|
609
|
+
* 监听来自 iframe.js 的自定义事件,自动显示/隐藏元素选择器
|
|
610
|
+
*/
|
|
611
|
+
declare const ElementSelectorProvider: React$1.FC<ElementSelectorProviderProps>;
|
|
612
|
+
|
|
613
|
+
declare function useIsMobile(): boolean;
|
|
614
|
+
|
|
615
|
+
declare function useDebounce<T>(value: T, delay: number): T;
|
|
616
|
+
|
|
617
|
+
interface UseElementSelectorReturn {
|
|
618
|
+
isSelecting: boolean;
|
|
619
|
+
selectedElement: ElementSelectionData | null;
|
|
620
|
+
startSelecting: () => void;
|
|
621
|
+
stopSelecting: () => void;
|
|
622
|
+
clearSelection: () => void;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* 元素选择器 Hook
|
|
626
|
+
* 用于管理元素选择状态和向父窗口发送消息
|
|
627
|
+
*/
|
|
628
|
+
declare function useElementSelector(): UseElementSelectorReturn;
|
|
629
|
+
/**
|
|
630
|
+
* 向父窗口发送元素选择数据
|
|
631
|
+
*/
|
|
632
|
+
declare function sendElementSelectionToParent(data: ElementSelectionData): void;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* 错误处理模块 - 核心类型定义
|
|
636
|
+
*
|
|
637
|
+
*/
|
|
638
|
+
declare global {
|
|
639
|
+
interface Window {
|
|
640
|
+
__AUTO_ENGINEER_INTERACTION_TRAIL__?: UserInteraction[];
|
|
641
|
+
__AUTO_ENGINEER_ERRORS__?: any[];
|
|
642
|
+
__SEND_ERROR_TO_PARENT__?: (error: Error | string, details?: any) => void;
|
|
643
|
+
__FETCH_INTERCEPTED__?: boolean;
|
|
644
|
+
__XHR_INTERCEPTED__?: boolean;
|
|
645
|
+
__CONSOLE_INTERCEPTED__?: boolean;
|
|
646
|
+
__VITE_HMR__?: any;
|
|
647
|
+
__vite_plugin_react_preamble_installed__?: boolean;
|
|
648
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__?: any;
|
|
649
|
+
React?: any;
|
|
650
|
+
ReactDOM?: any;
|
|
651
|
+
Vue?: any;
|
|
652
|
+
Angular?: any;
|
|
653
|
+
jQuery?: any;
|
|
654
|
+
$?: any;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
type ErrorSeverity = 'critical' | 'high' | 'medium' | 'low';
|
|
658
|
+
type ErrorType = 'runtime' | 'promise' | 'network' | 'resource' | 'console' | 'vite' | 'react' | 'module' | 'unknown';
|
|
659
|
+
interface UserInteraction {
|
|
660
|
+
type: 'click' | 'input' | 'scroll' | 'navigation' | 'mousemove' | 'focus' | 'blur' | 'resize' | 'submit' | 'visibility' | 'keydown' | 'change' | 'keyup';
|
|
661
|
+
element?: string;
|
|
662
|
+
timestamp: number;
|
|
663
|
+
details?: any;
|
|
664
|
+
}
|
|
665
|
+
interface ViewInfo {
|
|
666
|
+
title: string;
|
|
667
|
+
url: string;
|
|
668
|
+
timestamp: number;
|
|
669
|
+
viewport?: {
|
|
670
|
+
width: number;
|
|
671
|
+
height: number;
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
interface ErrorPayload {
|
|
675
|
+
message: string;
|
|
676
|
+
stack?: string;
|
|
677
|
+
filename?: string;
|
|
678
|
+
lineno?: number;
|
|
679
|
+
colno?: number;
|
|
680
|
+
timestamp: number;
|
|
681
|
+
type: ErrorType | string;
|
|
682
|
+
severity: ErrorSeverity;
|
|
683
|
+
category?: string;
|
|
684
|
+
userAgent?: string;
|
|
685
|
+
url?: string;
|
|
686
|
+
view?: string;
|
|
687
|
+
userInteractions?: UserInteraction[];
|
|
688
|
+
networkInfo?: any;
|
|
689
|
+
details?: any;
|
|
690
|
+
context?: {
|
|
691
|
+
source?: string;
|
|
692
|
+
[key: string]: any;
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
interface SimpleErrorConfig {
|
|
696
|
+
maxErrors: number;
|
|
697
|
+
dedupWindow: number;
|
|
698
|
+
debounceTime: number;
|
|
699
|
+
reportToParent: boolean;
|
|
700
|
+
reportToConsole: boolean;
|
|
701
|
+
}
|
|
702
|
+
interface EnhancedErrorConfig {
|
|
703
|
+
MAX_ERRORS: number;
|
|
704
|
+
MAX_INTERACTIONS: number;
|
|
705
|
+
DEDUP_WINDOW: number;
|
|
706
|
+
DEBOUNCE_TIME: number;
|
|
707
|
+
CACHE_DURATION: number;
|
|
708
|
+
SEVERITY_KEYWORDS: {
|
|
709
|
+
CRITICAL: string[];
|
|
710
|
+
HIGH: string[];
|
|
711
|
+
MEDIUM: string[];
|
|
712
|
+
LOW: string[];
|
|
713
|
+
};
|
|
714
|
+
CATEGORY_KEYWORDS: {
|
|
715
|
+
SYNTAX: string[];
|
|
716
|
+
NETWORK: string[];
|
|
717
|
+
RUNTIME: string[];
|
|
718
|
+
SECURITY: string[];
|
|
719
|
+
PERFORMANCE: string[];
|
|
720
|
+
DEVELOPMENT: string[];
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
interface GlobalStateConfig {
|
|
724
|
+
ALLOWED_ORIGINS: string[];
|
|
725
|
+
DEBOUNCE_DELAY: number;
|
|
726
|
+
OVERRIDE_STYLESHEET_ID: string;
|
|
727
|
+
}
|
|
728
|
+
interface SelectorConfig {
|
|
729
|
+
HIGHLIGHT_COLOR: string;
|
|
730
|
+
HIGHLIGHT_BORDER_WIDTH: string;
|
|
731
|
+
HIGHLIGHT_BORDER_STYLE: string;
|
|
732
|
+
SELECTED_COLOR: string;
|
|
733
|
+
SELECTED_BORDER_WIDTH: string;
|
|
734
|
+
TOOLTIP_BACKGROUND: string;
|
|
735
|
+
TOOLTIP_COLOR: string;
|
|
736
|
+
TOOLTIP_PADDING: string;
|
|
737
|
+
TOOLTIP_BORDER_RADIUS: string;
|
|
738
|
+
TOOLTIP_FONT_SIZE: string;
|
|
739
|
+
TOOLTIP_Z_INDEX: string;
|
|
740
|
+
FULL_WIDTH_TOOLTIP_OFFSET: number;
|
|
741
|
+
highlightClass: string;
|
|
742
|
+
selectedClass: string;
|
|
743
|
+
cursor: string;
|
|
744
|
+
}
|
|
745
|
+
interface SelectorState {
|
|
746
|
+
isActive: boolean;
|
|
747
|
+
highlightedElement: any;
|
|
748
|
+
selectedElements: any[];
|
|
749
|
+
config: SelectorConfig;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* 统一消息类型定义
|
|
753
|
+
*/
|
|
754
|
+
type MessageType = 'ERROR_EVENT' | 'NETWORK_EVENT' | 'CONSOLE_EVENT' | 'SYSTEM_EVENT' | 'ELEMENT_EVENT' | 'SELECTOR_EVENT' | 'COMPONENT_EVENT' | 'STYLE_EVENT' | 'INTERACTION_EVENT' | 'STATE_EVENT';
|
|
755
|
+
interface ErrorStats {
|
|
756
|
+
totalErrors: number;
|
|
757
|
+
sentToParent?: number;
|
|
758
|
+
errorsByCategory?: Record<string, number>;
|
|
759
|
+
errorsBySeverity?: Record<ErrorSeverity, number>;
|
|
760
|
+
recentErrors?: ErrorPayload[];
|
|
761
|
+
jsErrors?: number;
|
|
762
|
+
networkErrors?: number;
|
|
763
|
+
consoleErrors?: number;
|
|
764
|
+
lastErrorTime?: number;
|
|
765
|
+
}
|
|
766
|
+
declare const ERROR_CONFIG: EnhancedErrorConfig;
|
|
767
|
+
declare const GLOBAL_CONFIG: GlobalStateConfig;
|
|
768
|
+
declare const DEFAULT_SELECTOR_CONFIG: SelectorConfig;
|
|
769
|
+
|
|
770
|
+
interface RefreshResult {
|
|
771
|
+
success: boolean;
|
|
772
|
+
clearedCaches?: string[];
|
|
773
|
+
unregisteredWorkers?: number;
|
|
774
|
+
clearedStorage?: string[];
|
|
775
|
+
error?: string;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* 统一错误处理器主类
|
|
780
|
+
* 提供完整的错误处理、交互追踪、元素选择等功能
|
|
781
|
+
*/
|
|
782
|
+
declare class ErrorHandler {
|
|
783
|
+
private initialized;
|
|
784
|
+
private errorHistory;
|
|
785
|
+
private messageSender;
|
|
786
|
+
private errorTracking;
|
|
787
|
+
private interactionTracking;
|
|
788
|
+
private messageBridge;
|
|
789
|
+
private viteHMRDetector;
|
|
790
|
+
private hardRefreshManager;
|
|
791
|
+
private viewDetector;
|
|
792
|
+
private componentTreeGenerator;
|
|
793
|
+
private config;
|
|
794
|
+
constructor(options?: Partial<typeof this.config>);
|
|
795
|
+
/** ----------------- 主要初始化方法 ----------------- */
|
|
796
|
+
/**
|
|
797
|
+
* 初始化错误处理器
|
|
798
|
+
*/
|
|
799
|
+
init(): void;
|
|
800
|
+
/**
|
|
801
|
+
* 初始化核心功能
|
|
802
|
+
*/
|
|
803
|
+
private initializeCore;
|
|
804
|
+
/**
|
|
805
|
+
* 初始化全局状态
|
|
806
|
+
*/
|
|
807
|
+
private initializeGlobalState;
|
|
808
|
+
/**
|
|
809
|
+
* 设置调试端点
|
|
810
|
+
*/
|
|
811
|
+
private setupDebugEndpoint;
|
|
812
|
+
/**
|
|
813
|
+
* 设置模块间的协作
|
|
814
|
+
*/
|
|
815
|
+
private setupModuleIntegration;
|
|
816
|
+
/**
|
|
817
|
+
* 启用功能模块
|
|
818
|
+
*/
|
|
819
|
+
private enableFeatures;
|
|
820
|
+
/**
|
|
821
|
+
* 处理硬刷新逻辑
|
|
822
|
+
*/
|
|
823
|
+
private handleHardRefreshLogic;
|
|
824
|
+
/**
|
|
825
|
+
* 设置视图检测
|
|
826
|
+
*/
|
|
827
|
+
private setupViewDetection;
|
|
828
|
+
/**
|
|
829
|
+
* 发送初始化完成消息
|
|
830
|
+
*/
|
|
831
|
+
/** ----------------- 公共接口方法 ----------------- */
|
|
832
|
+
/**
|
|
833
|
+
* 获取错误统计
|
|
834
|
+
*/
|
|
835
|
+
getErrorStats(): ErrorStats;
|
|
836
|
+
/**
|
|
837
|
+
* 获取交互历史
|
|
838
|
+
*/
|
|
839
|
+
getInteractionHistory(): UserInteraction[];
|
|
840
|
+
/**
|
|
841
|
+
* 获取当前视图信息
|
|
842
|
+
*/
|
|
843
|
+
getCurrentView(): ViewInfo;
|
|
844
|
+
/**
|
|
845
|
+
* 执行硬刷新
|
|
846
|
+
*/
|
|
847
|
+
performHardRefresh(options?: any): Promise<RefreshResult>;
|
|
848
|
+
/**
|
|
849
|
+
* 获取深度序列化的错误历史
|
|
850
|
+
*/
|
|
851
|
+
getSerializedErrorHistory(): any;
|
|
852
|
+
/**
|
|
853
|
+
* 检查是否在 Vite 环境中
|
|
854
|
+
*/
|
|
855
|
+
isViteEnvironment(): boolean;
|
|
856
|
+
/**
|
|
857
|
+
* 更新配置
|
|
858
|
+
*/
|
|
859
|
+
updateConfig(newConfig: Partial<typeof this.config>): void;
|
|
860
|
+
/**
|
|
861
|
+
* 销毁错误处理器
|
|
862
|
+
*/
|
|
863
|
+
destroy(): void;
|
|
864
|
+
/**
|
|
865
|
+
* 检查是否已初始化
|
|
866
|
+
*/
|
|
867
|
+
isInitialized(): boolean;
|
|
868
|
+
/**
|
|
869
|
+
* 报告当前状态
|
|
870
|
+
*/
|
|
871
|
+
reportStatus(): void;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* 简化版错误处理器
|
|
876
|
+
* 去除所有复杂功能,只保留最基本的错误收集和发送
|
|
877
|
+
*/
|
|
878
|
+
declare class SimpleErrorHandler {
|
|
879
|
+
private initialized;
|
|
880
|
+
private sendMessage;
|
|
881
|
+
/**
|
|
882
|
+
* 初始化错误处理器
|
|
883
|
+
*/
|
|
884
|
+
init(): void;
|
|
885
|
+
/**
|
|
886
|
+
* 设置错误监听器
|
|
887
|
+
*/
|
|
888
|
+
private setupErrorListeners;
|
|
889
|
+
/**
|
|
890
|
+
* 设置兼容性函数
|
|
891
|
+
*/
|
|
892
|
+
private setupCompatibility;
|
|
893
|
+
/**
|
|
894
|
+
* 发送错误到父窗口
|
|
895
|
+
*/
|
|
896
|
+
private sendError;
|
|
897
|
+
/**
|
|
898
|
+
* 手动捕获错误
|
|
899
|
+
*/
|
|
900
|
+
captureError(error: Error, details?: any): void;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* iframe navigation and element selector utilities
|
|
905
|
+
* Replaces the standalone iframe.js script
|
|
906
|
+
*/
|
|
907
|
+
declare function customGoBack(): boolean;
|
|
908
|
+
declare function customGoForward(): boolean;
|
|
909
|
+
declare function triggerElementSelection(): void;
|
|
910
|
+
declare function cancelElementSelection(): void;
|
|
911
|
+
/**
|
|
912
|
+
* Initialize iframe navigation system
|
|
913
|
+
* Call this once when your app starts
|
|
914
|
+
*/
|
|
915
|
+
declare function initIframeNavigation(): void;
|
|
916
|
+
/**
|
|
917
|
+
* Public API for iframe navigation
|
|
918
|
+
*/
|
|
919
|
+
declare const iframeNavigation: {
|
|
920
|
+
/**
|
|
921
|
+
* Initialize the navigation system
|
|
922
|
+
*/
|
|
923
|
+
init: typeof initIframeNavigation;
|
|
924
|
+
/**
|
|
925
|
+
* Add a page to navigation history
|
|
926
|
+
*/
|
|
927
|
+
addPage: (url?: string, title?: string) => void;
|
|
928
|
+
/**
|
|
929
|
+
* Get current navigation state
|
|
930
|
+
*/
|
|
931
|
+
getState: () => {
|
|
932
|
+
canGoBack: boolean;
|
|
933
|
+
canGoForward: boolean;
|
|
934
|
+
historyLength: number;
|
|
935
|
+
currentIndex: number;
|
|
936
|
+
currentPage: {
|
|
937
|
+
url: string;
|
|
938
|
+
title: string;
|
|
939
|
+
timestamp: number;
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
/**
|
|
943
|
+
* Update navigation state (send to parent)
|
|
944
|
+
*/
|
|
945
|
+
updateState: () => void;
|
|
946
|
+
/**
|
|
947
|
+
* Go back in history
|
|
948
|
+
*/
|
|
949
|
+
goBack: typeof customGoBack;
|
|
950
|
+
/**
|
|
951
|
+
* Go forward in history
|
|
952
|
+
*/
|
|
953
|
+
goForward: typeof customGoForward;
|
|
954
|
+
};
|
|
955
|
+
/**
|
|
956
|
+
* Public API for element selector
|
|
957
|
+
*/
|
|
958
|
+
declare const elementSelector: {
|
|
959
|
+
/**
|
|
960
|
+
* Start element selection mode
|
|
961
|
+
*/
|
|
962
|
+
startSelection: typeof triggerElementSelection;
|
|
963
|
+
/**
|
|
964
|
+
* Cancel element selection mode
|
|
965
|
+
*/
|
|
966
|
+
cancel: typeof cancelElementSelection;
|
|
967
|
+
/**
|
|
968
|
+
* Check if selector is active
|
|
969
|
+
*/
|
|
970
|
+
isActive: () => boolean;
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, type AxiosAIWorkflowOptions, ClayxButton, ClayxToast, DEFAULT_SELECTOR_CONFIG, DefaultErrorFallback, ERROR_CONFIG, type ElementSelectionData, ElementSelector, ElementSelectorProvider, type EmailLoginRequest, type EmailLoginResponse, type EnhancedErrorConfig, type Environment, ErrorBoundary, ErrorHandler, type ErrorPayload, type ErrorSeverity, type ErrorStats, type ErrorType, FloatingButton, GLOBAL_CONFIG, GlobalToastContainer, HowOneProvider, type HowOneProviderProps, Loading, LoadingSpinner, LoginForm, type MessageType, type SelectorState, type SendCodeRequest, type SendCodeResponse, type SimpleErrorConfig, SimpleErrorHandler, type SourceLocation, ThemeProvider, ThemeToggle, type UseElementSelectorReturn, type UserInteraction, type ViewInfo, type Visibility, aiWorkflow, canAccessArtifact, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, elementSelector, type envs, getCodeStatus, getDefaultProjectId, getEnvironment, getEnvs, getGlobalEnvironment, getToken, howone, iframeNavigation, initIframeNavigation, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, sendElementSelectionToParent, sendEmailVerificationCode, setDefaultProjectId, setEnvironment, setToken, showLimitUpgradeToast, unifiedAuth, unifiedOAuth, useAuth, useDebounce, useElementSelector, useHowoneContext, useIsMobile, useTheme };
|