  /**
   * {{ doc }}
   */
  {{ variant_name }}({{ direct_params }}): this;
  {{ variant_name }}({{ factory_params }}): (fn: (...args: any[]) => any) => (...args: any[]) => any;
  {{ variant_name }}({{ impl_params }}): this | ((fn: (...args: any[]) => any) => (...args: any[]) => any) {
{{ wrapper_code }}    if (handler !== undefined) {
      this._registrations.push(["{{ base_method }}", {{ metadata_array }}, handler]);
      return this;
    }
    return (fn: (...args: any[]) => any) => {
      this._registrations.push(["{{ base_method }}", {{ metadata_array }}, fn]);
      return fn;
    };
  }
