From ca4bfd32a9459b42508acdd336baf49d25e76926 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Thu, 21 Mar 2024 12:09:35 -0500 Subject: [PATCH] Run Prettier on all files --- .gitattributes | 1 + .github/ISSUE_TEMPLATE/bug_report.yml | 4 +- .github/ISSUE_TEMPLATE/config.yml | 6 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- CODE_OF_CONDUCT.md | 1 - etc/react-redux.api.md | 700 +++++++++++++----- etc/react-redux.dt-types.api.md | 643 ++++++++++------ .../rr-rsc-context/app/page.module.css | 4 +- src/types.ts | 11 +- test/tsconfig.test.json | 2 +- test/typeTestHelpers.ts | 17 +- test/typetests/tsconfig.json | 3 +- tsup.config.ts | 2 +- vitest.setup.ts | 2 +- website/README.md | 15 +- website/src/pages/index.js | 2 +- website/src/theme/NotFound.js | 35 +- website/static/css/404.css | 50 +- website/static/css/codeblock.css | 6 +- website/static/css/custom.css | 8 +- website/static/scripts/codeblock.js | 48 +- website/static/scripts/monokaiTheme.js | 42 +- website/static/scripts/sidebarScroll.js | 17 +- website/versioned_docs/version-5.x/api.md | 159 ++-- .../version-5.x/api/Provider.md | 93 ++- website/versioned_docs/version-5.x/api/api.md | 16 +- .../version-5.x/api/connect-advanced.md | 27 +- .../versioned_docs/version-5.x/api/connect.md | 99 +-- .../introduction/basic-tutorial.md | 132 ++-- .../version-5.x/introduction/quick-start.md | 33 +- .../version-5.x/troubleshooting.md | 16 +- ...atching-actions-with-mapDispatchToProps.md | 126 ++-- ...ct-extracting-data-with-mapStateToProps.md | 112 ++- .../version-6.x/api/Provider.md | 4 +- .../version-6.x/api/connect-advanced.md | 2 +- .../versioned_docs/version-6.x/api/connect.md | 116 +-- .../introduction/basic-tutorial.md | 58 +- .../version-6.x/introduction/quick-start.md | 2 +- .../version-6.x/troubleshooting.md | 13 +- .../using-react-redux/accessing-store.md | 18 +- ...atching-actions-with-mapDispatchToProps.md | 49 +- ...ct-extracting-data-with-mapStateToProps.md | 6 +- .../version-7.0/api/Provider.md | 4 +- .../versioned_docs/version-7.0/api/batch.md | 16 +- .../version-7.0/api/connect-advanced.md | 2 +- .../versioned_docs/version-7.0/api/connect.md | 114 +-- .../introduction/basic-tutorial.md | 58 +- .../version-7.0/introduction/quick-start.md | 2 +- .../version-7.0/troubleshooting.md | 13 +- .../using-react-redux/accessing-store.md | 14 +- ...atching-actions-with-mapDispatchToProps.md | 49 +- ...ct-extracting-data-with-mapStateToProps.md | 6 +- .../version-7.1/api/Provider.md | 4 +- .../version-7.1/api/connect-advanced.md | 2 +- .../versioned_docs/version-7.1/api/connect.md | 116 +-- .../versioned_docs/version-7.1/api/hooks.md | 33 +- .../introduction/basic-tutorial.md | 58 +- .../version-7.1/introduction/quick-start.md | 2 +- .../version-7.1/troubleshooting.md | 13 +- .../using-react-redux/accessing-store.md | 14 +- ...atching-actions-with-mapDispatchToProps.md | 49 +- ...ct-extracting-data-with-mapStateToProps.md | 6 +- .../using-react-redux/static-types.md | 23 +- .../version-7.2/api/Provider.md | 4 +- .../version-7.2/api/connect-advanced.md | 2 +- .../versioned_docs/version-7.2/api/connect.md | 116 +-- .../versioned_docs/version-7.2/api/hooks.md | 33 +- .../introduction/basic-tutorial.md | 58 +- .../version-7.2/introduction/quick-start.md | 2 +- .../version-7.2/troubleshooting.md | 13 +- ...atching-actions-with-mapDispatchToProps.md | 49 +- ...ct-extracting-data-with-mapStateToProps.md | 6 +- .../using-react-redux/static-types.md | 23 +- .../version-5.x-sidebars.json | 4 +- .../version-6.x-sidebars.json | 4 +- 75 files changed, 1877 insertions(+), 1737 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6313b56c5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index ea03203a9..c815e043e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: 🐛 Bug Report description: Something isn't working correctly. -body: +body: - type: markdown attributes: value: | @@ -50,6 +50,6 @@ body: attributes: label: Did this work in previous versions of React Redux? options: - - label: "Yes" + - label: 'Yes' validations: required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 8cffa4e1c..28219ad1f 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - - name: 🤔 Questions and Help - url: https://redux.js.org/introduction/getting-started#help-and-discussion - about: This is a bug tracker, not a support system. For usage questions, please use our support resources. + - name: 🤔 Questions and Help + url: https://redux.js.org/introduction/getting-started#help-and-discussion + about: This is a bug tracker, not a support system. For usage questions, please use our support resources. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index f63190bb5..b90fe2d7f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,6 +1,6 @@ name: 👍 Feature Request description: I'd like React Redux to do something new. -body: +body: - type: markdown attributes: value: | diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index a0fd0d6b5..4ead0e1da 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -11,4 +11,3 @@ Project maintainers have the right and responsibility to remove, edit, or reject Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/) - diff --git a/etc/react-redux.api.md b/etc/react-redux.api.md index 978c8fe91..341c55777 100644 --- a/etc/react-redux.api.md +++ b/etc/react-redux.api.md @@ -3,312 +3,624 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - /// -import { Action } from 'redux'; -import { AnyAction } from 'redux'; -import { unstable_batchedUpdates as batch } from 'react-dom'; -import { ClassAttributes } from 'react'; -import { ComponentClass } from 'react'; -import { ComponentType } from 'react'; -import { Context } from 'react'; -import { Dispatch } from 'redux'; -import type { NonReactStatics } from 'hoist-non-react-statics'; -import { default as React_2 } from 'react'; -import { ReactNode } from 'react'; -import { Store } from 'redux'; +import { Action } from 'redux' +import { AnyAction } from 'redux' +import { unstable_batchedUpdates as batch } from 'react-dom' +import { ClassAttributes } from 'react' +import { ComponentClass } from 'react' +import { ComponentType } from 'react' +import { Context } from 'react' +import { Dispatch } from 'redux' +import type { NonReactStatics } from 'hoist-non-react-statics' +import { default as React_2 } from 'react' +import { ReactNode } from 'react' +import { Store } from 'redux' // @public (undocumented) -export type AdvancedComponentDecorator = (component: ComponentType) => ComponentType; +export type AdvancedComponentDecorator = ( + component: ComponentType, +) => ComponentType // @public (undocumented) -export type AnyIfEmpty = keyof T extends never ? any : T; +export type AnyIfEmpty = keyof T extends never ? any : T export { batch } // @public (undocumented) export const connect: { - (): InferableComponentEnhancer; - (mapStateToProps: MapStateToPropsParam): InferableComponentEnhancerWithProps, TOwnProps>; - (mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsNonObject): InferableComponentEnhancerWithProps; - (mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam): InferableComponentEnhancerWithProps, TOwnProps_2>; - (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsNonObject): InferableComponentEnhancerWithProps; - (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam): InferableComponentEnhancerWithProps, TOwnProps_4>; - (mapStateToProps: null | undefined, mapDispatchToProps: null | undefined, mergeProps: MergeProps): InferableComponentEnhancerWithProps; - (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: null | undefined, mergeProps: MergeProps): InferableComponentEnhancerWithProps; - (mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: MergeProps): InferableComponentEnhancerWithProps; - (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: null | undefined, mergeProps: null | undefined, options: ConnectOptions): InferableComponentEnhancerWithProps & TStateProps_4, TOwnProps_8>; - (mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsNonObject, mergeProps: null | undefined, options: ConnectOptions<{}, TStateProps_5, TOwnProps_9, {}>): InferableComponentEnhancerWithProps; - (mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, options: ConnectOptions<{}, TStateProps_6, TOwnProps_10, {}>): InferableComponentEnhancerWithProps, TOwnProps_10>; - (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsNonObject, mergeProps: null | undefined, options: ConnectOptions): InferableComponentEnhancerWithProps; - (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, options: ConnectOptions): InferableComponentEnhancerWithProps, TOwnProps_12>; - (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: MergeProps, options?: ConnectOptions | undefined): InferableComponentEnhancerWithProps; -}; - -// @public (undocumented) -export function connectAdvanced(selectorFactory: SelectorFactory, { getDisplayName, methodName, shouldHandleStateChanges, forwardRef, context, ...connectOptions }?: ConnectAdvancedOptions & Partial): AdvancedComponentDecorator; + (): InferableComponentEnhancer + < + TStateProps = {}, + no_dispatch = {}, + TOwnProps = {}, + State = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + ): InferableComponentEnhancerWithProps< + TStateProps & DispatchProp, + TOwnProps + > + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsNonObject< + TDispatchProps, + TOwnProps_1 + >, + ): InferableComponentEnhancerWithProps + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsParam, + ): InferableComponentEnhancerWithProps< + ResolveThunks, + TOwnProps_2 + > + < + TStateProps_1 = {}, + TDispatchProps_2 = {}, + TOwnProps_3 = {}, + State_1 = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsNonObject< + TDispatchProps_2, + TOwnProps_3 + >, + ): InferableComponentEnhancerWithProps< + TStateProps_1 & TDispatchProps_2, + TOwnProps_3 + > + < + TStateProps_2 = {}, + TDispatchProps_3 = {}, + TOwnProps_4 = {}, + State_2 = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsParam, + ): InferableComponentEnhancerWithProps< + TStateProps_2 & ResolveThunks, + TOwnProps_4 + > + ( + mapStateToProps: null | undefined, + mapDispatchToProps: null | undefined, + mergeProps: MergeProps, + ): InferableComponentEnhancerWithProps + < + TStateProps_3 = {}, + no_dispatch_2 = {}, + TOwnProps_6 = {}, + TMergedProps_1 = {}, + State_3 = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: null | undefined, + mergeProps: MergeProps< + TStateProps_3, + undefined, + TOwnProps_6, + TMergedProps_1 + >, + ): InferableComponentEnhancerWithProps + < + no_state_3 = {}, + TDispatchProps_4 = {}, + TOwnProps_7 = {}, + TMergedProps_2 = {}, + >( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: MergeProps< + undefined, + TDispatchProps_4, + TOwnProps_7, + TMergedProps_2 + >, + ): InferableComponentEnhancerWithProps + < + TStateProps_4 = {}, + no_dispatch_3 = {}, + TOwnProps_8 = {}, + State_4 = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: null | undefined, + mergeProps: null | undefined, + options: ConnectOptions, + ): InferableComponentEnhancerWithProps< + DispatchProp & TStateProps_4, + TOwnProps_8 + > + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsNonObject< + TDispatchProps_5, + TOwnProps_9 + >, + mergeProps: null | undefined, + options: ConnectOptions<{}, TStateProps_5, TOwnProps_9, {}>, + ): InferableComponentEnhancerWithProps + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: null | undefined, + options: ConnectOptions<{}, TStateProps_6, TOwnProps_10, {}>, + ): InferableComponentEnhancerWithProps< + ResolveThunks, + TOwnProps_10 + > + < + TStateProps_7 = {}, + TDispatchProps_7 = {}, + TOwnProps_11 = {}, + State_5 = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsNonObject< + TDispatchProps_7, + TOwnProps_11 + >, + mergeProps: null | undefined, + options: ConnectOptions, + ): InferableComponentEnhancerWithProps< + TStateProps_7 & TDispatchProps_7, + TOwnProps_11 + > + < + TStateProps_8 = {}, + TDispatchProps_8 = {}, + TOwnProps_12 = {}, + State_6 = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: null | undefined, + options: ConnectOptions, + ): InferableComponentEnhancerWithProps< + TStateProps_8 & ResolveThunks, + TOwnProps_12 + > + < + TStateProps_9 = {}, + TDispatchProps_9 = {}, + TOwnProps_13 = {}, + TMergedProps_3 = {}, + State_7 = DefaultRootState, + >( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: MergeProps< + TStateProps_9, + TDispatchProps_9, + TOwnProps_13, + TMergedProps_3 + >, + options?: + | ConnectOptions + | undefined, + ): InferableComponentEnhancerWithProps +} + +// @public (undocumented) +export function connectAdvanced( + selectorFactory: SelectorFactory, + { + getDisplayName, + methodName, + shouldHandleStateChanges, + forwardRef, + context, + ...connectOptions + }?: ConnectAdvancedOptions & Partial, +): AdvancedComponentDecorator // @public (undocumented) export interface ConnectAdvancedOptions { - // (undocumented) - context?: typeof ReactReduxContext; - // (undocumented) - forwardRef?: boolean; - // (undocumented) - getDisplayName?: (name: string) => string; - // (undocumented) - methodName?: string; - // (undocumented) - pure?: boolean; - // (undocumented) - shouldHandleStateChanges?: boolean; + // (undocumented) + context?: typeof ReactReduxContext + // (undocumented) + forwardRef?: boolean + // (undocumented) + getDisplayName?: (name: string) => string + // (undocumented) + methodName?: string + // (undocumented) + pure?: boolean + // (undocumented) + shouldHandleStateChanges?: boolean } // @public (undocumented) -export type ConnectedComponent, P> = ComponentType

