@itwin/ecschema-rpcinterface-common
Version:
Schema RPC Interface common interface
35 lines • 1.87 kB
TypeScript
import { IModelRpcProps, RpcInterface } from "@itwin/core-common";
import { SchemaKeyProps, SchemaProps } from "@itwin/ecschema-metadata";
/***
* Defines an RPC interface to get schema information from a given iModel context.
* Method @see getSchemaNames will return the names of schemas that live in this iModel.
* The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.
* @internal
*/
export declare abstract class ECSchemaRpcInterface extends RpcInterface {
/** The version of the RPC Interface. */
static version: string;
static readonly interfaceName = "ECSchemaRpcInterface";
static interfaceVersion: string;
/**
* Returns the RPC client instance for the frontend.
* @returns A client to communicate with the RPC Interface.
*/
static getClient(): ECSchemaRpcInterface;
/**
* Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call
* SchemaKey.fromJson() to parse the props to a SchemaKey.
* @param tokenProps The iModelToken props that hold the information which iModel is used.
* @returns An array of SchemaKeyProps.
*/
getSchemaKeys(_tokenProps: IModelRpcProps): Promise<SchemaKeyProps[]>;
/**
* Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which
* the client can call Schema.fromJson() to return a Schema.
* @param tokenProps The iModelToken props that hold the information which iModel is used.
* @param schemaName The name of the schema that shall be returned.
* @returns The SchemaProps.
*/
getSchemaJSON(_tokenProps: IModelRpcProps, _schemaName: string): Promise<SchemaProps | undefined>;
}
//# sourceMappingURL=ECSchemaRpcInterface.d.ts.map