Skip to content

Commit

Permalink
update docs. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Feb 1, 2024
1 parent 356b981 commit 2d91ad1
Show file tree
Hide file tree
Showing 13 changed files with 1,678 additions and 232 deletions.
2 changes: 2 additions & 0 deletions Assets/Script/Lib/Dora/en/dora.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ local nvg = require("nvg")
local ImGui = require("ImGui")
local Platformer = require("Platformer")
local HttpServer = require("HttpServer")
local HttpClient = require("HttpClient")
local Profiler = require("Profiler")
local teal = require("teal")
local yue = require("yue")
Expand Down Expand Up @@ -220,5 +221,6 @@ global dora = {
teal = teal,
yue = yue,
HttpServer = HttpServer,
HttpClient = HttpClient,
Profiler = Profiler,
}
2 changes: 2 additions & 0 deletions Assets/Script/Lib/Dora/zh-Hans/dora.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ local nvg = require("nvg")
local ImGui = require("ImGui")
local Platformer = require("Platformer")
local HttpServer = require("HttpServer")
local HttpClient = require("HttpClient")
local Profiler = require("Profiler")
local teal = require("teal")
local yue = require("yue")
Expand Down Expand Up @@ -220,5 +221,6 @@ global dora = {
teal = teal,
yue = yue,
HttpServer = HttpServer,
HttpClient = HttpClient,
Profiler = Profiler,
}
34 changes: 34 additions & 0 deletions Site/docs/api/Class/HttpClient.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import "@site/src/languages/highlight";

# HttpClient

**Description:**

  Represents an HTTP client.

## downloadAsync

**Type:** Function.

**Description:**

  Downloads a file asynchronously from the specified URL and saves it to the specified path. Should be run in a coroutine.

**Signature:**
```tl
downloadAsync: function(self: HttpClient, url: string, fullPath: string, progress: function(current: integer, total: integer)): boolean
```

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| url | string | The URL of the file to download. |
| fullPath | string | The full path where the downloaded file should be saved. |
| progress | string | [optional] A callback function that is called periodically to report the download progress. The function receives two parameters: current (the number of bytes downloaded so far) and total (the total number of bytes to be downloaded). |

**Returns:**

| Return Type | Description |
| --- | --- |
| boolean | A boolean value indicating whether the download was done successfully. |
1 change: 1 addition & 0 deletions Site/docs/api/Module/dora.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ global dora = {
teal = teal,
yue = yue,
HttpServer = HttpServer,
HttpClient = HttpClient,
Profiler = Profiler,
}
Expand Down
18 changes: 14 additions & 4 deletions Site/docs/api/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This category provides general functions and services of the engine.

* [App](/docs/api/Class/App)
* [View](/docs/api/Class/View)
* [Scheduler](/docs/api/Class/Scheduler)
* [Profiler](/docs/api/Class%20Object/Profiler)
* [Object](/docs/api/Class/Object)

Expand Down Expand Up @@ -50,15 +49,16 @@ This category provides a range of data structures and types.
* [Color](/docs/api/Class/Color)
* [Color3](/docs/api/Class/Color3)

## Scene and Event Management
## Scene Management

This category is for managing game scene trees and events.
This category is for managing game scene trees.

### Tree Management

This category provides the management of the root nodes and cameras of the game scene.

* [Director](/docs/api/Class/Director)
* [Scheduler](/docs/api/Class/Scheduler)
* [Camera](/docs/api/Class/Camera)
* [Camera2D](/docs/api/Class/Camera2D)
* [CameraOtho](/docs/api/Class/CameraOtho)
Expand All @@ -74,6 +74,10 @@ This category provides the management of game scene nodes and node events.
* [GSlot](/docs/api/Class/GSlot)
* [emit](/docs/api/Module/emit)

## Event Management

This category is for managing game events.

### Global Events

This subcategory handles global-level events, such as application and operating system events.
Expand Down Expand Up @@ -217,4 +221,10 @@ This category provides the functionality for loading and executing complex game
* [YarnRunner](/docs/api/Class/YarnRunner)
* [TextResult](/docs/api/Class/YarnRunner/TextResult)
* [OptionResult](/docs/api/Class/YarnRunner/OptionResult)
* [Markup](/docs/api/Class/YarnRunner/Markup)
* [Markup](/docs/api/Class/YarnRunner/Markup)

## Networking Service

This category provides the functionality for networking service.

* [HttpClient](/docs/api/Class/HttpClient)
24 changes: 20 additions & 4 deletions Site/i18n/zh-Hans/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@
"message": "切换自动换行",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "打开/收起侧边栏菜单「{label}」",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.NavBar.navAriaLabel": {
"message": "主导航",
"description": "The ARIA label for the main navigation"
Expand Down Expand Up @@ -332,5 +328,25 @@
"theme.SearchBar.label": {
"message": "搜索",
"description": "The ARIA label and placeholder for search button"
},
"theme.admonition.warning": {
"message": "注意",
"description": "The default label used for the Warning admonition (:::warning)"
},
"theme.DocSidebarItem.expandCategoryAriaLabel": {
"message": "展开侧边栏分类 '{label}'",
"description": "The ARIA label to expand the sidebar category"
},
"theme.DocSidebarItem.collapseCategoryAriaLabel": {
"message": "折叠侧边栏分类 '{label}'",
"description": "The ARIA label to collapse the sidebar category"
},
"theme.unlistedContent.title": {
"message": "未列出页",
"description": "The unlisted content banner title"
},
"theme.unlistedContent.message": {
"message": "此页面未列出。搜索引擎不会对其索引,只有拥有直接链接的用户才能访问。",
"description": "The unlisted content banner message"
}
}
Loading

0 comments on commit 2d91ad1

Please sign in to comment.