Skip to content

Commit 6e9c51f

Browse files
committed
Reduce param supports 6 to 3 since tsc spend unbearable amounts of time on type checking
1 parent cb62414 commit 6e9c51f

2 files changed

Lines changed: 75 additions & 218 deletions

File tree

packages/fedify/src/federation/builder.ts

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,29 +1206,6 @@ export class FederationBuilderImpl<TContextData>
12061206
return setters;
12071207
}
12081208

1209-
setCollectionDispatcher<
1210-
TObject extends Object,
1211-
TParam extends string,
1212-
>(
1213-
name: string | symbol,
1214-
// deno-lint-ignore no-explicit-any
1215-
itemType: (new (...args: any[]) => TObject) & { typeId: URL },
1216-
path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
1217-
TParam
1218-
>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
1219-
TParam
1220-
>}${string}`,
1221-
dispatcher: CustomCollectionDispatcher<
1222-
TObject,
1223-
TParam,
1224-
RequestContext<TContextData>,
1225-
TContextData
1226-
>,
1227-
): CustomCollectionCallbackSetters<
1228-
TParam,
1229-
RequestContext<TContextData>,
1230-
TContextData
1231-
>;
12321209
setCollectionDispatcher<
12331210
TObject extends Object,
12341211
TParam extends string,
@@ -1349,52 +1326,6 @@ export class FederationBuilderImpl<TContextData>
13491326
);
13501327
}
13511328

1352-
setOrderedCollectionDispatcher<
1353-
TObject extends Object,
1354-
TParam extends string,
1355-
>(
1356-
name: string | symbol,
1357-
// deno-lint-ignore no-explicit-any
1358-
itemType: (new (...args: any[]) => TObject) & { typeId: URL },
1359-
path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
1360-
TParam
1361-
>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
1362-
TParam
1363-
>}${string}${Rfc6570Expression<TParam>}${string}`,
1364-
dispatcher: CustomCollectionDispatcher<
1365-
TObject,
1366-
TParam,
1367-
RequestContext<TContextData>,
1368-
TContextData
1369-
>,
1370-
): CustomCollectionCallbackSetters<
1371-
TParam,
1372-
RequestContext<TContextData>,
1373-
TContextData
1374-
>;
1375-
setOrderedCollectionDispatcher<
1376-
TObject extends Object,
1377-
TParam extends string,
1378-
>(
1379-
name: string | symbol,
1380-
// deno-lint-ignore no-explicit-any
1381-
itemType: (new (...args: any[]) => TObject) & { typeId: URL },
1382-
path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
1383-
TParam
1384-
>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
1385-
TParam
1386-
>}${string}`,
1387-
dispatcher: CustomCollectionDispatcher<
1388-
TObject,
1389-
TParam,
1390-
RequestContext<TContextData>,
1391-
TContextData
1392-
>,
1393-
): CustomCollectionCallbackSetters<
1394-
TParam,
1395-
RequestContext<TContextData>,
1396-
TContextData
1397-
>;
13981329
setOrderedCollectionDispatcher<
13991330
TObject extends Object,
14001331
TParam extends string,

packages/fedify/src/federation/federation.ts

Lines changed: 75 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -458,79 +458,81 @@ export interface Federatable<TContextData> {
458458
sharedInboxPath?: string,
459459
): InboxListenerSetters<TContextData>;
460460

461-
/**
462-
* Registers a collection of objects dispatcher.
463-
*
464-
* @template TContextData The context data to pass to the {@link Context}.
465-
* @template TObject The type of objects to dispatch.
466-
* @template TParam The parameter names of the requested URL.
467-
* @param name A unique name for the collection dispatcher.
468-
* @param itemType The Activity Vocabulary class of the object to dispatch.
469-
* @param path The URI path pattern for the collection dispatcher.
470-
* The syntax is based on URI Template
471-
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
472-
* The path must have one or more variables.
473-
* @param dispatcher A collection dispatcher callback to register.
474-
*/
475-
setCollectionDispatcher<TObject extends Object, TParam extends string>(
476-
name: string | symbol,
477-
// deno-lint-ignore no-explicit-any
478-
itemType: (new (...args: any[]) => TObject) & { typeId: URL },
479-
path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
480-
TParam
481-
>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
482-
TParam
483-
>}${string}`,
484-
dispatcher: CustomCollectionDispatcher<
485-
TObject,
486-
TParam,
487-
RequestContext<TContextData>,
488-
TContextData
489-
>,
490-
): CustomCollectionCallbackSetters<
491-
TParam,
492-
RequestContext<TContextData>,
493-
TContextData
494-
>;
495-
496-
/**
497-
* Registers a collection of objects dispatcher.
498-
*
499-
* @template TContextData The context data to pass to the {@link Context}.
500-
* @template TObject The type of objects to dispatch.
501-
* @template TParam The parameter names of the requested URL.
502-
* @param name A unique name for the collection dispatcher.
503-
* @param itemType The Activity Vocabulary class of the object to dispatch.
504-
* @param path The URI path pattern for the collection dispatcher.
505-
* The syntax is based on URI Template
506-
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
507-
* The path must have one or more variables.
508-
* @param dispatcher A collection dispatcher callback to register.
509-
*/
510-
setCollectionDispatcher<TObject extends Object, TParam extends string>(
511-
name: string | symbol,
512-
// deno-lint-ignore no-explicit-any
513-
itemType: (new (...args: any[]) => TObject) & { typeId: URL },
514-
path: `${string}${Rfc6570Expression<
515-
TParam
516-
>}${string}${Rfc6570Expression<
517-
TParam
518-
>}${string}${Rfc6570Expression<
519-
TParam
520-
>}${string}${Rfc6570Expression<
521-
TParam
522-
>}${string}`,
523-
dispatcher: CustomCollectionDispatcher<
524-
TObject,
525-
TParam,
526-
RequestContext<TContextData>,
527-
TContextData
528-
>,
529-
): CustomCollectionCallbackSetters<
530-
TParam,
531-
RequestContext<TContextData>,
532-
TContextData
533-
>;
461+
// /**
462+
// * Registers a collection of objects dispatcher.
463+
// *
464+
// * @template TContextData The context data to pass to the {@link Context}.
465+
// * @template TObject The type of objects to dispatch.
466+
// * @template TParam The parameter names of the requested URL.
467+
// * @param name A unique name for the collection dispatcher.
468+
// * @param itemType The Activity Vocabulary class of the object to dispatch.
469+
// * @param path The URI path pattern for the collection dispatcher.
470+
// * The syntax is based on URI Template
471+
// * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
472+
// * The path must have one or more variables.
473+
// * @param dispatcher A collection dispatcher callback to register.
474+
// */
475+
// setCollectionDispatcher<TObject extends Object, TParam extends string>(
476+
// name: string | symbol,
477+
// // deno-lint-ignore no-explicit-any
478+
// itemType: (new (...args: any[]) => TObject) & { typeId: URL },
479+
// path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
480+
// TParam
481+
// >}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
482+
// TParam
483+
// >}${string}${Rfc6570Expression<
484+
// TParam
485+
// >}${string}`,
486+
// dispatcher: CustomCollectionDispatcher<
487+
// TObject,
488+
// TParam,
489+
// RequestContext<TContextData>,
490+
// TContextData
491+
// >,
492+
// ): CustomCollectionCallbackSetters<
493+
// TParam,
494+
// RequestContext<TContextData>,
495+
// TContextData
496+
// >;
497+
498+
// /**
499+
// * Registers a collection of objects dispatcher.
500+
// *
501+
// * @template TContextData The context data to pass to the {@link Context}.
502+
// * @template TObject The type of objects to dispatch.
503+
// * @template TParam The parameter names of the requested URL.
504+
// * @param name A unique name for the collection dispatcher.
505+
// * @param itemType The Activity Vocabulary class of the object to dispatch.
506+
// * @param path The URI path pattern for the collection dispatcher.
507+
// * The syntax is based on URI Template
508+
// * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
509+
// * The path must have one or more variables.
510+
// * @param dispatcher A collection dispatcher callback to register.
511+
// */
512+
// setCollectionDispatcher<TObject extends Object, TParam extends string>(
513+
// name: string | symbol,
514+
// // deno-lint-ignore no-explicit-any
515+
// itemType: (new (...args: any[]) => TObject) & { typeId: URL },
516+
// path: `${string}${Rfc6570Expression<
517+
// TParam
518+
// >}${string}${Rfc6570Expression<
519+
// TParam
520+
// >}${string}${Rfc6570Expression<
521+
// TParam
522+
// >}${string}${Rfc6570Expression<
523+
// TParam
524+
// >}${string}`,
525+
// dispatcher: CustomCollectionDispatcher<
526+
// TObject,
527+
// TParam,
528+
// RequestContext<TContextData>,
529+
// TContextData
530+
// >,
531+
// ): CustomCollectionCallbackSetters<
532+
// TParam,
533+
// RequestContext<TContextData>,
534+
// TContextData
535+
// >;
534536

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

