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
        );
    }
}