@websimai/client-api-types 0.0.3 → 0.0.4

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.
Files changed (2) hide show
  1. package/dist/index.d.mts +27 -13
  2. package/package.json +5 -2
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import { WebsimComment } from "@websimai/shared-types";
2
+
1
3
  //#region src/types/chat.d.ts
2
4
  type ChatCompletionsMessageRole = "system" | "user" | "assistant" | "tool";
3
5
  type ChatCompletionsMessageContent = {
@@ -94,6 +96,11 @@ declare namespace ChatCompletions {
94
96
  type Options = ChatCompletionOptions;
95
97
  type Result = ChatCompletionResult;
96
98
  }
99
+ declare class Chat {
100
+ readonly completions: {
101
+ create(args: ChatCompletionOptions): Promise<ChatCompletionResult>;
102
+ };
103
+ }
97
104
  //#endregion
98
105
  //#region src/types/image-gen.d.ts
99
106
  type ImageGenAspectRatio = "1:1" | "16:9" | "21:9" | "3:2" | "2:3" | "4:5" | "5:4" | "3:4" | "4:3" | "9:16" | "9:21";
@@ -225,18 +232,26 @@ interface WebsimClientAPI {
225
232
  }): Promise<{
226
233
  readonly error?: "User has not interacted with the page";
227
234
  }>;
228
- addEventListener(eventType: "comment:created", callback: (data: any) => void): () => void;
229
- upload: (file: File) => Promise<string>;
230
- readonly chat: {
231
- readonly completions: {
232
- create: (args: ChatCompletionOptions) => Promise<ChatCompletionResult>;
233
- };
234
- };
235
- imageGen: (args: ImageGenOptions) => Promise<ImageGenResult>;
236
- textToSpeech: (args: TextToSpeechOptions) => Promise<TextToSpeechResult>;
237
- readonly experimental: {
235
+ renderVideo(args: {
236
+ composition: string;
237
+ inputProps?: Record<string, unknown>;
238
+ options?: unknown;
239
+ onProgress?: (progress: unknown) => void;
240
+ }): Promise<{
241
+ url: string;
242
+ renderId: string;
243
+ }>;
244
+ addEventListener(eventType: "comment:created", callback: (data: {
245
+ readonly comment: WebsimComment;
246
+ readonly cursor: string;
247
+ }) => void): () => void;
248
+ upload(file: File): Promise<string>;
249
+ readonly chat: Chat;
250
+ imageGen(args: ImageGenOptions): Promise<ImageGenResult>;
251
+ textToSpeech(args: TextToSpeechOptions): Promise<TextToSpeechResult>;
252
+ readonly experimental?: {
238
253
  readonly v0: {
239
- login: () => Promise<void>;
254
+ login(): Promise<void>;
240
255
  /**
241
256
  * Saves the given htmlContent to a new websim site.
242
257
  * @param htmlContent html content to save
@@ -254,7 +269,6 @@ interface WebsimClientAPI {
254
269
  getHTML(siteId?: string): Promise<string>;
255
270
  };
256
271
  };
257
- readonly internal_only_experimental: Record<never, never>;
258
272
  }
259
273
  //#endregion
260
274
  //#region src/globals.d.ts
@@ -265,4 +279,4 @@ declare global {
265
279
  const websim: WebsimClientAPI;
266
280
  }
267
281
  //#endregion
268
- export { AnonymousWebsimUser, ChatCompletionOptions, ChatCompletionResult, ChatCompletions, ChatCompletionsMessage, ChatCompletionsMessageContent, ChatCompletionsMessageRole, ImageGen, ImageGenAspectRatio, ImageGenOptions, ImageGenResult, TextToSpeechOptions, TextToSpeechResult, type WebsimClientAPI, WebsimUser, WebsimUserOrAnonymous };
282
+ export { AnonymousWebsimUser, Chat, ChatCompletionOptions, ChatCompletionResult, ChatCompletions, ChatCompletionsMessage, ChatCompletionsMessageContent, ChatCompletionsMessageRole, ImageGen, ImageGenAspectRatio, ImageGenOptions, ImageGenResult, TextToSpeechOptions, TextToSpeechResult, type WebsimClientAPI, WebsimUser, WebsimUserOrAnonymous };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websimai/client-api-types",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Type declarations for the `window.websim` object",
5
5
  "type": "module",
6
6
  "author": "GameRoMan",
@@ -36,7 +36,10 @@
36
36
  ".": "./dist/index.mjs",
37
37
  "./package.json": "./package.json"
38
38
  },
39
+ "dependencies": {
40
+ "@websimai/shared-types": "workspace:*"
41
+ },
39
42
  "devDependencies": {
40
- "tsdown": "^0.17.3"
43
+ "tsdown": "catalog:"
41
44
  }
42
45
  }