ServerCollection

Server Object

Used for transparent interaction with server scripts. Example of calling a server method from the client:

await  Server.rpc.doSomething();

Calling server methods with arguments of the following types is supported:

  • boolean;
  • number;
  • string.
    async function doSomethingWithArgs (n: number, s: string[], b?: boolean): Promise<void> {
      // ... 
    }; 
    
    Example of calling a server method with arguments from the client:
    await Server.rpc.doSomethingWithArgs(1, ['a', 'b', 'c'], true);
    
    For more information, see the help article [“Scripts in widgets”] (https://brix365.com/en/help/platform/client_server_scripts.html).

Hierarchy

  • ServerCollection

Properties

Readonly rpc

rpc: RPCMethodList

List of asynchronous functions in server scripts that match the signature:

(...args: any[]) => Promise<void>

Example:

async function doSomething(): Promise<void> {
    // ...  ... ... 
}