Unverified Commit 6c3b3daa authored by Hong Minhee (洪 民憙)'s avatar Hong Minhee (洪 民憙) Committed by GitHub
Browse files

Merge pull request #340 from beberiche/fix-336/replace_@typeParam

parents 8d4cae96 314e295d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ const logger = getLogger(["fedify", "compat", "transformers"]);
 * https://example.com/#Follow/12345678-1234-5678-1234-567812345678
 * ```
 *
 * @typeParam TContextData The type of the context data.
 * @template TContextData The type of the context data.
 * @param activity The activity to assign an ID to.
 * @param context The context of the activity.
 * @return The activity with an ID assigned.
@@ -80,7 +80,7 @@ export function autoIdAssigner<TContextData>(
 *
 * As some ActivityPub implementations like Threads fail to deal with inlined
 * actor objects, this transformer can be used to work around this issue.
 * @typeParam TContextData The type of the context data.
 * @template TContextData The type of the context data.
 * @param activity The activity to dehydrate the actor property of.
 * @param context The context of the activity.
 * @returns The dehydrated activity.
@@ -99,7 +99,7 @@ export function actorDehydrator<TContextData>(
/**
 * Gets the default activity transformers that are applied to all outgoing
 * activities.
 * @typeParam TContextData The type of the context data.
 * @template TContextData The type of the context data.
 * @returns The default activity transformers.
 * @since 1.4.0
 */
+1 −1
Original line number Diff line number Diff line
@@ -1352,7 +1352,7 @@ export class FederationBuilderImpl<TContextData>
  /**
   * Get the URL path for a custom collection.
   * If the collection is not registered, returns null.
   * @typeParam TParam The parameter names of the requested URL.
   * @template TParam The parameter names of the requested URL.
   * @param {string | symbol} name The name of the custom collection.
   * @param {TParam} values The values to fill in the URL parameters.
   * @returns {string | null} The URL path for the custom collection, or null if not registered.
+34 −34
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import type { SenderKeyPair } from "./send.ts";
/**
 * A callback that dispatches a {@link NodeInfo} object.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 */
export type NodeInfoDispatcher<TContextData> = (
  context: RequestContext<TContextData>,
@@ -18,7 +18,7 @@ export type NodeInfoDispatcher<TContextData> = (
/**
 * A callback that dispatches an {@link Actor} object.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The request context.
 * @param identifier The actor's internal identifier or username.
 */
@@ -30,7 +30,7 @@ export type ActorDispatcher<TContextData> = (
/**
 * A callback that dispatches key pairs for an actor.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The context.
 * @param identifier The actor's internal identifier or username.
 * @returns The key pairs.
@@ -44,7 +44,7 @@ export type ActorKeyPairsDispatcher<TContextData> = (
/**
 * A callback that maps a WebFinger username to the corresponding actor's
 * internal identifier, or `null` if the username is not found.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The context.
 * @param username The WebFinger username.
 * @returns The actor's internal identifier, or `null` if the username is not
@@ -59,7 +59,7 @@ export type ActorHandleMapper<TContextData> = (
/**
 * A callback that maps a WebFinger query to the corresponding actor's
 * internal identifier or username, or `null` if the query is not found.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The request context.
 * @param resource The URL that was queried through WebFinger.
 * @returns The actor's internal identifier or username, or `null` if the query
@@ -78,9 +78,9 @@ export type ActorAliasMapper<TContextData> = (
/**
 * A callback that dispatches an object.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @typeParam TObject The type of object to dispatch.
 * @typeParam TParam The parameter names of the requested URL.
 * @template TContextData The context data to pass to the {@link Context}.
 * @template TObject The type of object to dispatch.
 * @template TParam The parameter names of the requested URL.
 * @since 0.7.0
 */
export type ObjectDispatcher<
@@ -95,11 +95,11 @@ export type ObjectDispatcher<
/**
 * A callback that dispatches a collection.
 *
 * @typeParam TItem The type of items in the collection.
 * @typeParam TContext The type of the context. {@link Context} or
 * @template TItem The type of items in the collection.
 * @template TContext The type of the context. {@link Context} or
 *                     {@link RequestContext}.
 * @typeParam TContextData The context data to pass to the `TContext`.
 * @typeParam TFilter The type of the filter, if any.
 * @template TContextData The context data to pass to the `TContext`.
 * @template TFilter The type of the filter, if any.
 * @param context The context.
 * @param identifier The internal identifier or the username of the collection
 *                   owner.
@@ -122,7 +122,7 @@ export type CollectionDispatcher<
/**
 * A callback that counts the number of items in a collection.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The context.
 * @param identifier The internal identifier or the username of the collection
 *                   owner.
@@ -137,10 +137,10 @@ export type CollectionCounter<TContextData, TFilter> = (
/**
 * A callback that returns a cursor for a collection.
 *
 * @typeParam TContext The type of the context. {@link Context} or
 * @template TContext The type of the context. {@link Context} or
 *                     {@link RequestContext}.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @typeParam TFilter The type of the filter, if any.
 * @template TContextData The context data to pass to the {@link Context}.
 * @template TFilter The type of the filter, if any.
 * @param context The context.
 * @param identifier The internal identifier or the username of the collection
 *                   owner.
@@ -159,8 +159,8 @@ export type CollectionCursor<
/**
 * A callback that listens for activities in an inbox.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @typeParam TActivity The type of activity to listen for.
 * @template TContextData The context data to pass to the {@link Context}.
 * @template TActivity The type of activity to listen for.
 * @param context The inbox context.
 * @param activity The activity that was received.
 */
@@ -172,7 +172,7 @@ export type InboxListener<TContextData, TActivity extends Activity> = (
/**
 * A callback that handles errors in an inbox.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The inbox context.
 */
export type InboxErrorHandler<TContextData> = (
@@ -184,7 +184,7 @@ export type InboxErrorHandler<TContextData> = (
 * A callback that dispatches the key pair for the authenticated document loader
 * of the {@link Context} passed to the shared inbox listener.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The context.
 * @returns The username or the internal identifier of the actor or the key pair
 *          for the authenticated document loader of the {@link Context} passed
@@ -224,7 +224,7 @@ export type OutboxErrorHandler = (
/**
 * A callback that determines if a request is authorized or not.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The request context.
 * @param identifier The internal identifier of the actor that is being requested.
 * @param signedKey *Deprecated in Fedify 1.5.0 in favor of
@@ -250,8 +250,8 @@ export type AuthorizePredicate<TContextData> = (
/**
 * A callback that determines if a request is authorized or not.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @typeParam TParam The parameter names of the requested URL.
 * @template TContextData The context data to pass to the {@link Context}.
 * @template TParam The parameter names of the requested URL.
 * @param context The request context.
 * @param values The parameters of the requested URL.
 * @param signedKey *Deprecated in Fedify 1.5.0 in favor of
@@ -277,12 +277,12 @@ export type ObjectAuthorizePredicate<TContextData, TParam extends string> = (
/**
 * A callback that dispatches a custom collection.
 *
 * @typeParam TItem The type of items in the collection.
 * @typeParam TParams The parameter names of the requested URL.
 * @typeParam TContext The type of the context. {@link Context} or
 * @template TItem The type of items in the collection.
 * @template TParams The parameter names of the requested URL.
 * @template TContext The type of the context. {@link Context} or
 *                     {@link RequestContext}.
 * @typeParam TContextData The context data to pass to the `TContext`.
 * @typeParam TFilter The type of the filter, if any.
 * @template TContextData The context data to pass to the `TContext`.
 * @template TFilter The type of the filter, if any.
 * @param context The context.
 * @param values The parameters of the requested URL.
 * @param cursor The cursor to start the collection from, or `null` to dispatch
@@ -303,8 +303,8 @@ export type CustomCollectionDispatcher<
/**
 * A callback that counts the number of items in a custom collection.
 *
 * @typeParam TParams The parameter names of the requested URL.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TParams The parameter names of the requested URL.
 * @template TContextData The context data to pass to the {@link Context}.
 * @param context The context.
 * @param values The parameters of the requested URL.
 * @since 1.8.0
@@ -320,11 +320,11 @@ export type CustomCollectionCounter<
/**
 * A callback that returns a cursor for a custom collection.
 *
 * @typeParam TParams The parameter names of the requested URL.
 * @typeParam TContext The type of the context. {@link Context} or
 * @template TParams The parameter names of the requested URL.
 * @template TContext The type of the context. {@link Context} or
 *                     {@link RequestContext}.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @typeParam TFilter The type of the filter, if any.
 * @template TContextData The context data to pass to the {@link Context}.
 * @template TFilter The type of the filter, if any.
 * @param context The context.
 * @param values The parameters of the requested URL.
 * @since 1.8.0
+38 −38
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ export interface FederationStartQueueOptions {

/**
 * A common interface between {@link Federation} and {@link FederationBuilder}.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @since 1.6.0
 */
export interface Federatable<TContextData> {
@@ -111,9 +111,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers an object dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of object to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of object to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param cls The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the object dispatcher.  The syntax is
   *             based on URI Template
@@ -132,9 +132,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers an object dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of object to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of object to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param cls The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the object dispatcher.  The syntax is
   *             based on URI Template
@@ -153,9 +153,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers an object dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of object to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of object to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param cls The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the object dispatcher.  The syntax is
   *             based on URI Template
@@ -174,9 +174,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers an object dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of object to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of object to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param cls The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the object dispatcher.  The syntax is
   *             based on URI Template
@@ -195,9 +195,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers an object dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of object to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of object to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param cls The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the object dispatcher.  The syntax is
   *             based on URI Template
@@ -215,9 +215,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers an object dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of object to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @template TContextData The context data to pass to the {@link Context}.
   * @template TObject The type of object to dispatch.
   * @template TParam The parameter names of the requested URL.
   * @param cls The Activity Vocabulary class of the object to dispatch.
   * @param path The URI path pattern for the object dispatcher.  The syntax is
   *             based on URI Template
@@ -451,9 +451,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers a collection of objects dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of objects to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @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.
@@ -484,9 +484,9 @@ export interface Federatable<TContextData> {
  /**
   * Registers an ordered collection of objects dispatcher.
   *
   * @typeParam TContextData The context data to pass to the {@link Context}.
   * @typeParam TObject The type of objects to dispatch.
   * @typeParam TParam The parameter names of the requested URL.
   * @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.
@@ -521,7 +521,7 @@ export interface Federatable<TContextData> {
 *
 * It also provides a middleware interface for handling requests before your
 * web framework's router; see {@link Federation.fetch}.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @since 0.13.0
 */
export interface Federation<TContextData> extends Federatable<TContextData> {
@@ -594,7 +594,7 @@ export interface Federation<TContextData> extends Federatable<TContextData> {
 * instantiation of the {@link Federation} object until the {@link build}
 * method is called so that dispatchers and listeners can be registered
 * before the {@link Federation} object is instantiated.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @since 1.6.0
 */
export interface FederationBuilder<TContextData>
@@ -610,7 +610,7 @@ export interface FederationBuilder<TContextData>

/**
 * Options for creating a {@link Federation} object.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @since 1.6.0
 */
export interface FederationOptions<TContextData> {
@@ -895,10 +895,10 @@ export interface ObjectCallbackSetters<
/**
 * Additional settings for a collection dispatcher.
 *
 * @typeParam TContext The type of the context.  {@link Context} or
 * @template TContext The type of the context.  {@link Context} or
 *                     {@link RequestContext}.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @typeParam TFilter The type of filter for the collection.
 * @template TContextData The context data to pass to the {@link Context}.
 * @template TFilter The type of filter for the collection.
 */
export interface CollectionCallbackSetters<
  TContext extends Context<TContextData>,
@@ -988,7 +988,7 @@ export interface InboxListenerSetters<TContextData> {
/**
 * Parameters of {@link Federation.fetch} method.
 *
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @template TContextData The context data to pass to the {@link Context}.
 * @since 0.6.0
 */
export interface FederationFetchOptions<TContextData> {
@@ -1026,11 +1026,11 @@ export interface FederationFetchOptions<TContextData> {
/**
 * Additional settings for a custom collection dispatcher.
 *
 * @typeParam TParams The type of the parameters in the URL path.
 * @typeParam TContext The type of the context.  {@link Context} or
 * @template TParams The type of the parameters in the URL path.
 * @template TContext The type of the context.  {@link Context} or
 *                     {@link RequestContext}.
 * @typeParam TContextData The context data to pass to the {@link Context}.
 * @typeParam TFilter The type of filter for the collection.
 * @template TContextData The context data to pass to the {@link Context}.
 * @template TFilter The type of filter for the collection.
 */
export interface CustomCollectionCallbackSetters<
  TParams extends Record<string, string>,
@@ -1106,7 +1106,7 @@ export interface CustomCollectionCallbackSetters<
 * Represents an object with a type ID, which is either a constructor or an
 * instance of the object.
 *
 * @typeParam TObject The type of the object.
 * @template TObject The type of the object.
 */
export type ConstructorWithTypeId<TObject extends Object> =
  // deno-lint-ignore no-explicit-any
@@ -1172,7 +1172,7 @@ type ParamPath<Param extends string> = `${string}{${Param}}${string}`;
/**
 * Converts union types to intersection types.
 *
 * @typeParam U - The union type to convert.
 * @template U - The union type to convert.
 * @returns The intersection type of the union.
 * @example
 * ```ts
+46 −46

File changed.

Preview size limit exceeded, changes collapsed.

Loading