import { t } from "@rbxts/t";
import { ISharedNetwork } from ".";
import { SharedComponent } from "../shared-component";
export interface ISharedRemoteAction extends SharedRemoteAction {
/**
* Sends a request for the server to process. Returns a Promise that resolves
* with the return value of the server handler.
*
* Arguments are validated on the server before they are processed.
*
* @client
*/
(...args: A): Promise;
}
export declare class SharedRemoteAction implements ISharedNetwork {
static readonly RemoteFunctionIndefinitely = "__SHARED_COMPONENT_REMOTE_FUNCTION";
componentReferense: SharedComponent<{}, {}, Instance>;
name: string;
private guard;
private callback?;
constructor(guard: t.check);
static Indefinitely(obj: ISharedNetwork): obj is ISharedRemoteAction<[], unknown>;
readonly Identifier = "__SHARED_COMPONENT_REMOTE_FUNCTION";
Destroy(): void;
/**
* Binds a server-side handler to the remote. When a player makes a request,
* the handler will be invoked with the arguments passed, and the return
* value will be sent back to the player.
*
* Arguments passed to the remote must first pass the validators defined
* in the schema before they are passed to the handler. Otherwise, the
* request will be rejected.
*
* @server
*/
OnRequest(callback: (player: Player, ...args: A) => R): void;
/**
* Sends a request for the server to process. Returns a Promise that resolves
* with the return value of the server handler.
*
* Arguments are validated on the server before they are processed.
*
* @client
* @warning This function may throw with an error if:
* - Argument type validation fails on the server
* - The component is not connected
*/
Invoke(...args: A): Promise;
GetGuard(): t.check;
}