Commit 6e9c51f6 authored by Jiwon Kwon's avatar Jiwon Kwon
Browse files

Reduce param supports 6 to 3 since tsc spend unbearable amounts of time on type checking

parent cb624149
Loading
Loading
Loading
Loading
+0 −69
Original line number Diff line number Diff line
@@ -1206,29 +1206,6 @@ export class FederationBuilderImpl<TContextData>
    return setters;
  }

  setCollectionDispatcher<
    TObject extends Object,
    TParam extends string,
  >(
    name: string | symbol,
    // deno-lint-ignore no-explicit-any
    itemType: (new (...args: any[]) => TObject) & { typeId: URL },
    path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}`,
    dispatcher: CustomCollectionDispatcher<
      TObject,
      TParam,
      RequestContext<TContextData>,
      TContextData
    >,
  ): CustomCollectionCallbackSetters<
    TParam,
    RequestContext<TContextData>,
    TContextData
  >;
  setCollectionDispatcher<
    TObject extends Object,
    TParam extends string,
@@ -1349,52 +1326,6 @@ export class FederationBuilderImpl<TContextData>
    );
  }

  setOrderedCollectionDispatcher<
    TObject extends Object,
    TParam extends string,
  >(
    name: string | symbol,
    // deno-lint-ignore no-explicit-any
    itemType: (new (...args: any[]) => TObject) & { typeId: URL },
    path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}`,
    dispatcher: CustomCollectionDispatcher<
      TObject,
      TParam,
      RequestContext<TContextData>,
      TContextData
    >,
  ): CustomCollectionCallbackSetters<
    TParam,
    RequestContext<TContextData>,
    TContextData
  >;
  setOrderedCollectionDispatcher<
    TObject extends Object,
    TParam extends string,
  >(
    name: string | symbol,
    // deno-lint-ignore no-explicit-any
    itemType: (new (...args: any[]) => TObject) & { typeId: URL },
    path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}`,
    dispatcher: CustomCollectionDispatcher<
      TObject,
      TParam,
      RequestContext<TContextData>,
      TContextData
    >,
  ): CustomCollectionCallbackSetters<
    TParam,
    RequestContext<TContextData>,
    TContextData
  >;
  setOrderedCollectionDispatcher<
    TObject extends Object,
    TParam extends string,
+75 −149
Original line number Diff line number Diff line
@@ -458,79 +458,81 @@ export interface Federatable<TContextData> {
    sharedInboxPath?: string,
  ): InboxListenerSetters<TContextData>;

  /**
   * Registers a collection of objects dispatcher.
   *
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of objects to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param name A unique name for the collection dispatcher.
   * @param itemType The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the collection dispatcher.
   *             The syntax is based on URI Template
   *             ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
   *             The path must have one or more variables.
   * @param dispatcher A collection dispatcher callback to register.
   */
  setCollectionDispatcher<TObject extends Object, TParam extends string>(
    name: string | symbol,
    // deno-lint-ignore no-explicit-any
    itemType: (new (...args: any[]) => TObject) & { typeId: URL },
    path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}`,
    dispatcher: CustomCollectionDispatcher<
      TObject,
      TParam,
      RequestContext<TContextData>,
      TContextData
    >,
  ): CustomCollectionCallbackSetters<
    TParam,
    RequestContext<TContextData>,
    TContextData
  >;

  /**
   * Registers a collection of objects dispatcher.
   *
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of objects to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param name A unique name for the collection dispatcher.
   * @param itemType The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the collection dispatcher.
   *             The syntax is based on URI Template
   *             ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
   *             The path must have one or more variables.
   * @param dispatcher A collection dispatcher callback to register.
   */
  setCollectionDispatcher<TObject extends Object, TParam extends string>(
    name: string | symbol,
    // deno-lint-ignore no-explicit-any
    itemType: (new (...args: any[]) => TObject) & { typeId: URL },
    path: `${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<
      TParam
    >}${string}`,
    dispatcher: CustomCollectionDispatcher<
      TObject,
      TParam,
      RequestContext<TContextData>,
      TContextData
    >,
  ): CustomCollectionCallbackSetters<
    TParam,
    RequestContext<TContextData>,
    TContextData
  >;
  // /**
  //  * Registers a collection of objects dispatcher.
  //  *
  //  * @template TContextData The context data to pass to the {@link Context}.
  //  * @template TObject The type of objects to dispatch.
  //  * @template TParam The parameter names of the requested URL.
  //  * @param name A unique name for the collection dispatcher.
  //  * @param itemType The Activity Vocabulary class of the object to dispatch.
  //  * @param path The URI path pattern for the collection dispatcher.
  //  *             The syntax is based on URI Template
  //  *             ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
  //  *             The path must have one or more variables.
  //  * @param dispatcher A collection dispatcher callback to register.
  //  */
  // setCollectionDispatcher<TObject extends Object, TParam extends string>(
  //   name: string | symbol,
  //   // deno-lint-ignore no-explicit-any
  //   itemType: (new (...args: any[]) => TObject) & { typeId: URL },
  //   path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
  //     TParam
  //   >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
  //     TParam
  //   >}${string}${Rfc6570Expression<
  //     TParam
  //   >}${string}`,
  //   dispatcher: CustomCollectionDispatcher<
  //     TObject,
  //     TParam,
  //     RequestContext<TContextData>,
  //     TContextData
  //   >,
  // ): CustomCollectionCallbackSetters<
  //   TParam,
  //   RequestContext<TContextData>,
  //   TContextData
  // >;

  // /**
  //  * Registers a collection of objects dispatcher.
  //  *
  //  * @template TContextData The context data to pass to the {@link Context}.
  //  * @template TObject The type of objects to dispatch.
  //  * @template TParam The parameter names of the requested URL.
  //  * @param name A unique name for the collection dispatcher.
  //  * @param itemType The Activity Vocabulary class of the object to dispatch.
  //  * @param path The URI path pattern for the collection dispatcher.
  //  *             The syntax is based on URI Template
  //  *             ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
  //  *             The path must have one or more variables.
  //  * @param dispatcher A collection dispatcher callback to register.
  //  */
  // setCollectionDispatcher<TObject extends Object, TParam extends string>(
  //   name: string | symbol,
  //   // deno-lint-ignore no-explicit-any
  //   itemType: (new (...args: any[]) => TObject) & { typeId: URL },
  //   path: `${string}${Rfc6570Expression<
  //     TParam
  //   >}${string}${Rfc6570Expression<
  //     TParam
  //   >}${string}${Rfc6570Expression<
  //     TParam
  //   >}${string}${Rfc6570Expression<
  //     TParam
  //   >}${string}`,
  //   dispatcher: CustomCollectionDispatcher<
  //     TObject,
  //     TParam,
  //     RequestContext<TContextData>,
  //     TContextData
  //   >,
  // ): CustomCollectionCallbackSetters<
  //   TParam,
  //   RequestContext<TContextData>,
  //   TContextData
  // >;

  /**
   * Registers a collection of objects dispatcher.
@@ -633,82 +635,6 @@ export interface Federatable<TContextData> {
    TContextData
  >;

  /**
   * Registers an ordered collection of objects dispatcher.
   *
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of objects to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param name A unique name for the collection dispatcher.
   * @param itemType The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the collection dispatcher.
   *             The syntax is based on URI Template
   *             ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
   *             The path must have one or more variables.
   * @param dispatcher A collection dispatcher callback to register.
   */
  setOrderedCollectionDispatcher<
    TObject extends Object,
    TParam extends string,
  >(
    name: string | symbol,
    // deno-lint-ignore no-explicit-any
    itemType: (new (...args: any[]) => TObject) & { typeId: URL },
    path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}`,
    dispatcher: CustomCollectionDispatcher<
      TObject,
      TParam,
      RequestContext<TContextData>,
      TContextData
    >,
  ): CustomCollectionCallbackSetters<
    TParam,
    RequestContext<TContextData>,
    TContextData
  >;

  /**
   * Registers an ordered collection of objects dispatcher.
   *
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of objects to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param name A unique name for the collection dispatcher.
   * @param itemType The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the collection dispatcher.
   *             The syntax is based on URI Template
   *             ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
   *             The path must have one or more variables.
   * @param dispatcher A collection dispatcher callback to register.
   */
  setOrderedCollectionDispatcher<
    TObject extends Object,
    TParam extends string,
  >(
    name: string | symbol,
    // deno-lint-ignore no-explicit-any
    itemType: (new (...args: any[]) => TObject) & { typeId: URL },
    path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
      TParam
    >}${string}`,
    dispatcher: CustomCollectionDispatcher<
      TObject,
      TParam,
      RequestContext<TContextData>,
      TContextData
    >,
  ): CustomCollectionCallbackSetters<
    TParam,
    RequestContext<TContextData>,
    TContextData
  >;

  /**
   * Registers an ordered collection of objects dispatcher.
   *