Skip to content

Commit 7e7c5ca

Browse files
authored
[react] wrap JSDoc URLs in @link tags (DefinitelyTyped#74481)
1 parent 7ea74b6 commit 7e7c5ca

File tree

13 files changed

+88
-88
lines changed

13 files changed

+88
-88
lines changed

types/react/experimental.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ declare module "." {
106106
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
107107
* until previous items have been displayed (this behavior is adjustable).
108108
*
109-
* @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
110-
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
109+
* @see {@link https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist}
110+
* @see {@link https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist}
111111
*/
112112
export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
113113

types/react/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,7 @@ declare namespace React {
18851885
*
18861886
* @param callback A synchronous, void callback that will execute as a single, complete React commit.
18871887
*
1888-
* @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
1888+
* @see {@link https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks}
18891889
*/
18901890
// NOTES
18911891
// - the order of these signatures matters - typescript will check the signatures in source order.
@@ -2841,7 +2841,7 @@ declare namespace React {
28412841

28422842
// Living Standard
28432843
/**
2844-
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
2844+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}
28452845
*/
28462846
inert?: boolean | undefined;
28472847
/**

types/react/ts5.0/experimental.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ declare module "." {
106106
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
107107
* until previous items have been displayed (this behavior is adjustable).
108108
*
109-
* @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
110-
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
109+
* @see {@link https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist}
110+
* @see {@link https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist}
111111
*/
112112
export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
113113

types/react/ts5.0/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ declare namespace React {
18841884
*
18851885
* @param callback A synchronous, void callback that will execute as a single, complete React commit.
18861886
*
1887-
* @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
1887+
* @see {@link https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks}
18881888
*/
18891889
// NOTES
18901890
// - the order of these signatures matters - typescript will check the signatures in source order.
@@ -2840,7 +2840,7 @@ declare namespace React {
28402840

28412841
// Living Standard
28422842
/**
2843-
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
2843+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}
28442844
*/
28452845
inert?: boolean | undefined;
28462846
/**

types/react/v15/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,12 +2721,12 @@ declare namespace React {
27212721
// Living Standard
27222722
/**
27232723
* Hints at the type of data that might be entered by the user while editing the element or its contents
2724-
* @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
2724+
* @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
27252725
*/
27262726
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
27272727
/**
27282728
* Specify that a standard HTML element should behave like a defined custom built-in element
2729-
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
2729+
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is}
27302730
*/
27312731
is?: string | undefined;
27322732
/**

types/react/v16/index.d.ts

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ declare namespace React {
457457
* }
458458
* ```
459459
*
460-
* @see https://react.dev/reference/react/Component#static-contexttype
460+
* @see {@link https://react.dev/reference/react/Component#static-contexttype}
461461
*/
462462
static contextType?: Context<any> | undefined;
463463

@@ -474,15 +474,15 @@ declare namespace React {
474474
* declare context: React.ContextType<typeof MyContext>
475475
* ```
476476
*
477-
* @see https://react.dev/reference/react/Component#context
477+
* @see {@link https://react.dev/reference/react/Component#context}
478478
*/
479479
// TODO (TypeScript 3.0): unknown
480480
context: any;
481481

482482
constructor(props: Readonly<P> | P);
483483
/**
484484
* @deprecated
485-
* @see https://legacy.reactjs.org/docs/legacy-context.html
485+
* @see {@link https://legacy.reactjs.org/docs/legacy-context.html}
486486
*/
487487
constructor(props: P, context: any);
488488

@@ -698,8 +698,8 @@ declare namespace React {
698698
* prevents this from being invoked.
699699
*
700700
* @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17
701-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
702-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
701+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
702+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
703703
*/
704704
componentWillMount?(): void;
705705
/**
@@ -712,8 +712,8 @@ declare namespace React {
712712
* prevents this from being invoked.
713713
*
714714
* @deprecated 16.3, use componentDidMount or the constructor instead
715-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
716-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
715+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state}
716+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
717717
*/
718718
UNSAFE_componentWillMount?(): void;
719719
/**
@@ -727,8 +727,8 @@ declare namespace React {
727727
* prevents this from being invoked.
728728
*
729729
* @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
730-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
731-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
730+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
731+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
732732
*/
733733
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
734734
/**
@@ -744,8 +744,8 @@ declare namespace React {
744744
* prevents this from being invoked.
745745
*
746746
* @deprecated 16.3, use static getDerivedStateFromProps instead
747-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
748-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
747+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
748+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
749749
*/
750750
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
751751
/**
@@ -757,8 +757,8 @@ declare namespace React {
757757
* prevents this from being invoked.
758758
*
759759
* @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
760-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
761-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
760+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
761+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
762762
*/
763763
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
764764
/**
@@ -772,8 +772,8 @@ declare namespace React {
772772
* prevents this from being invoked.
773773
*
774774
* @deprecated 16.3, use getSnapshotBeforeUpdate instead
775-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
776-
* @see https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
775+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
776+
* @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
777777
*/
778778
UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
779779
}
@@ -915,22 +915,22 @@ declare namespace React {
915915
* context value, as given by the nearest context provider for the given context.
916916
*
917917
* @version 16.8.0
918-
* @see https://react.dev/reference/react/useContext
918+
* @see {@link https://react.dev/reference/react/useContext}
919919
*/
920920
function useContext<T>(context: Context<T> /*, (not public API) observedBits?: number|boolean */): T;
921921
/**
922922
* Returns a stateful value, and a function to update it.
923923
*
924924
* @version 16.8.0
925-
* @see https://react.dev/reference/react/useState
925+
* @see {@link https://react.dev/reference/react/useState}
926926
*/
927927
function useState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
928928
// convenience overload when first argument is omitted
929929
/**
930930
* Returns a stateful value, and a function to update it.
931931
*
932932
* @version 16.8.0
933-
* @see https://react.dev/reference/react/useState
933+
* @see {@link https://react.dev/reference/react/useState}
934934
*/
935935
function useState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
936936
/**
@@ -941,7 +941,7 @@ declare namespace React {
941941
* updates because you can pass `dispatch` down instead of callbacks.
942942
*
943943
* @version 16.8.0
944-
* @see https://react.dev/reference/react/useReducer
944+
* @see {@link https://react.dev/reference/react/useReducer}
945945
*/
946946
// overload where dispatch could accept 0 arguments.
947947
function useReducer<R extends ReducerWithoutAction<any>, I>(
@@ -957,7 +957,7 @@ declare namespace React {
957957
* updates because you can pass `dispatch` down instead of callbacks.
958958
*
959959
* @version 16.8.0
960-
* @see https://react.dev/reference/react/useReducer
960+
* @see {@link https://react.dev/reference/react/useReducer}
961961
*/
962962
// overload where dispatch could accept 0 arguments.
963963
function useReducer<R extends ReducerWithoutAction<any>>(
@@ -973,7 +973,7 @@ declare namespace React {
973973
* updates because you can pass `dispatch` down instead of callbacks.
974974
*
975975
* @version 16.8.0
976-
* @see https://react.dev/reference/react/useReducer
976+
* @see {@link https://react.dev/reference/react/useReducer}
977977
*/
978978
// overload where "I" may be a subset of ReducerState<R>; used to provide autocompletion.
979979
// If "I" matches ReducerState<R> exactly then the last overload will allow initializer to be omitted.
@@ -991,7 +991,7 @@ declare namespace React {
991991
* updates because you can pass `dispatch` down instead of callbacks.
992992
*
993993
* @version 16.8.0
994-
* @see https://react.dev/reference/react/useReducer
994+
* @see {@link https://react.dev/reference/react/useReducer}
995995
*/
996996
// overload for free "I"; all goes as long as initializer converts it into "ReducerState<R>".
997997
function useReducer<R extends Reducer<any, any>, I>(
@@ -1007,7 +1007,7 @@ declare namespace React {
10071007
* updates because you can pass `dispatch` down instead of callbacks.
10081008
*
10091009
* @version 16.8.0
1010-
* @see https://react.dev/reference/react/useReducer
1010+
* @see {@link https://react.dev/reference/react/useReducer}
10111011
*/
10121012

10131013
// 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 {
10321032
* value around similar to how you’d use instance fields in classes.
10331033
*
10341034
* @version 16.8.0
1035-
* @see https://react.dev/reference/react/useRef
1035+
* @see {@link https://react.dev/reference/react/useRef}
10361036
*/
10371037
function useRef<T>(initialValue: T): MutableRefObject<T>;
10381038
// convenience overload for refs given as a ref prop as they typically start with a null value
@@ -1047,7 +1047,7 @@ declare namespace React {
10471047
* of the generic argument.
10481048
*
10491049
* @version 16.8.0
1050-
* @see https://react.dev/reference/react/useRef
1050+
* @see {@link https://react.dev/reference/react/useRef}
10511051
*/
10521052
function useRef<T>(initialValue: T | null): RefObject<T>;
10531053
// convenience overload for potentially undefined initialValue / call with 0 arguments
@@ -1060,7 +1060,7 @@ declare namespace React {
10601060
* value around similar to how you’d use instance fields in classes.
10611061
*
10621062
* @version 16.8.0
1063-
* @see https://react.dev/reference/react/useRef
1063+
* @see {@link https://react.dev/reference/react/useRef}
10641064
*/
10651065
function useRef<T = undefined>(): MutableRefObject<T | undefined>;
10661066
/**
@@ -1074,7 +1074,7 @@ declare namespace React {
10741074
* `componentDidMount` and `componentDidUpdate`.
10751075
*
10761076
* @version 16.8.0
1077-
* @see https://react.dev/reference/react/useLayoutEffect
1077+
* @see {@link https://react.dev/reference/react/useLayoutEffect}
10781078
*/
10791079
function useLayoutEffect(effect: EffectCallback, deps?: DependencyList): void;
10801080
/**
@@ -1084,7 +1084,7 @@ declare namespace React {
10841084
* @param deps If present, effect will only activate if the values in the list change.
10851085
*
10861086
* @version 16.8.0
1087-
* @see https://react.dev/reference/react/useEffect
1087+
* @see {@link https://react.dev/reference/react/useEffect}
10881088
*/
10891089
function useEffect(effect: EffectCallback, deps?: DependencyList): void;
10901090
// NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
@@ -1095,7 +1095,7 @@ declare namespace React {
10951095
* `useImperativeHandle` should be used with `React.forwardRef`.
10961096
*
10971097
* @version 16.8.0
1098-
* @see https://react.dev/reference/react/useImperativeHandle
1098+
* @see {@link https://react.dev/reference/react/useImperativeHandle}
10991099
*/
11001100
function useImperativeHandle<T, R extends T>(ref: Ref<T> | undefined, init: () => R, deps?: DependencyList): void;
11011101
// I made 'inputs' required here and in useMemo as there's no point to memoizing without the memoization key
@@ -1105,15 +1105,15 @@ declare namespace React {
11051105
* has changed.
11061106
*
11071107
* @version 16.8.0
1108-
* @see https://react.dev/reference/react/useCallback
1108+
* @see {@link https://react.dev/reference/react/useCallback}
11091109
*/
11101110
// TODO (TypeScript 3.0): <T extends (...args: never[]) => unknown>
11111111
function useCallback<T extends (...args: any[]) => any>(callback: T, deps: DependencyList): T;
11121112
/**
11131113
* `useMemo` will only recompute the memoized value when one of the `deps` has changed.
11141114
*
11151115
* @version 16.8.0
1116-
* @see https://react.dev/reference/react/useMemo
1116+
* @see {@link https://react.dev/reference/react/useMemo}
11171117
*/
11181118
// allow undefined, but don't make it optional as that is very likely a mistake
11191119
function useMemo<T>(factory: () => T, deps: DependencyList | undefined): T;
@@ -1124,7 +1124,7 @@ declare namespace React {
11241124
* It’s most valuable for custom hooks that are part of shared libraries.
11251125
*
11261126
* @version 16.8.0
1127-
* @see https://react.dev/reference/react/useDebugValue
1127+
* @see {@link https://react.dev/reference/react/useDebugValue}
11281128
*/
11291129
// the name of the custom hook is itself derived from the function name at runtime:
11301130
// it's just the function name without the "use" prefix.
@@ -1921,12 +1921,12 @@ declare namespace React {
19211921
// Living Standard
19221922
/**
19231923
* Hints at the type of data that might be entered by the user while editing the element or its contents
1924-
* @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
1924+
* @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute}
19251925
*/
19261926
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
19271927
/**
19281928
* Specify that a standard HTML element should behave like a defined custom built-in element
1929-
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
1929+
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is}
19301930
*/
19311931
is?: string | undefined;
19321932
/**

0 commit comments

Comments
 (0)