Skip to content

Commit e083d6d

Browse files
committed
docs(network): update API documentation and remove chore category
- Update API documentation for network functions - Remove chore category from package.json - Improve type safety and documentation in network/http.ts
1 parent cf3f76f commit e083d6d

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

docs/api/network/functions/checkNetworkStatus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ function checkNetworkStatus(): Promise<boolean>;
1212

1313
`Promise`\<`boolean`\>
1414

15-
Promise<boolean> 是否在线
15+
是否在线

docs/api/network/functions/getIndexedDBCache.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@ function getIndexedDBCache(dbName, storeName): Promise<{
1717

1818
`string`
1919

20+
indexedDB 数据库名称
21+
2022
### storeName
2123

2224
`string`
2325

26+
缓存对象名称
27+
2428
## Returns
2529

2630
`Promise`\<\{
2731
`get`: `Promise`\<`undefined` \| `T`\>;
2832
`set`: `Promise`\<`void`\>;
2933
\}\>
3034

31-
Promise<{ get: (key: string) => Promise<any>, set: (key: string, value: any) => Promise<void> }>
35+
IndexedDB 缓存对象
3236

3337
## Example
3438

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@
9595
"refactor": {
9696
"title": "♻️ Refactors"
9797
},
98-
"chore": {
99-
"title": "🧹 Chores"
100-
},
10198
"docs": {
10299
"title": "📚 Documentation"
103100
},

src/network/http.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ async function getClientIP(): Promise<string> {
107107
* const users = await cache.get('users');
108108
* ```
109109
* @category Http
110-
* @param dbName
111-
* @param storeName
112-
* @returns Promise<{ get: (key: string) => Promise<any>, set: (key: string, value: any) => Promise<void> }>
110+
* @param dbName indexedDB 数据库名称
111+
* @param storeName 缓存对象名称
112+
* @returns IndexedDB 缓存对象
113113
*/
114114
async function getIndexedDBCache(dbName: string, storeName: string) {
115115
const openDB = (): Promise<IDBDatabase> => {
@@ -150,7 +150,7 @@ async function getIndexedDBCache(dbName: string, storeName: string) {
150150
/**
151151
* 检测网络连接状态
152152
* @category Http
153-
* @returns Promise<boolean> 是否在线
153+
* @returns 是否在线
154154
*/
155155
function checkNetworkStatus(): Promise<boolean> {
156156
return new Promise((resolve) => {

0 commit comments

Comments
 (0)