react-hooks-global-states 14.0.0 → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/createContext.d.ts +5 -5
- package/package.json +1 -1
package/createContext.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type PropsWithChildren, Context as ReactContext } from 'react';
|
|
2
|
-
import type { BaseMetadata, GlobalStoreCallbacks, UseHookOptions, AnyFunction, StoreTools as StoreToolsBase, ReadonlyStateApi, SelectHook, ObservableFragment, StateApi
|
|
2
|
+
import type { BaseMetadata, GlobalStoreCallbacks, UseHookOptions, AnyFunction, StoreTools as StoreToolsBase, ReadonlyStateApi, SelectHook, ObservableFragment, StateApi } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* @description Resulting type of the action collection configuration
|
|
5
5
|
*/
|
|
@@ -85,7 +85,7 @@ export type ContextProviderExtensions<State, StateMutator, Metadata extends Base
|
|
|
85
85
|
/**
|
|
86
86
|
* @description Full context instance
|
|
87
87
|
*/
|
|
88
|
-
context:
|
|
88
|
+
context: ContextStoreTools<State, StateMutator extends AnyFunction ? null : StateMutator, Metadata>) => void;
|
|
89
89
|
}) => {
|
|
90
90
|
/**
|
|
91
91
|
* Provider for the context
|
|
@@ -103,7 +103,7 @@ export type ContextProviderExtensions<State, StateMutator, Metadata extends Base
|
|
|
103
103
|
/**
|
|
104
104
|
* @description Current context value
|
|
105
105
|
*/
|
|
106
|
-
current:
|
|
106
|
+
current: ContextStoreTools<State, StateMutator extends AnyFunction ? null : StateMutator, Metadata>;
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
};
|
|
@@ -124,7 +124,7 @@ export type ContextProvider<State, StateMutator, Metadata extends BaseMetadata>
|
|
|
124
124
|
/**
|
|
125
125
|
* @description Full context instance
|
|
126
126
|
*/
|
|
127
|
-
context:
|
|
127
|
+
context: ContextStoreTools<State, StateMutator extends AnyFunction ? null : StateMutator, Metadata>) => void;
|
|
128
128
|
}>> & ContextProviderExtensions<State, StateMutator, Metadata>;
|
|
129
129
|
/**
|
|
130
130
|
* @description Represents a hook that returns a readonly state.
|
|
@@ -539,5 +539,5 @@ export declare const createContext: CreateContext;
|
|
|
539
539
|
* ContextApi<number, React.Dispatch<React.SetStateAction<number>>, BaseMetadata>;
|
|
540
540
|
* ```
|
|
541
541
|
*/
|
|
542
|
-
export type InferContextApi<Context extends ReactContext<ContextHook<any, any, any> | null>> = NonNullable<React.ContextType<Context>> extends ContextHook<infer State, infer StateMutator, infer Metadata> ?
|
|
542
|
+
export type InferContextApi<Context extends ReactContext<ContextHook<any, any, any> | null>> = NonNullable<React.ContextType<Context>> extends ContextHook<infer State, infer StateMutator, infer Metadata> ? ContextStoreTools<State, StateMutator extends AnyFunction ? null : StateMutator, Metadata> : never;
|
|
543
543
|
export default createContext;
|
package/package.json
CHANGED