Skip to content

Commit

Permalink
fix:doc
Browse files Browse the repository at this point in the history
  • Loading branch information
superAlibi committed Jul 17, 2024
1 parent b0a47cc commit 3032d9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@advanced/fetcher",
"version": "1.0.0",
"version": "1.0.1",
"exports": "./mod.ts",
"publish": {
"exclude": [
Expand Down
18 changes: 15 additions & 3 deletions libs/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ export class Fetcher extends SyncEventDispatcher<{
return result
}
/**
* 如果options中存在那么会忽略body
* 请求核心方法
* 其他所有具名方法均调用此方法
* @param url
* @param options
* @returns
Expand Down Expand Up @@ -176,6 +177,9 @@ export class Fetcher extends SyncEventDispatcher<{
method: "GET",
});
}
/**
* @alias Fetcher.get
*/
public GET = this.get
/**
* 发起http method=post的请求
Expand All @@ -193,6 +197,9 @@ export class Fetcher extends SyncEventDispatcher<{
method: "POST",
});
}
/**
* @alias Fetcher.post
*/
public POST = this.post
/**
* method为 head的请求
Expand All @@ -207,9 +214,12 @@ export class Fetcher extends SyncEventDispatcher<{
method: 'HEAD',
})
}
/**
* @alias Fetcher.head
*/
public HEAD = this.head
/**
*
* http method=options的请求
* @param url 相对config.baseURL 中的路径
* @param options
* @returns
Expand All @@ -225,7 +235,9 @@ export class Fetcher extends SyncEventDispatcher<{
});
}
}

/**
* createFetch的参数类型
*/
export type CreateFetcherOptions = FetherConfig & {
baseURL?: string,
requestInterceptor?: RequestInterceptor[] | RequestInterceptor;
Expand Down

0 comments on commit 3032d9e

Please sign in to comment.