mirror of https://github.com/Hilbis/Hilbish
docs: [ci] regenerate new docs
parent
e75c60ff49
commit
bd3628332e
|
@ -3,3 +3,4 @@ catch(name, cb) > Catches a hook with `name`. Runs the `cb` when it is thrown
|
||||||
catchOnce(name, cb) > Same as catch, but only runs the `cb` once and then removes the hook
|
catchOnce(name, cb) > Same as catch, but only runs the `cb` once and then removes the hook
|
||||||
|
|
||||||
throw(name, ...args) > Throws a hook with `name` with the provided `args`
|
throw(name, ...args) > Throws a hook with `name` with the provided `args`
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
deregister(name) > Deregisters any command registered with `name`
|
deregister(name) > Deregisters any command registered with `name`
|
||||||
|
|
||||||
register(name, cb) > Register a command with `name` that runs `cb` when ran
|
register(name, cb) > Register a command with `name` that runs `cb` when ran
|
||||||
|
|
||||||
|
|
|
@ -5,3 +5,4 @@ mkdir(name, recursive) > Makes a directory called `name`. If `recursive` is true
|
||||||
readdir(dir) > Returns a table of files in `dir`
|
readdir(dir) > Returns a table of files in `dir`
|
||||||
|
|
||||||
stat(path) > Returns info about `path`
|
stat(path) > Returns info about `path`
|
||||||
|
|
||||||
|
|
|
@ -36,3 +36,4 @@ Returns `input`, will be nil if ctrl + d is pressed, or an error occurs (which s
|
||||||
run(cmd) > Runs `cmd` in Hilbish's sh interpreter.
|
run(cmd) > Runs `cmd` in Hilbish's sh interpreter.
|
||||||
|
|
||||||
timeout(cb, time) > Runs the `cb` function after `time` in milliseconds
|
timeout(cb, time) > Runs the `cb` function after `time` in milliseconds
|
||||||
|
|
||||||
|
|
|
@ -6,3 +6,4 @@ saveState() > Saves the current state of the terminal
|
||||||
|
|
||||||
size() > Gets the dimensions of the terminal. Returns a table with `width` and `height`
|
size() > Gets the dimensions of the terminal. Returns a table with `width` and `height`
|
||||||
Note: this is not the size in relation to the dimensions of the display
|
Note: this is not the size in relation to the dimensions of the display
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
--- @meta
|
||||||
|
|
||||||
|
local bait = {}
|
||||||
|
|
||||||
|
--- Catches a hook with `name`. Runs the `cb` when it is thrown
|
||||||
|
function bait.catch() end
|
||||||
|
|
||||||
|
--- Same as catch, but only runs the `cb` once and then removes the hook
|
||||||
|
function bait.catchOnce() end
|
||||||
|
|
||||||
|
--- Throws a hook with `name` with the provided `args`
|
||||||
|
function bait.throw() end
|
||||||
|
|
||||||
|
return bait
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- @meta
|
||||||
|
|
||||||
|
local commander = {}
|
||||||
|
|
||||||
|
--- Deregisters any command registered with `name`
|
||||||
|
function commander.deregister() end
|
||||||
|
|
||||||
|
--- Register a command with `name` that runs `cb` when ran
|
||||||
|
function commander.register() end
|
||||||
|
|
||||||
|
return commander
|
|
@ -0,0 +1,17 @@
|
||||||
|
--- @meta
|
||||||
|
|
||||||
|
local fs = {}
|
||||||
|
|
||||||
|
--- Changes directory to `dir`
|
||||||
|
function fs.cd() end
|
||||||
|
|
||||||
|
--- Makes a directory called `name`. If `recursive` is true, it will create its parent directories.
|
||||||
|
function fs.mkdir() end
|
||||||
|
|
||||||
|
--- Returns a table of files in `dir`
|
||||||
|
function fs.readdir() end
|
||||||
|
|
||||||
|
--- Returns info about `path`
|
||||||
|
function fs.stat() end
|
||||||
|
|
||||||
|
return fs
|
|
@ -0,0 +1,58 @@
|
||||||
|
--- @meta
|
||||||
|
|
||||||
|
local hilbish = {}
|
||||||
|
|
||||||
|
--- Sets an alias of `orig` to `cmd`
|
||||||
|
function hilbish.alias() end
|
||||||
|
|
||||||
|
--- Appends `dir` to $PATH
|
||||||
|
function hilbish.appendPath() end
|
||||||
|
|
||||||
|
--- Registers a completion handler for `scope`.
|
||||||
|
--- A `scope` is currently only expected to be `command.<cmd>`,
|
||||||
|
--- replacing <cmd> with the name of the command (for example `command.git`).
|
||||||
|
--- `cb` must be a function that returns a table of the entries to complete.
|
||||||
|
--- Nested tables will be used as sub-completions.
|
||||||
|
function hilbish.complete() end
|
||||||
|
|
||||||
|
--- Returns the current directory of the shell
|
||||||
|
function hilbish.cwd() end
|
||||||
|
|
||||||
|
--- Replaces running hilbish with `cmd`
|
||||||
|
function hilbish.exec() end
|
||||||
|
|
||||||
|
--- Checks if the `f` flag has been passed to Hilbish.
|
||||||
|
function hilbish.flag() end
|
||||||
|
|
||||||
|
--- Puts `fn` in a goroutine
|
||||||
|
function hilbish.goroutine() end
|
||||||
|
|
||||||
|
--- Runs the `cb` function every `time` milliseconds
|
||||||
|
function hilbish.interval() end
|
||||||
|
|
||||||
|
--- Changes the continued line prompt to `str`
|
||||||
|
function hilbish.mlprompt() end
|
||||||
|
|
||||||
|
--- Prepends `dir` to $PATH
|
||||||
|
function hilbish.prependPath() end
|
||||||
|
|
||||||
|
--- Changes the shell prompt to `str`
|
||||||
|
--- There are a few verbs that can be used in the prompt text.
|
||||||
|
--- These will be formatted and replaced with the appropriate values.
|
||||||
|
--- `%d` - Current working directory
|
||||||
|
--- `%u` - Name of current user
|
||||||
|
--- `%h` - Hostname of device
|
||||||
|
function hilbish.prompt() end
|
||||||
|
|
||||||
|
--- Read input from the user, using Hilbish's line editor/input reader.
|
||||||
|
--- This is a separate instance from the one Hilbish actually uses.
|
||||||
|
--- Returns `input`, will be nil if ctrl + d is pressed, or an error occurs (which shouldn't happen)
|
||||||
|
function hilbish.read() end
|
||||||
|
|
||||||
|
--- Runs `cmd` in Hilbish's sh interpreter.
|
||||||
|
function hilbish.run() end
|
||||||
|
|
||||||
|
--- Runs the `cb` function after `time` in milliseconds
|
||||||
|
function hilbish.timeout() end
|
||||||
|
|
||||||
|
return hilbish
|
|
@ -0,0 +1,18 @@
|
||||||
|
--- @meta
|
||||||
|
|
||||||
|
local terminal = {}
|
||||||
|
|
||||||
|
--- Puts the terminal in raw mode
|
||||||
|
function terminal.raw() end
|
||||||
|
|
||||||
|
--- Restores the last saved state of the terminal
|
||||||
|
function terminal.restoreState() end
|
||||||
|
|
||||||
|
--- Saves the current state of the terminal
|
||||||
|
function terminal.saveState() end
|
||||||
|
|
||||||
|
--- Gets the dimensions of the terminal. Returns a table with `width` and `height`
|
||||||
|
--- Note: this is not the size in relation to the dimensions of the display
|
||||||
|
function terminal.size() end
|
||||||
|
|
||||||
|
return terminal
|
Loading…
Reference in New Issue