WeaverClient
The client backend of Weaver.
All of the logic here is for starting and handling controllers alongside the communication bridge with the server.
Types
WeaverMiddlewareMethod
type
WeaverMiddlewareMethod =
...any
→
(
boolean
,
...any
)
WeaverService
The type used for all services on the client.
WeaverController
interface
WeaverController {
Name:
string
--
The name of the controller.
[any]:
any
}
The type used for all controllers.
WeaverMiddlewareCallback
WeaverMiddleware
Middleware used by the client.
Properties
Player
This item is read only and cannot be modified. Read OnlyWeaverClient.Player:
Player
A reference to Players.LocalPlayer
that you can easily access through Weaver.
Util
This item is read only and cannot be modified. Read OnlyA module that contains all of the utility modules that Weaver exposes.
Functions
Start
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsWeaverClient.
Start
(
Middleware:
{
}
?
) →
(
)
Starts Weaver.
If any middleware is provided, it will be used as as the default if no services have their own within the optional Services
table.
caution
This will throw an error if Weaver is already started.
OnStart
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsWeaverClient.
OnStart
(
) →
(
)
Yields until Weaver has started. Useful for external modules that are not ran as controllers.
If Weaver has already started, this will not yield.
GetService
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsReturns the WeaverService found from the server.
This will yield until a service matching the name is found.
GetController
If the Name
is used for a controller, returns the WeaverController from the server.
caution
This will throw an error if Weaver has not started, or if Name
is not used for a controller.
GetControllers
Returns all WeaverControllers added.
caution
This will throw an error if Weaver has not started.
CreateController
Creates and adds a WeaverController before Weaver has started.
caution
This will throw an error if Weaver has started.
AddControllers
Adds all services from Handle to Weaver automatically.
Returns an array of all of the added WeaverControllers.