/** @packageDocumentation * @module RpcInterface */ import { IModelRpcProps } from "../../IModel"; import { RpcInterface, RpcInterfaceDefinition } from "../../RpcInterface"; import { RpcResponseCacheControl } from "./RpcConstants"; import { RpcInvocationCallback_T } from "./RpcInvocation"; import { RpcRequestCallback_T, RpcRequestInitialRetryIntervalSupplier_T, RpcRequestTokenSupplier_T, RpcResponseCachingCallback_T } from "./RpcRequest"; /** The policy for an RPC operation. * @public */ export declare class RpcOperationPolicy { /** Supplies the IModelRpcProps for an operation request. */ token: RpcRequestTokenSupplier_T; /** Supplies the initial retry interval for an operation request. */ retryInterval: RpcRequestInitialRetryIntervalSupplier_T; /** Called before every operation request on the frontend is sent. */ requestCallback: RpcRequestCallback_T; /** Called after every operation request on the frontend is sent. */ sentCallback: RpcRequestCallback_T; /** Called for every operation invocation on the backend. */ invocationCallback: RpcInvocationCallback_T; /** * Determines if caching is permitted for an operation response. * @note Not all RPC protocols support caching. */ allowResponseCaching: RpcResponseCachingCallback_T; /** Forces RpcConfiguration.strictMode for this operation. */ forceStrictMode: boolean; /** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */ allowTokenMismatch: boolean; } /** An RPC operation descriptor. * @public */ export declare class RpcOperation { /** A fallback token to use for RPC requests that do not semantically depend on an iModel. */ static fallbackToken: IModelRpcProps | undefined; /** Looks up an RPC operation by name. */ static lookup(target: string | RpcInterfaceDefinition, operationName: string): RpcOperation; /** Iterates the operations of an RPC interface definition. */ static forEach(definition: RpcInterfaceDefinition, callback: (operation: RpcOperation) => void): void; /** The RPC interface definition for this operation. */ readonly interfaceDefinition: RpcInterfaceDefinition; /** The name of this operation. */ readonly operationName: string; /** The version of this operation. */ get interfaceVersion(): string; /** The policy for this operation. */ policy: RpcOperationPolicy; /** @internal */ constructor(definition: RpcInterfaceDefinition, operation: string, policy: RpcOperationPolicy); /** @internal */ static computeOperationName(identifier: string): string; } /** @public */ export declare type RpcOperationPolicyProps = Partial; /** @public */ export declare namespace RpcOperation { /** Decorator for setting the policy for an RPC operation function. */ function setPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps): (target: T, propertyKey: string, descriptor: PropertyDescriptor) => void; /** Convenience decorator for setting an RPC operation policy that allows response caching. */ function allowResponseCaching(control?: RpcResponseCacheControl): (target: T, propertyKey: string, descriptor: PropertyDescriptor) => void; /** Convenience decorator for setting an RPC operation policy that supplies the IModelRpcProps for an operation. */ function setRoutingProps(handler: RpcRequestTokenSupplier_T): (target: T, propertyKey: string, descriptor: PropertyDescriptor) => void; /** Decorator for setting the default policy for an RPC interface definition class. */ function setDefaultPolicy(policy: RpcOperationPolicy | RpcOperationPolicyProps): (definition: RpcInterfaceDefinition) => void; } //# sourceMappingURL=RpcOperation.d.ts.map