& NonReactStatics & { - WrappedComponent: C; -}; +export type ConnectedComponent< + C extends ComponentType, + P, +> = ComponentType

& + NonReactStatics & { + WrappedComponent: C + } // @public -export type ConnectedProps = TConnector extends InferableComponentEnhancerWithProps ? unknown extends TInjectedProps ? TConnector extends InferableComponentEnhancer ? TInjectedProps : never : TInjectedProps : never; +export type ConnectedProps = + TConnector extends InferableComponentEnhancerWithProps< + infer TInjectedProps, + any + > + ? unknown extends TInjectedProps + ? TConnector extends InferableComponentEnhancer + ? TInjectedProps + : never + : TInjectedProps + : never // @public (undocumented) export interface ConnectProps { - // (undocumented) - context?: ReactReduxContextInstance; - // (undocumented) - reactReduxForwardedRef?: React_2.ForwardedRef; - // (undocumented) - store?: Store; + // (undocumented) + context?: ReactReduxContextInstance + // (undocumented) + reactReduxForwardedRef?: React_2.ForwardedRef + // (undocumented) + store?: Store } // @public -export function createDispatchHook(context?: Context | null>): () => Dispatch; +export function createDispatchHook( + context?: Context | null>, +): () => Dispatch // @public -export function createSelectorHook(context?: Context | null>): (selector: (state: TState) => Selected, equalityFn?: EqualityFn) => Selected; +export function createSelectorHook( + context?: Context | null>, +): ( + selector: (state: TState) => Selected, + equalityFn?: EqualityFn, +) => Selected // @public -export function createStoreHook(context?: Context | null>): () => Store; +export function createStoreHook( + context?: Context | null>, +): () => Store // @public -export interface DefaultRootState { -} +export interface DefaultRootState {} // @public (undocumented) export interface DispatchProp { - // (undocumented) - dispatch: Dispatch; + // (undocumented) + dispatch: Dispatch } // @public (undocumented) -export type DistributiveOmit = T extends unknown ? Omit_2 : never; +export type DistributiveOmit = T extends unknown + ? Omit_2 + : never // @public (undocumented) -export type EqualityFn = (a: T | undefined, b: T | undefined) => boolean; +export type EqualityFn = (a: T | undefined, b: T | undefined) => boolean // @public (undocumented) -export type FixTypeLater = any; +export type FixTypeLater = any // @public (undocumented) -export type GetProps = C extends ComponentType ? C extends ComponentClass

