This is a work in progress! It will be published to npm as @rbxts/buremo once
a stable version is complete.
Flamework must be setup on your project for the macros to work. If you do not
have it installed, follow
this guide.
You do not need to use any other features of Flamework such as
Flamework.ignite.
const remotes = createRemotes<{
test1: Remote<ToServer, [string]>;
test2: Remote<ToClient, [string], Unreliable>;
test3: {
test4: Remote<ToServer, [string]>;
test5: Remote<ToServer, [string]>;
test6: {
test7: Remote<ToServer, [string]>;
test8: Remote<ToServer, [string], Unreliable>;
};
};
test9: {
test10: Remote<ToServer, [string]>;
};
}>();function createRemotes<T>(
scope?: string,
reliableName?: string,
// *
): Remotes<T>;*(3rd, 4th and 5th paramaters omitted as they are populated by the Flamework transformer)
Example usage can be found at the quick example.
An object populated with Remote as properties. It can be nested.
You can use the full scope of the TS type system here, so you can intersect
objects, use other types to create the Remote property etc.
If you have two instances of Buremo in your game, you will need to change this scope. You can do this by passing in a string.
It defaults to REMOTES.
If the obfuscation option of rbxts-transformer-flamework is set to true, the
scope name will instead default to UUID.
Because Buremo batches reliables, this name is used for the remote. If you wish to change it from the default you can pass in a string.
It defaults to Reliable.
If there is a remote with the name Reliable, Buremo will automatically find an
alternative name.
If obfuscation option of rbxts-transformer-flamework is set to true, the
reliable name will instead default to UUID.
interface Remote<Mode, Args, Type> {}Must be one of ToClient or ToServer.
Must be an array.
It has a default value of [] if not specified.
Must be one of Reliable or Unreliable.
Has a default value of Reliable if not specified.
This is a nominal type that sets the direction of the Remote to be sending data to the client.
This is a nominal type that sets the direction of the Remote to be sending data to the server.
This is a nominal type that makes the Remote use a RemoteEvent. The
remote will be batched with other reliables and sent per frame.
This is a nominal type that makes the Remote use an
UnreliableRemoteEvent.