seacloud-sdk 0.12.3 → 0.12.5

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.ts CHANGED
@@ -83,7 +83,13 @@ declare class SeacloudError extends Error {
83
83
  declare class SeacloudClient {
84
84
  private config;
85
85
  private providedApiKey?;
86
- constructor(config?: SeacloudConfig);
86
+ private constructor();
87
+ /**
88
+ * 创建 SeacloudClient 实例(异步工厂方法)
89
+ * @param config 配置选项
90
+ * @returns SeacloudClient 实例
91
+ */
92
+ static create(config?: SeacloudConfig): Promise<SeacloudClient>;
87
93
  /**
88
94
  * 创建一个新任务
89
95
  * @param endpoint API 端点路径(例如:/model/tasks)
@@ -162,7 +168,7 @@ declare function initSeacloud(apiKeyOrConfig?: string | InitOptions, options?: {
162
168
  *
163
169
  * @returns SeacloudClient 实例
164
170
  */
165
- declare function getClient(): SeacloudClient;
171
+ declare function getClient(): Promise<SeacloudClient>;
166
172
  /**
167
173
  * 获取默认轮询选项
168
174
  */
@@ -194,7 +200,7 @@ declare function getHostFromParent(timeout?: number): Promise<string | null>;
194
200
  * @param options 配置选项
195
201
  * @returns 完整的配置对象
196
202
  */
197
- declare function createConfig(options?: SeacloudConfig): Required<SeacloudConfig>;
203
+ declare function createConfig(options?: SeacloudConfig): Promise<Required<SeacloudConfig>>;
198
204
  /**
199
205
  * 验证配置
200
206
  * @param config 配置对象