Make typedef comments moonwave-compatible

This commit is contained in:
Filip Tibell 2023-07-22 11:36:09 +02:00
parent 462ccb6d15
commit 8c14c3cda3
No known key found for this signature in database
6 changed files with 39 additions and 38 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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`.

View file

@ -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.

View file

@ -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.

View file

@ -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.