Skip to content

Commit

Permalink
docs: v0.4 type name
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Dec 26, 2024
1 parent c8806dd commit c20393f
Show file tree
Hide file tree
Showing 5 changed files with 3,153 additions and 432 deletions.
4 changes: 2 additions & 2 deletions docs/plugins/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ The element size is set to the specified amount.
Applies a percentage of the available space to the element

Converts the given percentage to a floating-point value and multiplies that with area.
This value is rounded back to a integer as part of the layout split calculation.
This value is rounded back to an integer as part of the layout split calculation.

```lua
-- { Percentage(75), Fill(1) }
Expand All @@ -336,7 +336,7 @@ This value is rounded back to a integer as part of the layout split calculation.
Applies a ratio of the available space to the element

Converts the given ratio to a floating-point value and multiplies that with area.
This value is rounded back to a integer as part of the layout split calculation.
This value is rounded back to an integer as part of the layout split calculation.

```lua
-- { Ratio(1, 2), Ratio(1, 2) }
Expand Down
24 changes: 12 additions & 12 deletions docs/plugins/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Cha means one file's characteristics with the following properties:
- `is_sock` - Whether this file is a socket
- `is_exec` - Whether this file is executable
- `is_sticky` - Whether this file has the sticky bit set
- `len` - The length of this file, returns an integer representing the size in bytes. Note that it can't reflect the size of a directory, use [`size()`](#app-data.folder-file) instead
- `len` - The length of this file, returns an integer representing the size in bytes. Note that it can't reflect the size of a directory, use [`size()`](#app-data.fs-file) instead
- `atime` - The accessed time of this file in Unix timestamp, or `nil` if it doesn't have a valid time
- `btime` - The birth time of this file in Unix timestamp, or `nil` if it doesn't have a valid time
- `mtime` - The modified time of this file in Unix timestamp, or `nil` if it doesn't have a valid time
Expand Down Expand Up @@ -94,7 +94,7 @@ Properties:

Properties:

- `code`: The raw error code if any, otherwise `nil`, which is a integer.
- `code`: The raw error code if any, otherwise `nil`, which is an integer.

Meta methods:

Expand Down Expand Up @@ -137,7 +137,7 @@ Meta methods:

- `__tostring()`

### `tab::Config` {#app-data.tab-config}
### `tab::Preference` {#app-data.tab-preference}

Properties:

Expand All @@ -163,27 +163,27 @@ Meta methods:
Properties:

- `skip` - The number of units to skip. The units largely depend on your previewer, such as lines for code and percentages for videos.
- `folder` - The [folder::Folder](#app-data.folder-folder) being previewed, or `nil` if this preview is not for folders
- `folder` - The [tab::Folder](#app-data.tab-folder) being previewed, or `nil` if this preview is not for folders

### `folder::Folder` {#app-data.folder-folder}
### `tab::Folder` {#app-data.tab-folder}

Properties:

- `cwd` - The current working directory of this folder, which is a [Url](#shared.url)
- `offset` - The offset of this folder, which is an integer
- `cursor` - The cursor position of this folder, which is an integer
- `window` - A table of [File](#shared.file) in the visible area of this folder
- `files` - The [`folder::Files`](#app-data.folder-files) of this folder
- `files` - The [`fs::Files`](#app-data.fs-files) of this folder
- `hovered` - The hovered [File](#shared.file) of this folder, or `nil` if there is no hovered file

### `folder::Files` {#app-data.folder-files}
### `fs::Files` {#app-data.fs-files}

Meta methods:

- `__len()`
- `__index(idx)` - Access the [folder::File](#app-data.folder-file) by index
- `__index(idx)` - Access the [fs::File](#app-data.fs-file) by index

### `folder::File` {#app-data.folder-file}
### `fs::File` {#app-data.fs-file}

Based on [File](#shared.file), with the following additional methods:

Expand Down Expand Up @@ -214,9 +214,9 @@ Meta methods:
Properties:

- `mode` - The [tab::Mode](#app-data.tab-mode) of this tab.
- `pref` - The [tab::Config](#app-data.tab-config) of this tab.
- `current` - The current folder within this tab, which is a [folder::Folder](#app-data.folder-folder).
- `parent` - The parent folder within this tab, which is a [folder::Folder](#app-data.folder-folder) if `current` has a parent; otherwise, `nil`.
- `pref` - The [tab::Preference](#app-data.tab-preference) of this tab.
- `current` - The current folder within this tab, which is a [tab::Folder](#app-data.tab-folder).
- `parent` - The parent folder within this tab, which is a [tab::Folder](#app-data.tab-folder) if `current` has a parent; otherwise, `nil`.
- `selected` - The selected files within this tab, which is a [tab::Selected](#app-data.tab-selected).
- `preview` - The [tab::Preview](#app-data.tab-preview) within this tab.

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ Publish a message to a specific instance with `receiver` as the ID:

With:

- `receiver`: Required, ID of the remote instance, which is a integer; if it's `0` then broadcasting to all remote instances.
- `receiver`: Required, ID of the remote instance, which is an integer; if it's `0` then broadcasting to all remote instances.
- `kind`: The same as `pub()`.
- `value`: The same as `pub()`.

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
"format": "prettier --write ."
},
"dependencies": {
"@docusaurus/core": "3.5.2",
"@docusaurus/preset-classic": "3.5.2",
"@docusaurus/core": "3.6.3",
"@docusaurus/preset-classic": "3.6.3",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"prism-react-renderer": "^2.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.5.2",
"@docusaurus/tsconfig": "3.5.2",
"@docusaurus/types": "3.5.2",
"@docusaurus/module-type-aliases": "3.6.3",
"@docusaurus/tsconfig": "3.6.3",
"@docusaurus/types": "3.6.3",
"prettier": "^3.0.3",
"typescript": "~5.2.2"
},
Expand Down
Loading

0 comments on commit c20393f

Please sign in to comment.