Generate documentation for Lune version 0.8.6

This commit is contained in:
Filip Tibell 2024-06-23 14:57:50 +02:00
parent 4d82f813f5
commit b6207f05d6
No known key found for this signature in database
2 changed files with 101 additions and 32 deletions

View file

@ -107,7 +107,10 @@ The options passed while loading a luau chunk from an arbitrary string, or bytec
This is a dictionary that may contain one or more of the following values: This is a dictionary that may contain one or more of the following values:
- `debugName` - The debug name of the closure. Defaults to `luau.load(...)`. - `debugName` - The debug name of the closure. Defaults to `luau.load(...)`.
- `environment` - Environment values to set and/or override. Includes default globals unless - `environment` - A custom environment to load the chunk in. Setting a custom environment will
overwritten. deoptimize the chunk and forcefully disable codegen. Defaults to the global environment.
- `injectGlobals` - Whether or not to inject globals in the custom environment. Has no effect if
no custom environment is provided. Defaults to `true`.
- `codegenEnabled` - Whether or not to enable codegen. Defaults to `false`.
--- ---

View file

@ -29,13 +29,7 @@ fs.writeFile("myFile.yaml", serde.encode("yaml", someYaml))
Encodes the given value using the given format. Encodes the given value using the given format.
Currently supported formats: See [`EncodeDecodeFormat`] for a list of supported formats.
| Name | Learn More |
| :----- | :------------------- |
| `json` | https://www.json.org |
| `yaml` | https://yaml.org |
| `toml` | https://toml.io |
#### Parameters #### Parameters
@ -56,13 +50,7 @@ Currently supported formats:
Decodes the given string using the given format into a lua value. Decodes the given string using the given format into a lua value.
Currently supported formats: See [`EncodeDecodeFormat`] for a list of supported formats.
| Name | Learn More |
| :----- | :------------------- |
| `json` | https://www.json.org |
| `yaml` | https://yaml.org |
| `toml` | https://toml.io |
#### Parameters #### Parameters
@ -80,14 +68,7 @@ Currently supported formats:
Compresses the given string using the given format. Compresses the given string using the given format.
Currently supported formats: See [`CompressDecompressFormat`] for a list of supported formats.
| Name | Learn More |
| :------- | :-------------------------------- |
| `brotli` | https://github.com/google/brotli |
| `gzip` | https://www.gnu.org/software/gzip |
| `lz4` | https://github.com/lz4/lz4 |
| `zlib` | https://www.zlib.net |
#### Parameters #### Parameters
@ -105,14 +86,7 @@ Currently supported formats:
Decompresses the given string using the given format. Decompresses the given string using the given format.
Currently supported formats: See [`CompressDecompressFormat`] for a list of supported formats.
| Name | Learn More |
| :------- | :-------------------------------- |
| `brotli` | https://github.com/google/brotli |
| `gzip` | https://www.gnu.org/software/gzip |
| `lz4` | https://github.com/lz4/lz4 |
| `zlib` | https://www.zlib.net |
#### Parameters #### Parameters
@ -125,3 +99,95 @@ Currently supported formats:
- The decompressed string - The decompressed string
--- ---
### hash
Hashes the given message using the given algorithm and returns the hash as a hex string.
See [`HashAlgorithm`] for a list of supported algorithms.
#### Parameters
- `algorithm` The algorithm to use
- `message` The message to hash
#### Returns
- The hash as a hex string
---
### hmac
Hashes the given message using HMAC with the given secret and algorithm, returning the hash as a
base64 string.
See [`HashAlgorithm`] for a list of supported algorithms.
#### Parameters
- `algorithm` The algorithm to use
- `message` The message to hash
- `secret` string | buffer
#### Returns
- The hash as a base64 string
---
## Types
### EncodeDecodeFormat
A serialization/deserialization format supported by the Serde library.
Currently supported formats:
| Name | Learn More |
| :----- | :------------------- |
| `json` | https://www.json.org |
| `yaml` | https://yaml.org |
| `toml` | https://toml.io |
---
### CompressDecompressFormat
A compression/decompression format supported by the Serde library.
Currently supported formats:
| Name | Learn More |
| :------- | :-------------------------------- |
| `brotli` | https://github.com/google/brotli |
| `gzip` | https://www.gnu.org/software/gzip |
| `lz4` | https://github.com/lz4/lz4 |
| `zlib` | https://www.zlib.net |
---
### HashAlgorithm
A hash algorithm supported by the Serde library.
Currently supported algorithms:
| Name | Learn More |
| :--------- | :----------------------------------- |
| `md5` | https://en.wikipedia.org/wiki/MD5 |
| `sha1` | https://en.wikipedia.org/wiki/SHA-1 |
| `sha224` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha256` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha384` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha512` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha3-224` | https://en.wikipedia.org/wiki/SHA-3 |
| `sha3-256` | https://en.wikipedia.org/wiki/SHA-3 |
| `sha3-384` | https://en.wikipedia.org/wiki/SHA-3 |
| `sha3-512` | https://en.wikipedia.org/wiki/SHA-3 |
| `blake3` | https://en.wikipedia.org/wiki/BLAKE3 |
---