From 9921851d3a847e608a03fbc1bfd322a428e4ef00 Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Thu, 29 Dec 2022 00:19:10 +0000 Subject: [PATCH] deploy: c12cb82fb5d5ec65ed139d3ae05cdcb5c7c2c1b7 --- docs/api/hilbish/hilbish.timers/index.html | 16 +++++++++++++--- docs/api/hilbish/index.xml | 4 ++-- index.xml | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/api/hilbish/hilbish.timers/index.html b/docs/api/hilbish/hilbish.timers/index.html index 2253cb4..b143b97 100644 --- a/docs/api/hilbish/hilbish.timers/index.html +++ b/docs/api/hilbish/hilbish.timers/index.html @@ -2,7 +2,17 @@

Interface hilbish.timers

timeout and interval API

Introduction

The timers interface si one to easily set timeouts and intervals -to run functions after a certain time or repeatedly without using -odd tricks.

Interface fields

  • INTERVAL: Constant for an interval timer type
  • TIMEOUT: Constant for a timeout timer type

Object properties

  • type: What type of timer it is
  • running: If the timer is running
  • duration: The duration in milliseconds that the timer will run

Functions

start()

Starts a timer.

stop()

Stops a timer.

create(type, time, callback)

Creates a timer that runs based on the specified time in milliseconds. +

Interface hilbish.timers

timeout and interval API

Introduction

If you ever want to run a piece of code on a timed interval, or want to wait +a few seconds, you don’t have to rely on timing tricks, as Hilbish has a +timer API to set intervals and timeouts.

These are the simple functions hilbish.interval and hilbish.timeout (doc +accessible with doc hilbish). But if you want slightly more control over +them, there is the hilbish.timers interface. It allows you to get +a timer via ID and control them.

All functions documented with the Timer type refer to a Timer object.

An example of usage:

local t = hilbish.timers.create(1, 5000, function()
+	print 'hello!'
+end)
+
+t:stop()
+print(t.running, t.duration, t.type)
+t:start()
+

Interface fields

  • INTERVAL: Constant for an interval timer type
  • TIMEOUT: Constant for a timeout timer type

Object properties

  • type: What type of timer it is
  • running: If the timer is running
  • duration: The duration in milliseconds that the timer will run

Functions

start()

Starts a timer.

stop()

Stops a timer.

create(type, time, callback)

Creates a timer that runs based on the specified time in milliseconds. The type can either be hilbish.timers.INTERVAL or hilbish.timers.TIMEOUT

get(id) -> timer (Timer/Table)

Retrieves a timer via its ID.

\ No newline at end of file diff --git a/docs/api/hilbish/index.xml b/docs/api/hilbish/index.xml index 31d9b10..e2246c7 100644 --- a/docs/api/hilbish/index.xml +++ b/docs/api/hilbish/index.xml @@ -17,6 +17,6 @@ size() Returns the amount of commands in the history. Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners. Object properties cmd: The user entered command string for the job. running: Whether the job is running or not. id: The ID of the job in the job table pid: The Process ID exitCode: The last exit code of the job.Interface hilbish.oshttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.os/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.os/ Introduction The os interface provides simple text information properties about the current OS on the systen. This mainly includes the name and version. Interface fields family: Family name of the current OS name: Pretty name of the current OS version: Version of the current OSInterface hilbish.runnerhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.runner/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.runner/Introduction The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any language or script of their choosing. A good example is using it to write command in Fennel. -Functions setMode(cb) This is the same as the hilbish.runnerMode function. It takes a callback, which will be used to execute all interactive input.Interface hilbish.timershttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Introduction The timers interface si one to easily set timeouts and intervals to run functions after a certain time or repeatedly without using odd tricks. -Interface fields INTERVAL: Constant for an interval timer type TIMEOUT: Constant for a timeout timer type Object properties type: What type of timer it is running: If the timer is running duration: The duration in milliseconds that the timer will run Functions start() Starts a timer.Interface hilbish.userDirhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/ Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user’s preferred directories for configs and data. +Functions setMode(cb) This is the same as the hilbish.runnerMode function. It takes a callback, which will be used to execute all interactive input.Interface hilbish.timershttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Introduction If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don’t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts. +These are the simple functions hilbish.interval and hilbish.timeout (doc accessible with doc hilbish). But if you want slightly more control over them, there is the hilbish.timers interface. It allows you to get a timer via ID and control them.Interface hilbish.userDirhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/ Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user’s preferred directories for configs and data. Interface fields config: The user’s config directory data: The user’s directory for program data \ No newline at end of file diff --git a/index.xml b/index.xml index 45d2795..2788ec9 100644 --- a/index.xml +++ b/index.xml @@ -22,8 +22,8 @@ size() Returns the amount of commands in the history. Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners. Object properties cmd: The user entered command string for the job. running: Whether the job is running or not. id: The ID of the job in the job table pid: The Process ID exitCode: The last exit code of the job.Interface hilbish.oshttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.os/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.os/ Introduction The os interface provides simple text information properties about the current OS on the systen. This mainly includes the name and version. Interface fields family: Family name of the current OS name: Pretty name of the current OS version: Version of the current OSInterface hilbish.runnerhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.runner/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.runner/Introduction The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any language or script of their choosing. A good example is using it to write command in Fennel. -Functions setMode(cb) This is the same as the hilbish.runnerMode function. It takes a callback, which will be used to execute all interactive input.Interface hilbish.timershttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Introduction The timers interface si one to easily set timeouts and intervals to run functions after a certain time or repeatedly without using odd tricks. -Interface fields INTERVAL: Constant for an interval timer type TIMEOUT: Constant for a timeout timer type Object properties type: What type of timer it is running: If the timer is running duration: The duration in milliseconds that the timer will run Functions start() Starts a timer.Interface hilbish.userDirhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/ Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user’s preferred directories for configs and data. +Functions setMode(cb) This is the same as the hilbish.runnerMode function. It takes a callback, which will be used to execute all interactive input.Interface hilbish.timershttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.timers/Introduction If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don’t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts. +These are the simple functions hilbish.interval and hilbish.timeout (doc accessible with doc hilbish). But if you want slightly more control over them, there is the hilbish.timers interface. It allows you to get a timer via ID and control them.Interface hilbish.userDirhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.userdir/ Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user’s preferred directories for configs and data. Interface fields config: The user’s config directory data: The user’s directory for program dataModule baithttps://rosettea.github.io/Hilbish/docs/api/bait/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/bait/Introduction Bait is the event emitter for Hilbish. Why name it bait? Why not. It throws hooks that you can catch. This is what you will use if you want to listen in on hooks to know when certain things have happened, like when you’ve changed directory, a command has failed, etc. To find all available hooks thrown by Hilbish, see doc hooks. Functions catch(name, cb) Catches a hook with name.Module commanderhttps://rosettea.github.io/Hilbish/docs/api/commander/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/commander/Introduction Commander is a library for writing custom commands in Lua. Functions deregister(name) Deregisters any command registered with name