UNPKG

rpc-typescript

Version:
19 lines (13 loc) 443 B
import { ProxyContext } from "../core/ProxyContext"; import { ProxyContractConfig } from "../types"; export function ProxyContract (config?: ProxyContractConfig): ClassDecorator { const props = config ?? { }; return (constructor: Function) => { const ctx = ProxyContext.getContext(props.contextDomain); return ctx.defineContract( props, constructor ); } }