? ClassAttributes> & P : P : never; +export type GetProps = + C extends ComponentType + ? C extends ComponentClass

+ ? ClassAttributes> & P + : P + : never // @public (undocumented) -export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any ? InferThunkActionCreatorType : TActionCreator; +export type HandleThunkActionCreator = TActionCreator extends ( + ...args: any[] +) => any + ? InferThunkActionCreatorType + : TActionCreator // @public (undocumented) -export type InferableComponentEnhancer = InferableComponentEnhancerWithProps; +export type InferableComponentEnhancer = + InferableComponentEnhancerWithProps // @public (undocumented) -export type InferableComponentEnhancerWithProps = >>>(component: C) => ConnectedComponent, keyof Shared>> & TNeedsProps>; +export type InferableComponentEnhancerWithProps = < + C extends ComponentType>>, +>( + component: C, +) => ConnectedComponent< + C, + DistributiveOmit, keyof Shared>> & + TNeedsProps +> // @public (undocumented) -export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn ? (...args: TParams) => TReturn : TActionCreator; +export type InferThunkActionCreatorType< + TActionCreator extends (...args: any[]) => any, +> = TActionCreator extends ( + ...args: infer TParams +) => (...args: any[]) => infer TReturn + ? (...args: TParams) => TReturn + : TActionCreator // @public (undocumented) -export type MapDispatchToProps = MapDispatchToPropsFunction | TDispatchProps; +export type MapDispatchToProps = + | MapDispatchToPropsFunction + | TDispatchProps // @public (undocumented) -export type MapDispatchToPropsFactory = (dispatch: Dispatch, ownProps: TOwnProps) => MapDispatchToPropsFunction; +export type MapDispatchToPropsFactory = ( + dispatch: Dispatch, + ownProps: TOwnProps, +) => MapDispatchToPropsFunction // @public (undocumented) -export type MapDispatchToPropsFunction = (dispatch: Dispatch, ownProps: TOwnProps) => TDispatchProps; +export type MapDispatchToPropsFunction = ( + dispatch: Dispatch, + ownProps: TOwnProps, +) => TDispatchProps // @public (undocumented) -export type MapDispatchToPropsNonObject = MapDispatchToPropsFactory | MapDispatchToPropsFunction; +export type MapDispatchToPropsNonObject = + | MapDispatchToPropsFactory + | MapDispatchToPropsFunction // @public (undocumented) -export type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; +export type MapDispatchToPropsParam = + | MapDispatchToPropsFactory + | MapDispatchToProps // @public (undocumented) -export type MapStateToProps = (state: State, ownProps: TOwnProps) => TStateProps; +export type MapStateToProps< + TStateProps, + TOwnProps, + State = DefaultRootState, +> = (state: State, ownProps: TOwnProps) => TStateProps // @public (undocumented) -export type MapStateToPropsFactory = (initialState: State, ownProps: TOwnProps) => MapStateToProps; +export type MapStateToPropsFactory< + TStateProps, + TOwnProps, + State = DefaultRootState, +> = ( + initialState: State, + ownProps: TOwnProps, +) => MapStateToProps // @public (undocumented) -export type MapStateToPropsParam = MapStateToPropsFactory | MapStateToProps | null | undefined; +export type MapStateToPropsParam< + TStateProps, + TOwnProps, + State = DefaultRootState, +> = + | MapStateToPropsFactory + | MapStateToProps + | null + | undefined // @public export type Matching = { - [P in keyof DecorationTargetProps]: P extends keyof InjectedProps ? InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : InjectedProps[P] : DecorationTargetProps[P]; -}; + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P] +} // @public (undocumented) -export type MergeProps = (stateProps: TStateProps, dispatchProps: TDispatchProps, ownProps: TOwnProps) => TMergedProps; +export type MergeProps = ( + stateProps: TStateProps, + dispatchProps: TDispatchProps, + ownProps: TOwnProps, +) => TMergedProps // @public (undocumented) -type Omit_2 = Pick>; +type Omit_2 = Pick> export { Omit_2 as Omit } // @public (undocumented) -export function Provider({ store, context, children }: ProviderProps): JSX.Element; +export function Provider({ + store, + context, + children, +}: ProviderProps): JSX.Element // @public (undocumented) export interface ProviderProps { - // (undocumented) - children: ReactNode; - context?: Context; - store: Store; + // (undocumented) + children: ReactNode + context?: Context + store: Store } // @public (undocumented) -export const ReactReduxContext: React_2.Context | null>; +export const ReactReduxContext: React_2.Context | null> // @public (undocumented) -export interface ReactReduxContextValue { - // (undocumented) - store: Store; - // (undocumented) - subscription: Subscription; +export interface ReactReduxContextValue< + SS = FixTypeLater, + A extends Action = AnyAction, +> { + // (undocumented) + store: Store + // (undocumented) + subscription: Subscription } // @public (undocumented) -export type ResolveArrayThunks> = TDispatchProps extends [ -infer A1, -infer A2, -infer A3, -infer A4, -infer A5, -infer A6, -infer A7, -infer A8, -infer A9 -] ? [ -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator -] : TDispatchProps extends [ -infer A1, -infer A2, -infer A3, -infer A4, -infer A5, -infer A6, -infer A7, -infer A8 -] ? [ -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator -] : TDispatchProps extends [ -infer A1, -infer A2, -infer A3, -infer A4, -infer A5, -infer A6, -infer A7 -] ? [ -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator -] : TDispatchProps extends [ -infer A1, -infer A2, -infer A3, -infer A4, -infer A5, -infer A6 -] ? [ -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator -] : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5] ? [ -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator -] : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] ? [ -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator -] : TDispatchProps extends [infer A1, infer A2, infer A3] ? [ -HandleThunkActionCreator, -HandleThunkActionCreator, -HandleThunkActionCreator -] : TDispatchProps extends [infer A1, infer A2] ? [HandleThunkActionCreator, HandleThunkActionCreator] : TDispatchProps extends [infer A1] ? [HandleThunkActionCreator] : TDispatchProps extends Array ? Array> : TDispatchProps extends ReadonlyArray ? ReadonlyArray> : never; +export type ResolveArrayThunks> = + TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + infer A7, + infer A8, + infer A9, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + infer A7, + infer A8, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + infer A7, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [infer A1, infer A2, infer A3] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [infer A1, infer A2] + ? [HandleThunkActionCreator, HandleThunkActionCreator] + : TDispatchProps extends [infer A1] + ? [HandleThunkActionCreator] + : TDispatchProps extends Array + ? Array> + : TDispatchProps extends ReadonlyArray + ? ReadonlyArray> + : never // @public (undocumented) export type ResolveThunks = TDispatchProps extends { - [key: string]: any; -} ? { - [C in keyof TDispatchProps]: HandleThunkActionCreator; -} : TDispatchProps; + [key: string]: any +} + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps // @public (undocumented) -export type RootStateOrAny = AnyIfEmpty; +export type RootStateOrAny = AnyIfEmpty // @public (undocumented) -export type Selector = TOwnProps extends null | undefined ? (state: S) => TProps : (state: S, ownProps: TOwnProps) => TProps; +export type Selector = TOwnProps extends + | null + | undefined + ? (state: S) => TProps + : (state: S, ownProps: TOwnProps) => TProps // @public (undocumented) -export type SelectorFactory = (dispatch: Dispatch, factoryOptions: TFactoryOptions) => Selector; +export type SelectorFactory = ( + dispatch: Dispatch, + factoryOptions: TFactoryOptions, +) => Selector // @public (undocumented) -export function shallowEqual(objA: any, objB: any): boolean; +export function shallowEqual(objA: any, objB: any): boolean // @public export type Shared = { - [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; -}; + [P in Extract< + keyof InjectedProps, + keyof DecorationTargetProps + >]?: InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : never +} // @public export interface TypedUseSelectorHook { - // (undocumented) - (selector: (state: TState) => TSelected, equalityFn?: (left: TSelected, right: TSelected) => boolean): TSelected; + // (undocumented) + ( + selector: (state: TState) => TSelected, + equalityFn?: (left: TSelected, right: TSelected) => boolean, + ): TSelected } // @public -export const useDispatch: () => Dispatch; +export const useDispatch: () => Dispatch // @public -export const useSelector: (selector: (state: TState) => Selected, equalityFn?: EqualityFn | undefined) => Selected; +export const useSelector: ( + selector: (state: TState) => Selected, + equalityFn?: EqualityFn | undefined, +) => Selected // @public -export const useStore: () => Store; +export const useStore: () => Store // (No @packageDocumentation comment for this package) - ``` diff --git a/etc/react-redux.dt-types.api.md b/etc/react-redux.dt-types.api.md index 418d1175d..6403e9eba 100644 --- a/etc/react-redux.dt-types.api.md +++ b/etc/react-redux.dt-types.api.md @@ -3,405 +3,598 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts - -import { Action } from 'redux'; -import { AnyAction } from 'redux'; -import { ClassAttributes } from 'react'; -import { Component } from 'react'; -import { ComponentClass } from 'react'; -import { ComponentType } from 'react'; -import { Context } from 'react'; -import { Dispatch } from 'redux'; -import hoistNonReactStatics = require('hoist-non-react-statics'); -import { NamedExoticComponent } from 'react'; -import { Store } from 'redux'; +import { Action } from 'redux' +import { AnyAction } from 'redux' +import { ClassAttributes } from 'react' +import { Component } from 'react' +import { ComponentClass } from 'react' +import { ComponentType } from 'react' +import { Context } from 'react' +import { Dispatch } from 'redux' +import hoistNonReactStatics = require('hoist-non-react-statics') +import { NamedExoticComponent } from 'react' +import { Store } from 'redux' // @public (undocumented) -export type AdvancedComponentDecorator = -(component: ComponentType) => NamedExoticComponent; +export type AdvancedComponentDecorator = ( + component: ComponentType, +) => NamedExoticComponent // @public (undocumented) -export type AnyIfEmpty = keyof T extends never ? any : T; +export type AnyIfEmpty = keyof T extends never ? any : T // @public -export function batch(cb: () => void): void; +export function batch(cb: () => void): void // @public export interface Connect { - // tslint:disable:no-unnecessary-generics - // (undocumented) - (): InferableComponentEnhancer; + // tslint:disable:no-unnecessary-generics + // (undocumented) + (): InferableComponentEnhancer - // (undocumented) - ( - mapStateToProps: MapStateToPropsParam - ): InferableComponentEnhancerWithProps; + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + ): InferableComponentEnhancerWithProps - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: null | undefined, - mapDispatchToProps: MapDispatchToPropsNonObject - ): InferableComponentEnhancerWithProps; + mapDispatchToProps: MapDispatchToPropsNonObject, + ): InferableComponentEnhancerWithProps - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, - ): InferableComponentEnhancerWithProps< + ): InferableComponentEnhancerWithProps< ResolveThunks, TOwnProps - >; + > - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: MapStateToPropsParam, - mapDispatchToProps: MapDispatchToPropsNonObject - ): InferableComponentEnhancerWithProps; + mapDispatchToProps: MapDispatchToPropsNonObject, + ): InferableComponentEnhancerWithProps< + TStateProps & TDispatchProps, + TOwnProps + > - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, - ): InferableComponentEnhancerWithProps< + ): InferableComponentEnhancerWithProps< TStateProps & ResolveThunks, TOwnProps - >; + > - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: null | undefined, mapDispatchToProps: null | undefined, mergeProps: MergeProps, - ): InferableComponentEnhancerWithProps; - - // (undocumented) - ( + ): InferableComponentEnhancerWithProps + + // (undocumented) + < + TStateProps = {}, + no_dispatch = {}, + TOwnProps = {}, + TMergedProps = {}, + State = DefaultState, + >( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: null | undefined, mergeProps: MergeProps, - ): InferableComponentEnhancerWithProps; + ): InferableComponentEnhancerWithProps - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: MergeProps, - ): InferableComponentEnhancerWithProps; + ): InferableComponentEnhancerWithProps - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: null | undefined, mergeProps: null | undefined, - options: Options - ): InferableComponentEnhancerWithProps; + options: Options, + ): InferableComponentEnhancerWithProps - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsNonObject, mergeProps: null | undefined, - options: Options<{}, TStateProps, TOwnProps> - ): InferableComponentEnhancerWithProps; + options: Options<{}, TStateProps, TOwnProps>, + ): InferableComponentEnhancerWithProps - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, - options: Options<{}, TStateProps, TOwnProps> - ): InferableComponentEnhancerWithProps< + options: Options<{}, TStateProps, TOwnProps>, + ): InferableComponentEnhancerWithProps< ResolveThunks, TOwnProps - >; + > - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsNonObject, mergeProps: null | undefined, - options: Options - ): InferableComponentEnhancerWithProps; + options: Options, + ): InferableComponentEnhancerWithProps< + TStateProps & TDispatchProps, + TOwnProps + > - // (undocumented) - ( + // (undocumented) + ( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, mergeProps: null | undefined, - options: Options - ): InferableComponentEnhancerWithProps< + options: Options, + ): InferableComponentEnhancerWithProps< TStateProps & ResolveThunks, TOwnProps - >; - - // (undocumented) - ( + > + + // (undocumented) + < + TStateProps = {}, + TDispatchProps = {}, + TOwnProps = {}, + TMergedProps = {}, + State = DefaultState, + >( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: MapDispatchToPropsParam, - mergeProps: MergeProps, - options?: Options - ): InferableComponentEnhancerWithProps; - // tslint:enable:no-unnecessary-generics + mergeProps: MergeProps< + TStateProps, + TDispatchProps, + TOwnProps, + TMergedProps + >, + options?: Options, + ): InferableComponentEnhancerWithProps + // tslint:enable:no-unnecessary-generics } // @public -export const connect: Connect; +export const connect: Connect // @public export function connectAdvanced( -// tslint:disable-next-line no-unnecessary-generics -selectorFactory: SelectorFactory, -connectOptions?: ConnectOptions & TFactoryOptions -): AdvancedComponentDecorator; + // tslint:disable-next-line no-unnecessary-generics + selectorFactory: SelectorFactory, + connectOptions?: ConnectOptions & TFactoryOptions, +): AdvancedComponentDecorator // @public (undocumented) export type ConnectedComponent< -C extends ComponentType, -P -> = NamedExoticComponent> & hoistNonReactStatics.NonReactStatics & { - WrappedComponent: C; -}; + C extends ComponentType, + P, +> = NamedExoticComponent> & + hoistNonReactStatics.NonReactStatics & { + WrappedComponent: C + } // @public export type ConnectedProps = -TConnector extends InferableComponentEnhancerWithProps -? unknown extends TInjectedProps -? TConnector extends InferableComponentEnhancer -? TInjectedProps -: never -: TInjectedProps -: never; + TConnector extends InferableComponentEnhancerWithProps< + infer TInjectedProps, + any + > + ? unknown extends TInjectedProps + ? TConnector extends InferableComponentEnhancer + ? TInjectedProps + : never + : TInjectedProps + : never // @public (undocumented) export interface ConnectOptions { - context?: Context; - getDisplayName?: (componentName: string) => string; - methodName?: string; - renderCountProp?: string; - shouldHandleStateChanges?: boolean; - storeKey?: string; - // @deprecated (undocumented) - withRef?: boolean; + context?: Context + getDisplayName?: (componentName: string) => string + methodName?: string + renderCountProp?: string + shouldHandleStateChanges?: boolean + storeKey?: string + // @deprecated (undocumented) + withRef?: boolean } // @public -export function createDispatchHook( -context?: Context>, -): () => Dispatch; +export function createDispatchHook< + S = RootStateOrAny, + A extends Action = AnyAction, +>(context?: Context>): () => Dispatch // @public -export function createSelectorHook( -context?: Context>, +export function createSelectorHook< + S = RootStateOrAny, + A extends Action = AnyAction, +>( + context?: Context>, ): ( -selector: (state: S) => Selected, -equalityFn?: (previous: Selected, next: Selected) => boolean, -) => Selected; + selector: (state: S) => Selected, + equalityFn?: (previous: Selected, next: Selected) => boolean, +) => Selected // @public -export function createStoreHook( -context?: Context>, -): () => Store; +export function createStoreHook< + S = RootStateOrAny, + A extends Action = AnyAction, +>(context?: Context>): () => Store // @public export interface DefaultRootState {} // @public (undocumented) export interface DispatchProp { - // (undocumented) - dispatch: Dispatch; + // (undocumented) + dispatch: Dispatch } // @public (undocumented) -export type DistributiveOmit = T extends unknown ? Omit_2 : never; +export type DistributiveOmit = T extends unknown + ? Omit_2 + : never // @public (undocumented) -export type GetProps = C extends ComponentType -? C extends ComponentClass

