@itwin/core-common
Version:
iTwin.js components common to frontend and backend
49 lines • 2.65 kB
TypeScript
/** @packageDocumentation
* @module RpcInterface
*/
import { RpcInterfaceDefinition } from "../../RpcInterface";
import { RpcManager } from "../../RpcManager";
import { RpcConfiguration } from "../core/RpcConfiguration";
import { RpcRequestEventHandler } from "../core/RpcRequest";
import { BentleyCloudRpcProtocol } from "./BentleyCloudRpcProtocol";
import { OpenAPIInfo } from "./OpenAPI";
import { RpcRoutingToken } from "../core/RpcRoutingToken";
/** Initialization parameters for BentleyCloudRpcConfiguration.
* @beta
*/
export interface BentleyCloudRpcParams {
/** Identifies the remote server that implements a set of RpcInterfaces. Note that the ID of the remote server is not a URI or hostname. It is a string that matches a key in the orchestrator's app registry. */
info: OpenAPIInfo;
/** @internal The protocol for Bentley cloud RPC interface deployments */
protocol?: typeof BentleyCloudRpcProtocol;
/** The URI of the orchestrator that will route requests to the remote RpcInterface server. If not supplied, this default to the origin of the Web page. This is required only when calling initializeClient and only if the server is not the origin of the Web page. */
uriPrefix?: string;
/** @internal Handler for RPC request events. */
pendingRequestListener?: RpcRequestEventHandler;
/** An optional prefix for RPC operation URI paths. */
pathPrefix?: string;
}
/** Operating parameters for Bentley cloud RPC interface deployments.
* @beta
*/
export declare abstract class BentleyCloudRpcConfiguration extends RpcConfiguration {
/** Access-Control header values for backend servers that serve frontends using BentleyCloudRpcProtocol. */
static readonly accessControl: {
allowOrigin: string;
allowMethods: string;
allowHeaders: string;
};
/** @internal The protocol of the configuration. */
abstract readonly protocol: BentleyCloudRpcProtocol;
}
/** Coordinates usage of RPC interfaces for Bentley cloud deployments.
* @beta
*/
export declare class BentleyCloudRpcManager extends RpcManager {
/** @beta Initializes BentleyCloudRpcManager for the frontend of an application. */
static initializeClient(params: BentleyCloudRpcParams, interfaces: RpcInterfaceDefinition[], routing?: RpcRoutingToken): BentleyCloudRpcConfiguration;
/** @beta Initializes BentleyCloudRpcManager for the backend of an application. */
static initializeImpl(params: BentleyCloudRpcParams, interfaces: RpcInterfaceDefinition[]): BentleyCloudRpcConfiguration;
private static performInitialization;
}
//# sourceMappingURL=BentleyCloudRpcManager.d.ts.map