From 8c14c3cda3f1f8c6c054ed80fb7e5b64ccce34b4 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Sat, 22 Jul 2023 11:36:09 +0200 Subject: [PATCH] Make typedef comments moonwave-compatible --- docs/typedefs/FS.luau | 16 ++++++++-------- docs/typedefs/Net.luau | 28 ++++++++++++++-------------- docs/typedefs/Process.luau | 4 ++-- docs/typedefs/Roblox.luau | 12 ++++++------ docs/typedefs/Serde.luau | 8 ++++---- docs/typedefs/Stdio.luau | 9 +++++---- 6 files changed, 39 insertions(+), 38 deletions(-) diff --git a/docs/typedefs/FS.luau b/docs/typedefs/FS.luau index 520afe1..3aa051b 100644 --- a/docs/typedefs/FS.luau +++ b/docs/typedefs/FS.luau @@ -1,7 +1,7 @@ export type MetadataKind = "file" | "dir" | "symlink" --[=[ - @type MetadataPermissions + @interface MetadataPermissions @within FS Permissions for the given file or directory. @@ -17,7 +17,7 @@ export type MetadataPermissions = { -- FIXME: We lose doc comments here because of the union type --[=[ - @type Metadata + @interface Metadata @within FS Metadata for the given file or directory. @@ -51,7 +51,7 @@ export type Metadata = { } --[=[ - @type WriteOptions + @interface WriteOptions @within FS Options for filesystem APIs what write to files and/or directories. @@ -90,7 +90,7 @@ export type WriteOptions = { return { --[=[ @within FS - @must_use + @tag must_use Reads a file at `path`. @@ -109,7 +109,7 @@ return { end, --[=[ @within FS - @must_use + @tag must_use Reads entries in a directory at `path`. @@ -184,7 +184,7 @@ return { removeDir = function(path: string) end, --[=[ @within FS - @must_use + @tag must_use Gets metadata for the given path. @@ -201,7 +201,7 @@ return { end, --[=[ @within FS - @must_use + @tag must_use Checks if a given path is a file. @@ -218,7 +218,7 @@ return { end, --[=[ @within FS - @must_use + @tag must_use Checks if a given path is a directory. diff --git a/docs/typedefs/Net.luau b/docs/typedefs/Net.luau index 139282b..9b495f8 100644 --- a/docs/typedefs/Net.luau +++ b/docs/typedefs/Net.luau @@ -1,7 +1,7 @@ export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS" | "PATCH" --[=[ - @type FetchParamsOptions + @interface FetchParamsOptions @within Net Extra options for `FetchParams`. @@ -15,7 +15,7 @@ export type FetchParamsOptions = { } --[=[ - @type FetchParams + @interface FetchParams @within Net Parameters for sending network requests with `net.request`. @@ -39,8 +39,8 @@ export type FetchParams = { } --[=[ - @type FetchResponse - @within new + @interface FetchResponse + @within Net Response type for sending network requests with `net.request`. @@ -61,7 +61,7 @@ export type FetchResponse = { } --[=[ - @type ServeRequest + @interface ServeRequest @within Net Data type for requests in `net.serve`. @@ -83,7 +83,7 @@ export type ServeRequest = { } --[=[ - @type ServeResponse + @interface ServeResponse @within Net Response type for requests in `net.serve`. @@ -104,7 +104,7 @@ type ServeHttpHandler = (request: ServeRequest) -> string | ServeResponse type ServeWebSocketHandler = (socket: WebSocket) -> () --[=[ - @type ServeConfig + @interface ServeConfig @within Net Configuration for `net.serve`. @@ -120,7 +120,7 @@ export type ServeConfig = { } --[=[ - @type ServeHandle + @interface ServeHandle @within Net A handle to a currently running web server, containing a single `stop` function to gracefully shut down the web server. @@ -130,7 +130,7 @@ export type ServeHandle = { } --[=[ - @type WebSocket + @interface WebSocket @within Net A reference to a web socket connection. @@ -212,7 +212,7 @@ return { end, --[=[ @within Net - @must_use + @tag must_use Connects to a web socket at the given URL. @@ -241,7 +241,7 @@ return { end, --[=[ @within Net - @must_use + @tag must_use Encodes the given value as JSON. @@ -254,7 +254,7 @@ return { end, --[=[ @within Net - @must_use + @tag must_use Decodes the given JSON string into a lua value. @@ -266,7 +266,7 @@ return { end, --[=[ @within Net - @must_use + @tag must_use Encodes the given string using URL encoding. @@ -279,7 +279,7 @@ return { end, --[=[ @within Net - @must_use + @tag must_use Decodes the given string using URL decoding. diff --git a/docs/typedefs/Process.luau b/docs/typedefs/Process.luau index 6b82c32..4fcc7a7 100644 --- a/docs/typedefs/Process.luau +++ b/docs/typedefs/Process.luau @@ -4,7 +4,7 @@ export type Arch = "x86_64" | "aarch64" export type SpawnOptionsStdio = "inherit" | "default" --[=[ - @type SpawnOptions + @interface SpawnOptions @within Process A dictionary of options for `process.spawn`, with the following available values: @@ -22,7 +22,7 @@ export type SpawnOptions = { } --[=[ - @type SpawnResult + @interface SpawnResult @within Process Result type for child processes in `process.spawn`. diff --git a/docs/typedefs/Roblox.luau b/docs/typedefs/Roblox.luau index 2801e32..63581d2 100644 --- a/docs/typedefs/Roblox.luau +++ b/docs/typedefs/Roblox.luau @@ -216,7 +216,7 @@ export type DataModel = return { --[=[ @within Roblox - @must_use + @tag must_use Deserializes a place into a DataModel instance. @@ -241,7 +241,7 @@ return { end, --[=[ @within Roblox - @must_use + @tag must_use Deserializes a model into an array of instances. @@ -266,7 +266,7 @@ return { end, --[=[ @within Roblox - @must_use + @tag must_use Serializes a place from a DataModel instance. @@ -290,7 +290,7 @@ return { end, --[=[ @within Roblox - @must_use + @tag must_use Serializes one or more instances as a model. @@ -314,7 +314,7 @@ return { end, --[=[ @within Roblox - @must_use + @tag must_use Gets the current auth cookie, for usage with Roblox web APIs. @@ -353,7 +353,7 @@ return { end, --[=[ @within Roblox - @must_use + @tag must_use Gets the bundled reflection database. diff --git a/docs/typedefs/Serde.luau b/docs/typedefs/Serde.luau index 2771e5b..a42d256 100644 --- a/docs/typedefs/Serde.luau +++ b/docs/typedefs/Serde.luau @@ -30,7 +30,7 @@ export type CompressDecompressFormat = "brotli" | "gzip" | "lz4" | "zlib" return { --[=[ @within Serde - @must_use + @tag must_use Encodes the given value using the given format. @@ -52,7 +52,7 @@ return { end, --[=[ @within Serde - @must_use + @tag must_use Decodes the given string using the given format into a lua value. @@ -73,7 +73,7 @@ return { end, --[=[ @within Serde - @must_use + @tag must_use Compresses the given string using the given format. @@ -95,7 +95,7 @@ return { end, --[=[ @within Serde - @must_use + @tag must_use Decompresses the given string using the given format. diff --git a/docs/typedefs/Stdio.luau b/docs/typedefs/Stdio.luau index fbd7134..eb03304 100644 --- a/docs/typedefs/Stdio.luau +++ b/docs/typedefs/Stdio.luau @@ -20,7 +20,8 @@ type PromptFn = ( --[=[ @within Stdio - @must_use + @function prompt + @tag must_use Prompts for user input using the wanted kind of prompt: @@ -62,7 +63,7 @@ end return { --[=[ @within Stdio - @must_use + @tag must_use Return an ANSI string that can be used to modify the persistent output color. @@ -85,7 +86,7 @@ return { end, --[=[ @within Stdio - @must_use + @tag must_use Return an ANSI string that can be used to modify the persistent output style. @@ -108,7 +109,7 @@ return { end, --[=[ @within Stdio - @must_use + @tag must_use Formats arguments into a human-readable string with syntax highlighting for tables.