? ClassAttributes> & P : P -: never; +export type GetProps = + C extends ComponentType + ? C extends ComponentClass

+ ? ClassAttributes> & P + : P + : never // @public (undocumented) -export type HandleThunkActionCreator = -TActionCreator extends (...args: any[]) => any -? InferThunkActionCreatorType -: TActionCreator; +export type HandleThunkActionCreator = TActionCreator extends ( + ...args: any[] +) => any + ? InferThunkActionCreatorType + : TActionCreator // @public (undocumented) export type InferableComponentEnhancer = -InferableComponentEnhancerWithProps; + InferableComponentEnhancerWithProps // @public (undocumented) -export type InferableComponentEnhancerWithProps = ->>>( -component: C -) => ConnectedComponent, keyof Shared>> & TNeedsProps>; +export type InferableComponentEnhancerWithProps = < + C extends ComponentType>>, +>( + component: C, +) => ConnectedComponent< + C, + DistributiveOmit, keyof Shared>> & + TNeedsProps +> // @public (undocumented) -export type InferThunkActionCreatorType any> = -TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn -? (...args: TParams) => TReturn -: TActionCreator; +export type InferThunkActionCreatorType< + TActionCreator extends (...args: any[]) => any, +> = TActionCreator extends ( + ...args: infer TParams +) => (...args: any[]) => infer TReturn + ? (...args: TParams) => TReturn + : TActionCreator // @public (undocumented) export type MapDispatchToProps = -MapDispatchToPropsFunction | TDispatchProps; + | MapDispatchToPropsFunction + | TDispatchProps // @public (undocumented) -export type MapDispatchToPropsFactory = -(dispatch: Dispatch, ownProps: TOwnProps) => MapDispatchToPropsFunction; +export type MapDispatchToPropsFactory = ( + dispatch: Dispatch, + ownProps: TOwnProps, +) => MapDispatchToPropsFunction // @public (undocumented) -export type MapDispatchToPropsFunction = -(dispatch: Dispatch, ownProps: TOwnProps) => TDispatchProps; +export type MapDispatchToPropsFunction = ( + dispatch: Dispatch, + ownProps: TOwnProps, +) => TDispatchProps // @public (undocumented) -export type MapDispatchToPropsNonObject = MapDispatchToPropsFactory | MapDispatchToPropsFunction; +export type MapDispatchToPropsNonObject = + | MapDispatchToPropsFactory + | MapDispatchToPropsFunction // @public (undocumented) -export type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; +export type MapDispatchToPropsParam = + | MapDispatchToPropsFactory + | MapDispatchToProps // @public (undocumented) -export type MapStateToProps = -(state: State, ownProps: TOwnProps) => TStateProps; +export type MapStateToProps< + TStateProps, + TOwnProps, + State = DefaultRootState, +> = (state: State, ownProps: TOwnProps) => TStateProps // @public (undocumented) -export type MapStateToPropsFactory = -(initialState: State, ownProps: TOwnProps) => MapStateToProps; +export type MapStateToPropsFactory< + TStateProps, + TOwnProps, + State = DefaultRootState, +> = ( + initialState: State, + ownProps: TOwnProps, +) => MapStateToProps // @public (undocumented) -export type MapStateToPropsParam = -MapStateToPropsFactory | MapStateToProps | null | undefined; +export type MapStateToPropsParam< + TStateProps, + TOwnProps, + State = DefaultRootState, +> = + | MapStateToPropsFactory + | MapStateToProps + | null + | undefined // @public export type Matching = { - [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps ? InjectedProps[P] extends DecorationTargetProps[P] - ? DecorationTargetProps[P] - : InjectedProps[P] - : DecorationTargetProps[P]; -}; + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P] +} // @public (undocumented) -export type MergeProps = -(stateProps: TStateProps, dispatchProps: TDispatchProps, ownProps: TOwnProps) => TMergedProps; +export type MergeProps = ( + stateProps: TStateProps, + dispatchProps: TDispatchProps, + ownProps: TOwnProps, +) => TMergedProps // @public (undocumented) -type Omit_2 = Pick>; +type Omit_2 = Pick> export { Omit_2 as Omit } // @public (undocumented) -export interface Options extends ConnectOptions { - areMergedPropsEqual?: (nextMergedProps: TMergedProps, prevMergedProps: TMergedProps) => boolean; - - areOwnPropsEqual?: (nextOwnProps: TOwnProps, prevOwnProps: TOwnProps) => boolean; - - areStatePropsEqual?: (nextStateProps: TStateProps, prevStateProps: TStateProps) => boolean; - - areStatesEqual?: (nextState: State, prevState: State) => boolean; - - forwardRef?: boolean; - - pure?: boolean; +export interface Options< + State = DefaultRootState, + TStateProps = {}, + TOwnProps = {}, + TMergedProps = {}, +> extends ConnectOptions { + areMergedPropsEqual?: ( + nextMergedProps: TMergedProps, + prevMergedProps: TMergedProps, + ) => boolean + + areOwnPropsEqual?: ( + nextOwnProps: TOwnProps, + prevOwnProps: TOwnProps, + ) => boolean + + areStatePropsEqual?: ( + nextStateProps: TStateProps, + prevStateProps: TStateProps, + ) => boolean + + areStatesEqual?: (nextState: State, prevState: State) => boolean + + forwardRef?: boolean + + pure?: boolean } // @public -export class Provider extends Component> { } +export class Provider extends Component< + ProviderProps +> {} // @public (undocumented) export interface ProviderProps { - context?: Context; - store: Store; + context?: Context + store: Store } // @public -export const ReactReduxContext: Context; +export const ReactReduxContext: Context // @public (undocumented) -export interface ReactReduxContextValue { - // (undocumented) - store: Store; - // (undocumented) - storeState: SS; +export interface ReactReduxContextValue< + SS = any, + A extends Action = AnyAction, +> { + // (undocumented) + store: Store + // (undocumented) + storeState: SS } // @public (undocumented) export type ResolveArrayThunks> = -TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8, infer A9] -? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, -HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8] -? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, -HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7] -? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, -HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6] -? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5] -? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] ? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1, infer A2, infer A3] ? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1, infer A2] ? [HandleThunkActionCreator, HandleThunkActionCreator] -: TDispatchProps extends [infer A1] ? [HandleThunkActionCreator] -: TDispatchProps extends Array ? Array> -: TDispatchProps extends ReadonlyArray ? ReadonlyArray> -: never -; + TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + infer A7, + infer A8, + infer A9, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + infer A7, + infer A8, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + infer A7, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + infer A6, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [ + infer A1, + infer A2, + infer A3, + infer A4, + infer A5, + ] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [infer A1, infer A2, infer A3] + ? [ + HandleThunkActionCreator, + HandleThunkActionCreator, + HandleThunkActionCreator, + ] + : TDispatchProps extends [infer A1, infer A2] + ? [HandleThunkActionCreator, HandleThunkActionCreator] + : TDispatchProps extends [infer A1] + ? [HandleThunkActionCreator] + : TDispatchProps extends Array + ? Array> + : TDispatchProps extends ReadonlyArray + ? ReadonlyArray> + : never // @public (undocumented) -export type ResolveThunks = -TDispatchProps extends { [key: string]: any } -? { - [C in keyof TDispatchProps]: HandleThunkActionCreator +export type ResolveThunks = TDispatchProps extends { + [key: string]: any } -: TDispatchProps; + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps // @public (undocumented) -export type RootStateOrAny = AnyIfEmpty; +export type RootStateOrAny = AnyIfEmpty // @public (undocumented) -export type Selector = TOwnProps extends null | undefined -? (state: S) => TProps -: (state: S, ownProps: TOwnProps) => TProps; +export type Selector = TOwnProps extends + | null + | undefined + ? (state: S) => TProps + : (state: S, ownProps: TOwnProps) => TProps // @public -export type SelectorFactory = -(dispatch: Dispatch, factoryOptions: TFactoryOptions) => Selector; +export type SelectorFactory = ( + dispatch: Dispatch, + factoryOptions: TFactoryOptions, +) => Selector // @public -export function shallowEqual(left: T, right: any): boolean; +export function shallowEqual(left: T, right: any): boolean // @public -export type Shared< -InjectedProps, -DecorationTargetProps -> = { - [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; -}; +export type Shared = { + [P in Extract< + keyof InjectedProps, + keyof DecorationTargetProps + >]?: InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : never +} // @public export interface TypedUseSelectorHook { - // (undocumented) - ( + // (undocumented) + ( selector: (state: TState) => TSelected, - equalityFn?: (left: TSelected, right: TSelected) => boolean - ): TSelected; + equalityFn?: (left: TSelected, right: TSelected) => boolean, + ): TSelected } // @public -export function useDispatch>(): TDispatch; +export function useDispatch>(): TDispatch // @public (undocumented) -export function useDispatch(): Dispatch; +export function useDispatch(): Dispatch // @public export function useSelector( -selector: (state: TState) => TSelected, -equalityFn?: (left: TSelected, right: TSelected) => boolean -): TSelected; + selector: (state: TState) => TSelected, + equalityFn?: (left: TSelected, right: TSelected) => boolean, +): TSelected // @public -export function useStore(): Store; +export function useStore< + S = RootStateOrAny, + A extends Action = AnyAction, +>(): Store // (No @packageDocumentation comment for this package) - ``` diff --git a/examples/publish-ci/rr-rsc-context/app/page.module.css b/examples/publish-ci/rr-rsc-context/app/page.module.css index 9411a5e6f..06faba876 100644 --- a/examples/publish-ci/rr-rsc-context/app/page.module.css +++ b/examples/publish-ci/rr-rsc-context/app/page.module.css @@ -51,7 +51,9 @@ border-radius: var(--border-radius); background: rgba(var(--card-rgb), 0); border: 1px solid rgba(var(--card-border-rgb), 0); - transition: background 200ms, border 200ms; + transition: + background 200ms, + border 200ms; } .card span { diff --git a/src/types.ts b/src/types.ts index 10a443443..23829ef35 100644 --- a/src/types.ts +++ b/src/types.ts @@ -70,11 +70,12 @@ export type Shared = { } // Infers prop type from component C -export type GetProps = C extends ComponentType - ? C extends ComponentClass

