Skip to content

Commit a3e03ea

Browse files
committed
docs(browser): update downloadFile examples with correct import
- Update downloadFile examples in both documentation and source code - Add missing import statement for downloadFile from '@ryanuo/utils' - Use twoslash directive in code examples for better documentation
1 parent 850e97d commit a3e03ea

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

docs/api/browser/functions/downloadFile.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ options?): Promise<void>;
3939

4040
## Example
4141

42-
```ts
42+
```ts twoslash
43+
import { downloadFile } from '@ryanuo/utils';
4344
// 基础用法
4445
downloadFile('https://example.com/file.pdf');
4546

src/browser/download.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @returns 成功或失败的Promise
88
*
99
* @example
10+
* ```ts twoslash
11+
* import { downloadFile } from '@ryanuo/utils';
1012
* // 基础用法
1113
* downloadFile('https://example.com/file.pdf');
1214
*
@@ -19,6 +21,7 @@
1921
* Authorization: 'Bearer token'
2022
* }
2123
* });
24+
* ```
2225
*/
2326
export async function downloadFile(
2427
url: string,

0 commit comments

Comments
 (0)