From a6d854a10c869f06255210dc706b70498a47b2e1 Mon Sep 17 00:00:00 2001 From: Caido Bot Date: Sat, 24 Jan 2026 12:20:50 +0000 Subject: [PATCH] Update SDK Documentation --- src/reference/sdks/frontend/files.md | 87 ++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/src/reference/sdks/frontend/files.md b/src/reference/sdks/frontend/files.md index 3b9e9d7..feb1784 100644 --- a/src/reference/sdks/frontend/files.md +++ b/src/reference/sdks/frontend/files.md @@ -146,6 +146,93 @@ Gets all hosted files. The files. +##### onDeletedHostedFile() + +> **onDeletedHostedFile**: (`callback`: (`fileId`: `string`) => `void`) => `ListenerHandle` + +Listen for deleted hosted files. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `callback` | (`fileId`: `string`) => `void` | The callback function that receives the file ID. | + +###### Returns + +`ListenerHandle` + +A handle object with a `stop` method to stop listening. + +###### Example + +```ts +const handle = sdk.files.onDeletedHostedFile((fileId) => { + console.log(`Hosted file deleted:`, fileId); +}); + +// Later, stop listening +handle.stop(); +``` + +##### onUpdatedHostedFile() + +> **onUpdatedHostedFile**: (`callback`: (`event`: [`HostedFile`](#hostedfile)) => `void`) => `ListenerHandle` + +Listen for updated hosted files. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `callback` | (`event`: [`HostedFile`](#hostedfile)) => `void` | The callback function that receives the hosted file. | + +###### Returns + +`ListenerHandle` + +A handle object with a `stop` method to stop listening. + +###### Example + +```ts +const handle = sdk.files.onUpdatedHostedFile((hostedFile) => { + console.log(`Hosted file updated:`, hostedFile); +}); + +// Later, stop listening +handle.stop(); +``` + +##### onUploadedHostedFile() + +> **onUploadedHostedFile**: (`callback`: (`event`: [`HostedFile`](#hostedfile)) => `void`) => `ListenerHandle` + +Listen for uploaded hosted files. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `callback` | (`event`: [`HostedFile`](#hostedfile)) => `void` | The callback function that receives the hosted file. | + +###### Returns + +`ListenerHandle` + +A handle object with a `stop` method to stop listening. + +###### Example + +```ts +const handle = sdk.files.onUploadedHostedFile((hostedFile) => { + console.log(`Hosted file uploaded:`, hostedFile); +}); + +// Later, stop listening +handle.stop(); +``` + ##### rename() > **rename**: (`id`: `string`, `name`: `string`) => `Promise`\<[`HostedFile`](#hostedfile)\>