@appkit/dek-plugin 0.13.0 → 0.14.0
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DekApi } from '../api';
|
|
2
2
|
import { DekApiStateType } from '../state';
|
|
3
|
-
export type DekApiSetStateAction = (value: DekApiStateType) => void;
|
|
4
3
|
export type DekApiStateSetFunc = (value: DekApiStateType) => DekApiStateType;
|
|
5
|
-
|
|
6
|
-
declare function usePluginState(api: DekApi, key: string
|
|
7
|
-
declare function usePluginState(api: DekApi, key: string, defaultValue:
|
|
8
|
-
declare function usePluginState(api: DekApi, key: string, defaultValue:
|
|
9
|
-
declare function usePluginState(api: DekApi, key: string, defaultValue:
|
|
10
|
-
declare function usePluginState(api: DekApi, key: string, defaultValue:
|
|
4
|
+
export type DekApiStateSetter = (newValueOrFn: DekApiStateType | DekApiStateSetFunc) => void;
|
|
5
|
+
declare function usePluginState(api: DekApi, key: string): [DekApiStateType | undefined, DekApiStateSetter];
|
|
6
|
+
declare function usePluginState(api: DekApi, key: string, defaultValue: string): [string, DekApiStateSetter];
|
|
7
|
+
declare function usePluginState(api: DekApi, key: string, defaultValue: number): [number, DekApiStateSetter];
|
|
8
|
+
declare function usePluginState(api: DekApi, key: string, defaultValue: boolean): [boolean, DekApiStateSetter];
|
|
9
|
+
declare function usePluginState(api: DekApi, key: string, defaultValue: Array<any>): [Array<any>, DekApiStateSetter];
|
|
10
|
+
declare function usePluginState(api: DekApi, key: string, defaultValue: Record<string, any>): [Record<string, any>, DekApiStateSetter];
|
|
11
11
|
export default usePluginState;
|