* ```
*
- * @see https://react.dev/reference/react/Component#context
+ * @see {@link https://react.dev/reference/react/Component#context}
*/
// TODO (TypeScript 3.0): unknown
context: any;
@@ -482,7 +482,7 @@ declare namespace React {
constructor(props: Readonly | P);
/**
* @deprecated
- * @see https://legacy.reactjs.org/docs/legacy-context.html
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html}
*/
constructor(props: P, context: any);
@@ -698,8 +698,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
componentWillMount?(): void;
/**
@@ -712,8 +712,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use componentDidMount or the constructor instead
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
UNSAFE_componentWillMount?(): void;
/**
@@ -727,8 +727,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
/**
@@ -744,8 +744,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use static getDerivedStateFromProps instead
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
UNSAFE_componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
/**
@@ -757,8 +757,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
componentWillUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): void;
/**
@@ -772,8 +772,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use getSnapshotBeforeUpdate instead
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
UNSAFE_componentWillUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): void;
}
@@ -915,14 +915,14 @@ declare namespace React {
* context value, as given by the nearest context provider for the given context.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useContext
+ * @see {@link https://react.dev/reference/react/useContext}
*/
function useContext(context: Context /*, (not public API) observedBits?: number|boolean */): T;
/**
* Returns a stateful value, and a function to update it.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useState
+ * @see {@link https://react.dev/reference/react/useState}
*/
function useState(initialState: S | (() => S)): [S, Dispatch>];
// convenience overload when first argument is omitted
@@ -930,7 +930,7 @@ declare namespace React {
* Returns a stateful value, and a function to update it.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useState
+ * @see {@link https://react.dev/reference/react/useState}
*/
function useState(): [S | undefined, Dispatch>];
/**
@@ -941,7 +941,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload where dispatch could accept 0 arguments.
function useReducer, I>(
@@ -957,7 +957,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload where dispatch could accept 0 arguments.
function useReducer>(
@@ -973,7 +973,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload where "I" may be a subset of ReducerState; used to provide autocompletion.
// If "I" matches ReducerState exactly then the last overload will allow initializer to be omitted.
@@ -991,7 +991,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload for free "I"; all goes as long as initializer converts it into "ReducerState".
function useReducer, I>(
@@ -1007,7 +1007,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
@@ -1032,7 +1032,7 @@ declare namespace React {
* value around similar to how you’d use instance fields in classes.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useRef
+ * @see {@link https://react.dev/reference/react/useRef}
*/
function useRef(initialValue: T): MutableRefObject;
// convenience overload for refs given as a ref prop as they typically start with a null value
@@ -1047,7 +1047,7 @@ declare namespace React {
* of the generic argument.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useRef
+ * @see {@link https://react.dev/reference/react/useRef}
*/
function useRef(initialValue: T | null): RefObject;
// convenience overload for potentially undefined initialValue / call with 0 arguments
@@ -1060,7 +1060,7 @@ declare namespace React {
* value around similar to how you’d use instance fields in classes.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useRef
+ * @see {@link https://react.dev/reference/react/useRef}
*/
function useRef(): MutableRefObject;
/**
@@ -1074,7 +1074,7 @@ declare namespace React {
* `componentDidMount` and `componentDidUpdate`.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useLayoutEffect
+ * @see {@link https://react.dev/reference/react/useLayoutEffect}
*/
function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
/**
@@ -1084,7 +1084,7 @@ declare namespace React {
* @param deps If present, effect will only activate if the values in the list change.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useEffect
+ * @see {@link https://react.dev/reference/react/useEffect}
*/
function useEffect(effect: EffectCallback, deps?: DependencyList): void;
// NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref
@@ -1095,7 +1095,7 @@ declare namespace React {
* `useImperativeHandle` should be used with `React.forwardRef`.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useImperativeHandle
+ * @see {@link https://react.dev/reference/react/useImperativeHandle}
*/
function useImperativeHandle(ref: Ref | undefined, init: () => R, deps?: DependencyList): void;
// I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
@@ -1105,7 +1105,7 @@ declare namespace React {
* has changed.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useCallback
+ * @see {@link https://react.dev/reference/react/useCallback}
*/
// TODO (TypeScript 3.0): unknown>
function useCallback any>(callback: T, deps: DependencyList): T;
@@ -1113,7 +1113,7 @@ declare namespace React {
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useMemo
+ * @see {@link https://react.dev/reference/react/useMemo}
*/
// allow undefined, but don't make it optional as that is very likely a mistake
function useMemo(factory: () => T, deps: DependencyList | undefined): T;
@@ -1124,7 +1124,7 @@ declare namespace React {
* It’s most valuable for custom hooks that are part of shared libraries.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useDebugValue
+ * @see {@link https://react.dev/reference/react/useDebugValue}
*/
// the name of the custom hook is itself derived from the function name at runtime:
// it's just the function name without the "use" prefix.
@@ -1921,12 +1921,12 @@ declare namespace React {
// Living Standard
/**
* Hints at the type of data that might be entered by the user while editing the element or its contents
- * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
+ * @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
*/
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
/**
* Specify that a standard HTML element should behave like a defined custom built-in element
- * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is}
*/
is?: string | undefined;
/**
diff --git a/types/react/v17/index.d.ts b/types/react/v17/index.d.ts
index 2673aaf43b3678..6fc8e255069f37 100644
--- a/types/react/v17/index.d.ts
+++ b/types/react/v17/index.d.ts
@@ -457,7 +457,7 @@ declare namespace React {
* }
* ```
*
- * @see https://react.dev/reference/react/Component#static-contexttype
+ * @see {@link https://react.dev/reference/react/Component#static-contexttype}
*/
static contextType?: Context | undefined;
@@ -474,7 +474,7 @@ declare namespace React {
* declare context: React.ContextType
* ```
*
- * @see https://react.dev/reference/react/Component#context
+ * @see {@link https://react.dev/reference/react/Component#context}
*/
// TODO (TypeScript 3.0): unknown
context: any;
@@ -482,7 +482,7 @@ declare namespace React {
constructor(props: Readonly | P);
/**
* @deprecated
- * @see https://legacy.reactjs.org/docs/legacy-context.html
+ * @see {@link https://legacy.reactjs.org/docs/legacy-context.html}
*/
constructor(props: P, context: any);
@@ -698,8 +698,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
componentWillMount?(): void;
/**
@@ -712,8 +712,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use componentDidMount or the constructor instead
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
UNSAFE_componentWillMount?(): void;
/**
@@ -727,8 +727,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
/**
@@ -744,8 +744,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use static getDerivedStateFromProps instead
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
UNSAFE_componentWillReceiveProps?(nextProps: Readonly
, nextContext: any): void;
/**
@@ -757,8 +757,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
componentWillUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): void;
/**
@@ -772,8 +772,8 @@ declare namespace React {
* prevents this from being invoked.
*
* @deprecated 16.3, use getSnapshotBeforeUpdate instead
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
- * @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
+ * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
*/
UNSAFE_componentWillUpdate?(nextProps: Readonly
, nextState: Readonly, nextContext: any): void;
}
@@ -915,14 +915,14 @@ declare namespace React {
* context value, as given by the nearest context provider for the given context.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useContext
+ * @see {@link https://react.dev/reference/react/useContext}
*/
function useContext(context: Context /*, (not public API) observedBits?: number|boolean */): T;
/**
* Returns a stateful value, and a function to update it.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useState
+ * @see {@link https://react.dev/reference/react/useState}
*/
function useState(initialState: S | (() => S)): [S, Dispatch>];
// convenience overload when first argument is omitted
@@ -930,7 +930,7 @@ declare namespace React {
* Returns a stateful value, and a function to update it.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useState
+ * @see {@link https://react.dev/reference/react/useState}
*/
function useState(): [S | undefined, Dispatch>];
/**
@@ -941,7 +941,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload where dispatch could accept 0 arguments.
function useReducer, I>(
@@ -957,7 +957,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload where dispatch could accept 0 arguments.
function useReducer>(
@@ -973,7 +973,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload where "I" may be a subset of ReducerState; used to provide autocompletion.
// If "I" matches ReducerState exactly then the last overload will allow initializer to be omitted.
@@ -991,7 +991,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// overload for free "I"; all goes as long as initializer converts it into "ReducerState".
function useReducer, I>(
@@ -1007,7 +1007,7 @@ declare namespace React {
* updates because you can pass `dispatch` down instead of callbacks.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useReducer
+ * @see {@link https://react.dev/reference/react/useReducer}
*/
// I'm not sure if I keep this 2-ary or if I make it (2,3)-ary; it's currently (2,3)-ary.
@@ -1032,7 +1032,7 @@ declare namespace React {
* value around similar to how you’d use instance fields in classes.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useRef
+ * @see {@link https://react.dev/reference/react/useRef}
*/
function useRef(initialValue: T): MutableRefObject;
// convenience overload for refs given as a ref prop as they typically start with a null value
@@ -1047,7 +1047,7 @@ declare namespace React {
* of the generic argument.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useRef
+ * @see {@link https://react.dev/reference/react/useRef}
*/
function useRef(initialValue: T | null): RefObject;
// convenience overload for potentially undefined initialValue / call with 0 arguments
@@ -1060,7 +1060,7 @@ declare namespace React {
* value around similar to how you’d use instance fields in classes.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useRef
+ * @see {@link https://react.dev/reference/react/useRef}
*/
function useRef(): MutableRefObject;
/**
@@ -1074,7 +1074,7 @@ declare namespace React {
* `componentDidMount` and `componentDidUpdate`.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useLayoutEffect
+ * @see {@link https://react.dev/reference/react/useLayoutEffect}
*/
function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
/**
@@ -1084,7 +1084,7 @@ declare namespace React {
* @param deps If present, effect will only activate if the values in the list change.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useEffect
+ * @see {@link https://react.dev/reference/react/useEffect}
*/
function useEffect(effect: EffectCallback, deps?: DependencyList): void;
// NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref
@@ -1095,7 +1095,7 @@ declare namespace React {
* `useImperativeHandle` should be used with `React.forwardRef`.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useImperativeHandle
+ * @see {@link https://react.dev/reference/react/useImperativeHandle}
*/
function useImperativeHandle(ref: Ref | undefined, init: () => R, deps?: DependencyList): void;
// I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
@@ -1105,7 +1105,7 @@ declare namespace React {
* has changed.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useCallback
+ * @see {@link https://react.dev/reference/react/useCallback}
*/
// TODO (TypeScript 3.0): unknown>
function useCallback any>(callback: T, deps: DependencyList): T;
@@ -1113,7 +1113,7 @@ declare namespace React {
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useMemo
+ * @see {@link https://react.dev/reference/react/useMemo}
*/
// allow undefined, but don't make it optional as that is very likely a mistake
function useMemo(factory: () => T, deps: DependencyList | undefined): T;
@@ -1124,7 +1124,7 @@ declare namespace React {
* It’s most valuable for custom hooks that are part of shared libraries.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useDebugValue
+ * @see {@link https://react.dev/reference/react/useDebugValue}
*/
// the name of the custom hook is itself derived from the function name at runtime:
// it's just the function name without the "use" prefix.
@@ -1947,12 +1947,12 @@ declare namespace React {
// Living Standard
/**
* Hints at the type of data that might be entered by the user while editing the element or its contents
- * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
+ * @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
*/
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
/**
* Specify that a standard HTML element should behave like a defined custom built-in element
- * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is}
*/
is?: string | undefined;
/**
diff --git a/types/react/v18/canary.d.ts b/types/react/v18/canary.d.ts
index 840f5892f8f3d0..036cf1f8987461 100644
--- a/types/react/v18/canary.d.ts
+++ b/types/react/v18/canary.d.ts
@@ -53,7 +53,7 @@ declare module "." {
* context value, as given by the nearest context provider for the given context.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useContext
+ * @see {@link https://react.dev/reference/react/useContext}
*/
function useContext(context: ServerContext): T;
export function createServerContext(
diff --git a/types/react/v18/experimental.d.ts b/types/react/v18/experimental.d.ts
index 3b71d14592b7ee..5f05fbaf5d37ae 100644
--- a/types/react/v18/experimental.d.ts
+++ b/types/react/v18/experimental.d.ts
@@ -101,8 +101,8 @@ declare module "." {
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
* until previous items have been displayed (this behavior is adjustable).
*
- * @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
- * @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
+ * @see {@link https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist}
+ * @see {@link https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist}
*/
export const unstable_SuspenseList: ExoticComponent;
@@ -125,7 +125,7 @@ declare module "." {
export interface HTMLAttributes {
/**
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}
*/
inert?: boolean | undefined;
}
diff --git a/types/react/v18/index.d.ts b/types/react/v18/index.d.ts
index 5756cd7ec65f33..1673098eae63eb 100644
--- a/types/react/v18/index.d.ts
+++ b/types/react/v18/index.d.ts
@@ -2149,7 +2149,7 @@ declare namespace React {
*
* @param callback A synchronous, void callback that will execute as a single, complete React commit.
*
- * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
+ * @see {@link https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks}
*/
// While act does always return Thenable, if a void function is passed, we pretend the return value is also void to not trigger dangling Promise lint rules.
export function act(callback: () => VoidOrUndefinedOnly): void;
diff --git a/types/react/v18/ts5.0/canary.d.ts b/types/react/v18/ts5.0/canary.d.ts
index 840f5892f8f3d0..036cf1f8987461 100644
--- a/types/react/v18/ts5.0/canary.d.ts
+++ b/types/react/v18/ts5.0/canary.d.ts
@@ -53,7 +53,7 @@ declare module "." {
* context value, as given by the nearest context provider for the given context.
*
* @version 16.8.0
- * @see https://react.dev/reference/react/useContext
+ * @see {@link https://react.dev/reference/react/useContext}
*/
function useContext(context: ServerContext): T;
export function createServerContext(
diff --git a/types/react/v18/ts5.0/experimental.d.ts b/types/react/v18/ts5.0/experimental.d.ts
index 3b71d14592b7ee..5f05fbaf5d37ae 100644
--- a/types/react/v18/ts5.0/experimental.d.ts
+++ b/types/react/v18/ts5.0/experimental.d.ts
@@ -101,8 +101,8 @@ declare module "." {
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
* until previous items have been displayed (this behavior is adjustable).
*
- * @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
- * @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
+ * @see {@link https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist}
+ * @see {@link https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist}
*/
export const unstable_SuspenseList: ExoticComponent;
@@ -125,7 +125,7 @@ declare module "." {
export interface HTMLAttributes {
/**
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}
*/
inert?: boolean | undefined;
}
diff --git a/types/react/v18/ts5.0/index.d.ts b/types/react/v18/ts5.0/index.d.ts
index e14b69a5d1fa53..b5446b5f670f66 100644
--- a/types/react/v18/ts5.0/index.d.ts
+++ b/types/react/v18/ts5.0/index.d.ts
@@ -2150,7 +2150,7 @@ declare namespace React {
*
* @param callback A synchronous, void callback that will execute as a single, complete React commit.
*
- * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
+ * @see {@link https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks}
*/
// While act does always return Thenable, if a void function is passed, we pretend the return value is also void to not trigger dangling Promise lint rules.
export function act(callback: () => VoidOrUndefinedOnly): void;
diff --git a/types/rgbcolor/.npmignore b/types/rgbcolor/.npmignore
new file mode 100644
index 00000000000000..93e307400a5456
--- /dev/null
+++ b/types/rgbcolor/.npmignore
@@ -0,0 +1,5 @@
+*
+!**/*.d.ts
+!**/*.d.cts
+!**/*.d.mts
+!**/*.d.*.ts
diff --git a/types/rgbcolor/index.d.ts b/types/rgbcolor/index.d.ts
new file mode 100644
index 00000000000000..fa440e569d19f6
--- /dev/null
+++ b/types/rgbcolor/index.d.ts
@@ -0,0 +1,51 @@
+/**
+ * RGB color parser that handles various color formats.
+ *
+ * @example
+ * ```javascript
+ * var color = new RGBColor('red');
+ * if (color.ok) {
+ * console.log(color.toHex()); // '#ff0000'
+ * }
+ * ```
+ */
+declare class RGBColor {
+ /**
+ * Creates a new RGBColor instance by parsing a color string.
+ * @param colorString - A color string in various formats:
+ * - Named colors: 'red', 'blue', 'green', etc.
+ * - Hex: '#ff0000', 'ff0000', '#f00', 'f00'
+ * - RGB: 'rgb(255, 0, 0)'
+ * - RGBA: 'rgba(255, 0, 0, 0.5)'
+ */
+ constructor(colorString: string);
+
+ /** Whether the color was parsed successfully */
+ ok: boolean;
+
+ /** Red component (0-255) */
+ r: number;
+
+ /** Green component (0-255) */
+ g: number;
+
+ /** Blue component (0-255) */
+ b: number;
+
+ /** Alpha component (0-1) */
+ alpha: number;
+
+ /** Returns the color as an RGB string, e.g. 'rgb(255, 0, 0)' */
+ toRGB(): string;
+
+ /** Returns the color as an RGBA string, e.g. 'rgba(255, 0, 0, 0.5)' */
+ toRGBA(): string;
+
+ /** Returns the color as a hex string, e.g. '#ff0000' */
+ toHex(): string;
+
+ /** Returns an HTML element with color examples (browser only) */
+ getHelpXML(): HTMLElement;
+}
+
+export = RGBColor;
diff --git a/types/rgbcolor/package.json b/types/rgbcolor/package.json
new file mode 100644
index 00000000000000..fdc41f32365ae6
--- /dev/null
+++ b/types/rgbcolor/package.json
@@ -0,0 +1,17 @@
+{
+ "private": true,
+ "name": "@types/rgbcolor",
+ "version": "1.0.9999",
+ "projects": [
+ "https://github.com/yetzt/node-rgbcolor"
+ ],
+ "devDependencies": {
+ "@types/rgbcolor": "workspace:."
+ },
+ "owners": [
+ {
+ "name": "gaspard",
+ "githubUsername": "gasp"
+ }
+ ]
+}
diff --git a/types/rgbcolor/rgbcolor-tests.ts b/types/rgbcolor/rgbcolor-tests.ts
new file mode 100644
index 00000000000000..217c128c1865cc
--- /dev/null
+++ b/types/rgbcolor/rgbcolor-tests.ts
@@ -0,0 +1,30 @@
+import RGBColor = require("rgbcolor");
+
+// Test with named color
+const red = new RGBColor("red");
+const ok: boolean = red.ok;
+const r: number = red.r;
+const g: number = red.g;
+const b: number = red.b;
+const alpha: number = red.alpha;
+
+// Test conversion methods
+const rgb: string = red.toRGB();
+const rgba: string = red.toRGBA();
+const hex: string = red.toHex();
+
+// Test with hex color
+const hexColor = new RGBColor("#ff0000");
+const hexColor2 = new RGBColor("ff0000");
+const hexColor3 = new RGBColor("#f00");
+
+// Test with rgb() format
+const rgbColor = new RGBColor("rgb(255, 0, 0)");
+
+// Test with rgba() format
+const rgbaColor = new RGBColor("rgba(255, 0, 0, 0.5)");
+
+// Test checking if parse was successful
+if (red.ok) {
+ const validHex: string = red.toHex();
+}
diff --git a/types/rgbcolor/tsconfig.json b/types/rgbcolor/tsconfig.json
new file mode 100644
index 00000000000000..b61a59b768d38c
--- /dev/null
+++ b/types/rgbcolor/tsconfig.json
@@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "module": "node16",
+ "lib": [
+ "es6",
+ "dom"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "rgbcolor-tests.ts"
+ ]
+}
diff --git a/types/should-format/.npmignore b/types/should-format/.npmignore
new file mode 100644
index 00000000000000..93e307400a5456
--- /dev/null
+++ b/types/should-format/.npmignore
@@ -0,0 +1,5 @@
+*
+!**/*.d.ts
+!**/*.d.cts
+!**/*.d.mts
+!**/*.d.*.ts
diff --git a/types/should-format/index.d.ts b/types/should-format/index.d.ts
new file mode 100644
index 00000000000000..9d393bb5c77f82
--- /dev/null
+++ b/types/should-format/index.d.ts
@@ -0,0 +1,67 @@
+/**
+ * Options for the Formatter.
+ */
+interface FormatterOptions {
+ /**
+ * Custom function to get keys from an object.
+ */
+ keysFunc?: (obj: object) => string[];
+
+ /**
+ * If false, uses Object.getOwnPropertyNames instead of Object.keys.
+ */
+ keys?: boolean;
+
+ /**
+ * Maximum line length before wrapping. Default: 60.
+ */
+ maxLineLength?: number;
+
+ /**
+ * Property separator. Default: ','.
+ */
+ propSep?: string;
+
+ /**
+ * If true, formats dates in UTC.
+ */
+ isUTCdate?: boolean;
+}
+
+/**
+ * Formatter class for converting values to string representations.
+ */
+declare class Formatter {
+ constructor(opts?: FormatterOptions);
+
+ /**
+ * Format a value to a string representation.
+ * @param value - The value to format
+ * @returns Formatted string representation
+ */
+ format(value: unknown): string;
+}
+
+/**
+ * Default format function that creates a Formatter and formats the value.
+ *
+ * @param value - The value to format
+ * @param opts - Optional formatter options
+ * @returns Formatted string representation
+ *
+ * @example
+ * ```javascript
+ * const format = require('should-format');
+ *
+ * format({ a: 1, b: 2 }); // => "{ a: 1, b: 2 }"
+ * format([1, 2, 3]); // => "[ 1, 2, 3 ]"
+ * format(null); // => "null"
+ * ```
+ */
+declare function format(value: unknown, opts?: FormatterOptions): string;
+
+declare namespace format {
+ export { Formatter, FormatterOptions };
+}
+
+export = format;
diff --git a/types/should-format/package.json b/types/should-format/package.json
new file mode 100644
index 00000000000000..2a8239b6dda01c
--- /dev/null
+++ b/types/should-format/package.json
@@ -0,0 +1,17 @@
+{
+ "private": true,
+ "name": "@types/should-format",
+ "version": "3.0.9999",
+ "projects": [
+ "https://github.com/shouldjs/format"
+ ],
+ "devDependencies": {
+ "@types/should-format": "workspace:."
+ },
+ "owners": [
+ {
+ "name": "gaspard",
+ "githubUsername": "gasp"
+ }
+ ]
+}
diff --git a/types/should-format/should-format-tests.ts b/types/should-format/should-format-tests.ts
new file mode 100644
index 00000000000000..f33f8a89cdbb79
--- /dev/null
+++ b/types/should-format/should-format-tests.ts
@@ -0,0 +1,40 @@
+import format = require("should-format");
+
+// Test default format function
+const objStr: string = format({ a: 1, b: 2 });
+const arrStr: string = format([1, 2, 3]);
+const nullStr: string = format(null);
+const undefinedStr: string = format(undefined);
+const numStr: string = format(42);
+const boolStr: string = format(true);
+const strStr: string = format("hello");
+const dateStr: string = format(new Date());
+const regexStr: string = format(/test/g);
+
+// Test with options
+const withOptions: string = format({ a: 1 }, {
+ maxLineLength: 80,
+ propSep: ";",
+ isUTCdate: true,
+});
+
+// Test with keysFunc option
+const withKeysFunc: string = format({ a: 1, b: 2 }, {
+ keysFunc: (obj) => Object.keys(obj).reverse(),
+});
+
+// Test with keys: false option
+const withAllKeys: string = format({ a: 1 }, {
+ keys: false,
+});
+
+// Test Formatter class
+const formatter = new format.Formatter();
+const formatted: string = formatter.format({ test: true });
+
+// Test Formatter with options
+const formatterWithOpts = new format.Formatter({
+ maxLineLength: 100,
+ propSep: ",",
+});
+const formatted2: string = formatterWithOpts.format([1, 2, 3]);
diff --git a/types/should-format/tsconfig.json b/types/should-format/tsconfig.json
new file mode 100644
index 00000000000000..dce39f9f138883
--- /dev/null
+++ b/types/should-format/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "module": "node16",
+ "lib": [
+ "es6"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "should-format-tests.ts"
+ ]
+}
diff --git a/types/sort-keys-length/.npmignore b/types/sort-keys-length/.npmignore
new file mode 100644
index 00000000000000..93e307400a5456
--- /dev/null
+++ b/types/sort-keys-length/.npmignore
@@ -0,0 +1,5 @@
+*
+!**/*.d.ts
+!**/*.d.cts
+!**/*.d.mts
+!**/*.d.*.ts
diff --git a/types/sort-keys-length/index.d.ts b/types/sort-keys-length/index.d.ts
new file mode 100644
index 00000000000000..319457f90bf450
--- /dev/null
+++ b/types/sort-keys-length/index.d.ts
@@ -0,0 +1,42 @@
+/**
+ * Options for sorting object keys by length.
+ */
+interface SortKeysLengthOptions {
+ /**
+ * Recursively sort keys.
+ * @default false
+ */
+ deep?: boolean;
+}
+
+/**
+ * Sort object keys by length in ascending order (shortest first).
+ *
+ * @param object - Object to sort
+ * @param options - Sort options
+ * @returns A new object with keys sorted by length in ascending order
+ *
+ * @example
+ * ```javascript
+ * sortKeysLength.asc({ab: 'x', a: 'y', abc: 'z'});
+ * //=> {a: 'y', ab: 'x', abc: 'z'}
+ * ```
+ */
+declare function asc(object: T, options?: SortKeysLengthOptions): T;
+
+/**
+ * Sort object keys by length in descending order (longest first).
+ *
+ * @param object - Object to sort
+ * @param options - Sort options
+ * @returns A new object with keys sorted by length in descending order
+ *
+ * @example
+ * ```javascript
+ * sortKeysLength.desc({ab: 'x', a: 'y', abc: 'z'});
+ * //=> {abc: 'z', ab: 'x', a: 'y'}
+ * ```
+ */
+declare function desc(object: T, options?: SortKeysLengthOptions): T;
+
+export { asc, desc, SortKeysLengthOptions };
diff --git a/types/sort-keys-length/package.json b/types/sort-keys-length/package.json
new file mode 100644
index 00000000000000..f3b52652968b14
--- /dev/null
+++ b/types/sort-keys-length/package.json
@@ -0,0 +1,17 @@
+{
+ "private": true,
+ "name": "@types/sort-keys-length",
+ "version": "2.0.9999",
+ "projects": [
+ "https://github.com/kevva/sort-keys-length"
+ ],
+ "devDependencies": {
+ "@types/sort-keys-length": "workspace:."
+ },
+ "owners": [
+ {
+ "name": "gaspard",
+ "githubUsername": "gasp"
+ }
+ ]
+}
diff --git a/types/sort-keys-length/sort-keys-length-tests.ts b/types/sort-keys-length/sort-keys-length-tests.ts
new file mode 100644
index 00000000000000..b15603307012b1
--- /dev/null
+++ b/types/sort-keys-length/sort-keys-length-tests.ts
@@ -0,0 +1,30 @@
+import { asc, desc } from "sort-keys-length";
+
+// Test ascending sort
+const ascResult = asc({ ab: "x", a: "y", abc: "z" });
+
+// Test descending sort
+const descResult = desc({ ab: "x", a: "y", abc: "z" });
+
+// Test with deep option
+const deepAsc = asc({ ab: "x", a: "y" }, { deep: true });
+const deepDesc = desc({ ab: "x", a: "y" }, { deep: false });
+
+// Test with nested objects
+const nested = asc({
+ longKey: {
+ short: 1,
+ longerKey: 2,
+ },
+ a: "value",
+}, { deep: true });
+
+// Type preservation
+interface MyObject {
+ foo: string;
+ barbaz: number;
+}
+
+const typed: MyObject = { foo: "hello", barbaz: 42 };
+const sortedTyped: MyObject = asc(typed);
+const sortedTypedDesc: MyObject = desc(typed);
diff --git a/types/sort-keys-length/tsconfig.json b/types/sort-keys-length/tsconfig.json
new file mode 100644
index 00000000000000..408a0777abf161
--- /dev/null
+++ b/types/sort-keys-length/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "module": "node16",
+ "lib": [
+ "es6"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "sort-keys-length-tests.ts"
+ ]
+}
diff --git a/types/webpack-log/.npmignore b/types/webpack-log/.npmignore
new file mode 100644
index 00000000000000..93e307400a5456
--- /dev/null
+++ b/types/webpack-log/.npmignore
@@ -0,0 +1,5 @@
+*
+!**/*.d.ts
+!**/*.d.cts
+!**/*.d.mts
+!**/*.d.*.ts
diff --git a/types/webpack-log/index.d.ts b/types/webpack-log/index.d.ts
new file mode 100644
index 00000000000000..54e100a994d542
--- /dev/null
+++ b/types/webpack-log/index.d.ts
@@ -0,0 +1,77 @@
+/**
+ * Options for creating a webpack logger.
+ */
+interface WebpackLogOptions {
+ /**
+ * Log level. Default: 'info'.
+ */
+ level?: "trace" | "debug" | "info" | "warn" | "error" | "silent";
+
+ /**
+ * Name of the logger. Default: ''.
+ */
+ name?: string;
+
+ /**
+ * Whether to include timestamp in output. Default: false.
+ */
+ timestamp?: boolean;
+
+ /**
+ * Whether to generate unique logger ID. Default: true.
+ */
+ unique?: boolean;
+}
+
+/**
+ * Logger instance returned by webpack-log.
+ */
+interface WebpackLogger {
+ /**
+ * Log at trace level.
+ */
+ trace(...args: unknown[]): void;
+
+ /**
+ * Log at debug level.
+ */
+ debug(...args: unknown[]): void;
+
+ /**
+ * Log at info level.
+ */
+ info(...args: unknown[]): void;
+
+ /**
+ * Log at warn level.
+ */
+ warn(...args: unknown[]): void;
+
+ /**
+ * Log at error level.
+ */
+ error(...args: unknown[]): void;
+}
+
+/**
+ * Creates a logger for the Webpack ecosystem.
+ *
+ * @param options - Logger configuration options
+ * @returns A logger instance with trace, debug, info, warn, and error methods
+ *
+ * @example
+ * ```javascript
+ * const getLogger = require('webpack-log');
+ *
+ * const log = getLogger({ name: 'my-plugin' });
+ * log.info('Starting plugin');
+ * log.error('Something went wrong');
+ * ```
+ */
+declare function getLogger(options?: WebpackLogOptions): WebpackLogger;
+
+declare namespace getLogger {
+ export { WebpackLogger, WebpackLogOptions };
+}
+
+export = getLogger;
diff --git a/types/webpack-log/package.json b/types/webpack-log/package.json
new file mode 100644
index 00000000000000..acfe60bb1a54a0
--- /dev/null
+++ b/types/webpack-log/package.json
@@ -0,0 +1,17 @@
+{
+ "private": true,
+ "name": "@types/webpack-log",
+ "version": "3.0.9999",
+ "projects": [
+ "https://github.com/shellscape/webpack-log"
+ ],
+ "devDependencies": {
+ "@types/webpack-log": "workspace:."
+ },
+ "owners": [
+ {
+ "name": "gaspard",
+ "githubUsername": "gasp"
+ }
+ ]
+}
diff --git a/types/webpack-log/tsconfig.json b/types/webpack-log/tsconfig.json
new file mode 100644
index 00000000000000..81b13ca8d9db4b
--- /dev/null
+++ b/types/webpack-log/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "module": "node16",
+ "lib": [
+ "es6"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "webpack-log-tests.ts"
+ ]
+}
diff --git a/types/webpack-log/webpack-log-tests.ts b/types/webpack-log/webpack-log-tests.ts
new file mode 100644
index 00000000000000..19f9af5b6ab3df
--- /dev/null
+++ b/types/webpack-log/webpack-log-tests.ts
@@ -0,0 +1,34 @@
+import getLogger = require("webpack-log");
+
+// Create logger with default options
+const log = getLogger();
+
+// Create logger with name
+const namedLog = getLogger({ name: "my-webpack-plugin" });
+
+// Create logger with all options
+const fullLog = getLogger({
+ name: "webpack-plugin",
+ level: "debug",
+ timestamp: true,
+ unique: false,
+});
+
+// Test log methods
+log.trace("trace message");
+log.debug("debug message");
+log.info("info message");
+log.warn("warning message");
+log.error("error message");
+
+// Test with multiple arguments
+log.info("message", { data: 123 });
+log.error("error", new Error("test"));
+
+// Test log level options
+getLogger({ level: "trace" });
+getLogger({ level: "debug" });
+getLogger({ level: "info" });
+getLogger({ level: "warn" });
+getLogger({ level: "error" });
+getLogger({ level: "silent" });