import {
  PropertyKeyType,
  Decorator,
  DecoratorHelper,
} from '@overflow/core-js';

export interface RPCSubscriberDecoratorAttribute {
  method: string;
}

export class RPCSubscriberDecorator extends Decorator<RPCSubscriberDecoratorAttribute> {
  public constructor(attribute: RPCSubscriberDecoratorAttribute) {
    super(attribute);
  }

  public methodDecorator = <T>(target: Object, propertyKey: PropertyKeyType,
    descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void => {
  }

}

export function RPCSubscriber(attribute: RPCSubscriberDecoratorAttribute): MethodDecorator {
  const decorator = DecoratorHelper.register(RPCSubscriberDecorator, attribute);
  return decorator;
}

// export const RPCSubscriber = DecoratorHelper.create(RPCSubscriberDecorator);