- ? ClassAttributes> & P - : P - : never +export type GetProps = + C extends ComponentType + ? C extends ComponentClass

+ ? ClassAttributes> & P + : P + : never // Applies LibraryManagedAttributes (proper handling of defaultProps // and propTypes). diff --git a/test/tsconfig.test.json b/test/tsconfig.test.json index 461da76db..ef31e2046 100644 --- a/test/tsconfig.test.json +++ b/test/tsconfig.test.json @@ -13,6 +13,6 @@ "baseUrl": ".", "skipLibCheck": true, "noImplicitReturns": false, - "experimentalDecorators": true, + "experimentalDecorators": true } } diff --git a/test/typeTestHelpers.ts b/test/typeTestHelpers.ts index 36edf7fb1..13b13f31f 100644 --- a/test/typeTestHelpers.ts +++ b/test/typeTestHelpers.ts @@ -28,18 +28,13 @@ type Equals = IsAny< IsAny > -export type IsEqual = (() => G extends A ? 1 : 2) extends < - G, ->() => G extends B ? 1 : 2 - ? true - : false +export type IsEqual = + (() => G extends A ? 1 : 2) extends () => G extends B ? 1 : 2 + ? true + : false -export type IfEquals< - T, - U, - TypeIfEquals = unknown, - TypeIfNotEquals = never, -> = IsEqual extends true ? TypeIfEquals : TypeIfNotEquals +export type IfEquals = + IsEqual extends true ? TypeIfEquals : TypeIfNotEquals export declare const exactType: ( draft: T & IfEquals, diff --git a/test/typetests/tsconfig.json b/test/typetests/tsconfig.json index 5d96894d5..ddee7abf2 100644 --- a/test/typetests/tsconfig.json +++ b/test/typetests/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../tsconfig.test.json", - "compilerOptions": { - }, + "compilerOptions": {}, "include": ["./*.ts*"], "exclude": [] } diff --git a/tsup.config.ts b/tsup.config.ts index 27625e102..a4dd05844 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -11,7 +11,7 @@ if (process.env.NODE_ENV === 'production') { module.exports = require('./react-redux.production.min.cjs') } else { module.exports = require('./react-redux.development.cjs') -}` +}`, ) } diff --git a/vitest.setup.ts b/vitest.setup.ts index b9e762299..a9d0dd31a 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -1 +1 @@ -import "@testing-library/jest-dom/vitest" +import '@testing-library/jest-dom/vitest' diff --git a/website/README.md b/website/README.md index f3da77ff3..056686194 100644 --- a/website/README.md +++ b/website/README.md @@ -2,11 +2,11 @@ This website was created with [Docusaurus](https://docusaurus.io/). # What's In This Document -* [Get Started in 5 Minutes](#get-started-in-5-minutes) -* [Directory Structure](#directory-structure) -* [Editing Content](#editing-content) -* [Adding Content](#adding-content) -* [Full Documentation](#full-documentation) +- [Get Started in 5 Minutes](#get-started-in-5-minutes) +- [Directory Structure](#directory-structure) +- [Editing Content](#editing-content) +- [Adding Content](#adding-content) +- [Full Documentation](#full-documentation) # Get Started in 5 Minutes @@ -16,6 +16,7 @@ This website was created with [Docusaurus](https://docusaurus.io/). # Install dependencies $ yarn ``` + 2. Run your dev server: ```sh @@ -72,6 +73,7 @@ For more information about docs, click [here](https://docusaurus.io/docs/en/navi Edit blog posts by navigating to `website/blog` and editing the corresponding post: `website/blog/post-to-be-edited.md` + ```markdown --- id: post-needs-edit @@ -121,6 +123,7 @@ For more information about adding new docs, click [here](https://docusaurus.io/d 1. Make sure there is a header link to your blog in `website/siteConfig.js`: `website/siteConfig.js` + ```javascript headerLinks: [ ... @@ -151,6 +154,7 @@ For more information about blog posts, click [here](https://docusaurus.io/docs/e 1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`: `website/siteConfig.js` + ```javascript { headerLinks: [ @@ -175,6 +179,7 @@ For more information about the navigation bar, click [here](https://docusaurus.i 1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element: `website/siteConfig.js` + ```javascript { headerLinks: [ diff --git a/website/src/pages/index.js b/website/src/pages/index.js index fe8679d3d..c129c9e2c 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -125,7 +125,7 @@ function Home() { diff --git a/website/src/theme/NotFound.js b/website/src/theme/NotFound.js index 898ae2b96..a5e8e2f2a 100644 --- a/website/src/theme/NotFound.js +++ b/website/src/theme/NotFound.js @@ -12,32 +12,37 @@ function NotFound() { const context = useDocusaurusContext() const { siteConfig = {} } = context useEffect(() => { - const script = document.createElement("script"); - script.src = "https://buttons.github.io/buttons.js"; - script.async = true; - document.body.appendChild(script); + const script = document.createElement('script') + script.src = 'https://buttons.github.io/buttons.js' + script.async = true + document.body.appendChild(script) }, []) const getTrackingScript = () => { - if (!siteConfig.themeConfig || !siteConfig.themeConfig.googleAnalytics || !siteConfig.themeConfig.googleAnalytics.gaTrackingId) { - return null; + if ( + !siteConfig.themeConfig || + !siteConfig.themeConfig.googleAnalytics || + !siteConfig.themeConfig.googleAnalytics.gaTrackingId + ) { + return null } - - return {__html:` + + return { + __html: ` ga('create', "${siteConfig.gaTrackingId}"); ga('send', { hitType: 'event', eventCategory: '404 Response', eventAction: window.location.href, eventLabel: document.referrer - });` + });`, } - }; - const trackingScript = getTrackingScript(); - + } + const trackingScript = getTrackingScript() + return ( - {trackingScript &&