636-
/**
637-
* Registers an ordered collection of objects dispatcher.
638-
*
639-
* @template TContextData The context data to pass to the {@link Context}.
640-
* @template TObject The type of objects to dispatch.
641-
* @template TParam The parameter names of the requested URL.
642-
* @param name A unique name for the collection dispatcher.
643-
* @param itemType The Activity Vocabulary class of the object to dispatch.
644-
* @param path The URI path pattern for the collection dispatcher.
645-
* The syntax is based on URI Template
646-
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
647-
* The path must have one or more variables.
648-
* @param dispatcher A collection dispatcher callback to register.
649-
*/
650-
setOrderedCollectionDispatcher<
651-
TObject extends Object,
652-
TParam extends string,
653-
>(
654-
name: string | symbol,
655-
// deno-lint-ignore no-explicit-any
656-
itemType: (new (...args: any[]) => TObject) & { typeId: URL },
657-
path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
658-
TParam
659-
>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
660-
TParam
661-
>}${string}${Rfc6570Expression<TParam>}${string}`,
662-
dispatcher: CustomCollectionDispatcher<
663-
TObject,
664-
TParam,
665-
RequestContext<TContextData>,
666-
TContextData
667-
>,
668-
): CustomCollectionCallbackSetters<
669-
TParam,
670-
RequestContext<TContextData>,
671-
TContextData
672-
>;
673-
674-
/**
675-
* Registers an ordered collection of objects dispatcher.
676-
*
677-
* @template TContextData The context data to pass to the {@link Context}.
678-
* @template TObject The type of objects to dispatch.
679-
* @template TParam The parameter names of the requested URL.
680-
* @param name A unique name for the collection dispatcher.
681-
* @param itemType The Activity Vocabulary class of the object to dispatch.
682-
* @param path The URI path pattern for the collection dispatcher.
683-
* The syntax is based on URI Template
684-
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
685-
* The path must have one or more variables.
686-
* @param dispatcher A collection dispatcher callback to register.
687-
*/
688-
setOrderedCollectionDispatcher<
689-
TObject extends Object,
690-
TParam extends string,
691-
>(
692-
name: string | symbol,
693-
// deno-lint-ignore no-explicit-any
694-
itemType: (new (...args: any[]) => TObject) & { typeId: URL },
695-
path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
696-
TParam
697-
>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<
698-
TParam
699-
>}${string}`,
700-
dispatcher: CustomCollectionDispatcher<
701-
TObject,
702-
TParam,
703-
RequestContext<TContextData>,
704-
TContextData
705-
>,
706-
): CustomCollectionCallbackSetters<
707-
TParam,
708-
RequestContext<TContextData>,
709-
TContextData
710-
>;
711-
712638
/**
713639
* Registers an ordered collection of objects dispatcher.
714640
*

0 commit comments

Comments
 (0)