@wordpress/hooks 4.26.1-next.719a03cbe.0 → 4.27.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.
- package/CHANGELOG.md +2 -0
- package/build/createAddHook.js +5 -13
- package/build/createAddHook.js.map +1 -1
- package/build/createCurrentHook.js +7 -3
- package/build/createCurrentHook.js.map +1 -1
- package/build/createDidHook.js +4 -8
- package/build/createDidHook.js.map +1 -1
- package/build/createDoingHook.js +7 -8
- package/build/createDoingHook.js.map +1 -1
- package/build/createHasHook.js +8 -10
- package/build/createHasHook.js.map +1 -1
- package/build/createHooks.js +2 -8
- package/build/createHooks.js.map +1 -1
- package/build/createRemoveHook.js +8 -15
- package/build/createRemoveHook.js.map +1 -1
- package/build/createRunHook.js +9 -5
- package/build/createRunHook.js.map +1 -1
- package/build/index.js +36 -33
- package/build/index.js.map +1 -1
- package/build/types.js +6 -0
- package/build/types.js.map +1 -0
- package/build/validateHookName.js +4 -4
- package/build/validateHookName.js.map +1 -1
- package/build/validateNamespace.js +3 -3
- package/build/validateNamespace.js.map +1 -1
- package/build-module/createAddHook.js +5 -13
- package/build-module/createAddHook.js.map +1 -1
- package/build-module/createCurrentHook.js +7 -3
- package/build-module/createCurrentHook.js.map +1 -1
- package/build-module/createDidHook.js +4 -8
- package/build-module/createDidHook.js.map +1 -1
- package/build-module/createDoingHook.js +7 -8
- package/build-module/createDoingHook.js.map +1 -1
- package/build-module/createHasHook.js +8 -10
- package/build-module/createHasHook.js.map +1 -1
- package/build-module/createHooks.js +1 -8
- package/build-module/createHooks.js.map +1 -1
- package/build-module/createRemoveHook.js +8 -15
- package/build-module/createRemoveHook.js.map +1 -1
- package/build-module/createRunHook.js +9 -5
- package/build-module/createRunHook.js.map +1 -1
- package/build-module/index.js +1 -34
- package/build-module/index.js.map +1 -1
- package/build-module/types.js +2 -0
- package/build-module/types.js.map +1 -0
- package/build-module/validateHookName.js +4 -4
- package/build-module/validateHookName.js.map +1 -1
- package/build-module/validateNamespace.js +3 -3
- package/build-module/validateNamespace.js.map +1 -1
- package/build-types/createAddHook.d.ts +22 -14
- package/build-types/createAddHook.d.ts.map +1 -1
- package/build-types/createCurrentHook.d.ts +9 -5
- package/build-types/createCurrentHook.d.ts.map +1 -1
- package/build-types/createDidHook.d.ts +11 -13
- package/build-types/createDidHook.d.ts.map +1 -1
- package/build-types/createDoingHook.d.ts +12 -12
- package/build-types/createDoingHook.d.ts.map +1 -1
- package/build-types/createHasHook.d.ts +16 -14
- package/build-types/createHasHook.d.ts.map +1 -1
- package/build-types/createHooks.d.ts +35 -26
- package/build-types/createHooks.d.ts.map +1 -1
- package/build-types/createRemoveHook.d.ts +16 -18
- package/build-types/createRemoveHook.d.ts.map +1 -1
- package/build-types/createRunHook.d.ts +12 -7
- package/build-types/createRunHook.d.ts.map +1 -1
- package/build-types/index.d.ts +5 -86
- package/build-types/index.d.ts.map +1 -1
- package/build-types/types.d.ts +27 -0
- package/build-types/types.d.ts.map +1 -0
- package/build-types/validateHookName.d.ts +5 -5
- package/build-types/validateHookName.d.ts.map +1 -1
- package/build-types/validateNamespace.d.ts +4 -4
- package/build-types/validateNamespace.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/{createAddHook.js → createAddHook.ts} +29 -16
- package/src/{createCurrentHook.js → createCurrentHook.ts} +12 -4
- package/src/{createDidHook.js → createDidHook.ts} +12 -9
- package/src/{createDoingHook.js → createDoingHook.ts} +15 -9
- package/src/{createHasHook.js → createHasHook.ts} +19 -11
- package/src/{createHooks.js → createHooks.ts} +26 -5
- package/src/{createRemoveHook.js → createRemoveHook.ts} +24 -16
- package/src/{createRunHook.js → createRunHook.ts} +21 -6
- package/src/{index.js → index.ts} +1 -32
- package/src/types.ts +31 -0
- package/src/{validateHookName.js → validateHookName.ts} +5 -5
- package/src/{validateNamespace.js → validateNamespace.ts} +4 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,29 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import validateNamespace from './validateNamespace
|
|
5
|
-
import validateHookName from './validateHookName
|
|
4
|
+
import validateNamespace from './validateNamespace';
|
|
5
|
+
import validateHookName from './validateHookName';
|
|
6
|
+
import type { Callback, Hooks, StoreKey } from '.';
|
|
7
|
+
import type { Handler, HookInfo } from './types';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
|
-
* @callback AddHook
|
|
9
10
|
*
|
|
10
11
|
* Adds the hook to the appropriate hooks container.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} hookName Name of hook to add
|
|
13
|
-
* @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.
|
|
14
|
-
* @param {import('.').Callback} callback Function to call when the hook is run
|
|
15
|
-
* @param {number} [priority=10] Priority of this hook
|
|
16
12
|
*/
|
|
13
|
+
export type AddHook = (
|
|
14
|
+
/**
|
|
15
|
+
* Name of hook to add
|
|
16
|
+
*/
|
|
17
|
+
hookName: string,
|
|
18
|
+
/**
|
|
19
|
+
* The unique namespace identifying the callback in the form.
|
|
20
|
+
*/
|
|
21
|
+
namespace: string,
|
|
22
|
+
/**
|
|
23
|
+
* Function to call when the hook is run.
|
|
24
|
+
*/
|
|
25
|
+
callback: Callback,
|
|
26
|
+
/**
|
|
27
|
+
* Priority of this hook
|
|
28
|
+
*/
|
|
29
|
+
priority?: number
|
|
30
|
+
) => void;
|
|
17
31
|
|
|
18
32
|
/**
|
|
19
33
|
* Returns a function which, when invoked, will add a hook.
|
|
20
34
|
*
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
35
|
+
* @param hooks Hooks instance.
|
|
36
|
+
* @param storeKey
|
|
23
37
|
*
|
|
24
|
-
* @return
|
|
38
|
+
* @return Function that adds a new hook.
|
|
25
39
|
*/
|
|
26
|
-
function createAddHook( hooks, storeKey ) {
|
|
40
|
+
function createAddHook( hooks: Hooks, storeKey: StoreKey ): AddHook {
|
|
27
41
|
return function addHook( hookName, namespace, callback, priority = 10 ) {
|
|
28
42
|
const hooksStore = hooks[ storeKey ];
|
|
29
43
|
|
|
@@ -50,14 +64,13 @@ function createAddHook( hooks, storeKey ) {
|
|
|
50
64
|
return;
|
|
51
65
|
}
|
|
52
66
|
|
|
53
|
-
const handler = { callback, priority, namespace };
|
|
67
|
+
const handler: Handler = { callback, priority, namespace };
|
|
54
68
|
|
|
55
69
|
if ( hooksStore[ hookName ] ) {
|
|
56
70
|
// Find the correct insert index of the new hook.
|
|
57
71
|
const handlers = hooksStore[ hookName ].handlers;
|
|
58
72
|
|
|
59
|
-
|
|
60
|
-
let i;
|
|
73
|
+
let i: number;
|
|
61
74
|
for ( i = handlers.length; i > 0; i-- ) {
|
|
62
75
|
if ( priority >= handlers[ i - 1 ].priority ) {
|
|
63
76
|
break;
|
|
@@ -76,7 +89,7 @@ function createAddHook( hooks, storeKey ) {
|
|
|
76
89
|
// we're adding would come after the current callback, there's no
|
|
77
90
|
// problem; otherwise we need to increase the execution index of
|
|
78
91
|
// any other runs by 1 to account for the added element.
|
|
79
|
-
hooksStore.__current.forEach( ( hookInfo ) => {
|
|
92
|
+
hooksStore.__current.forEach( ( hookInfo: HookInfo ) => {
|
|
80
93
|
if (
|
|
81
94
|
hookInfo.name === hookName &&
|
|
82
95
|
hookInfo.currentIndex >= i
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Hooks, StoreKey } from './types';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Returns a function which, when invoked, will return the name of the
|
|
3
8
|
* currently running hook, or `null` if no hook of the given type is currently
|
|
4
9
|
* running.
|
|
5
10
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
11
|
+
* @param hooks Hooks instance.
|
|
12
|
+
* @param storeKey
|
|
8
13
|
*
|
|
9
|
-
* @return
|
|
14
|
+
* @return Function that returns the current hook name or null.
|
|
10
15
|
*/
|
|
11
|
-
function createCurrentHook(
|
|
16
|
+
function createCurrentHook(
|
|
17
|
+
hooks: Hooks,
|
|
18
|
+
storeKey: StoreKey
|
|
19
|
+
): () => string | null {
|
|
12
20
|
return function currentHook() {
|
|
13
21
|
const hooksStore = hooks[ storeKey ];
|
|
14
22
|
const currentArray = Array.from( hooksStore.__current );
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import validateHookName from './validateHookName
|
|
4
|
+
import validateHookName from './validateHookName';
|
|
5
|
+
import type { Hooks, StoreKey } from './types';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* @callback DidHook
|
|
8
8
|
*
|
|
9
9
|
* Returns the number of times an action has been fired.
|
|
10
10
|
*
|
|
11
|
-
* @param {string} hookName The hook name to check.
|
|
12
|
-
*
|
|
13
|
-
* @return {number | undefined} The number of times the hook has run.
|
|
14
11
|
*/
|
|
12
|
+
export type DidHook = (
|
|
13
|
+
/**
|
|
14
|
+
* The hook name to check.
|
|
15
|
+
*/
|
|
16
|
+
hookName: string
|
|
17
|
+
) => number | undefined;
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Returns a function which, when invoked, will return the number of times a
|
|
18
21
|
* hook has been called.
|
|
19
22
|
*
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
23
|
+
* @param hooks Hooks instance.
|
|
24
|
+
* @param storeKey
|
|
22
25
|
*
|
|
23
|
-
* @return
|
|
26
|
+
* @return Function that returns a hook's call count.
|
|
24
27
|
*/
|
|
25
|
-
function createDidHook( hooks, storeKey ) {
|
|
28
|
+
function createDidHook( hooks: Hooks, storeKey: StoreKey ): DidHook {
|
|
26
29
|
return function didHook( hookName ) {
|
|
27
30
|
const hooksStore = hooks[ storeKey ];
|
|
28
31
|
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Hooks, StoreKey } from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
3
7
|
* Returns whether a hook is currently being executed.
|
|
4
8
|
*
|
|
5
|
-
* @param {string} [hookName] The name of the hook to check for. If
|
|
6
|
-
* omitted, will check for any hook being executed.
|
|
7
|
-
*
|
|
8
|
-
* @return {boolean} Whether the hook is being executed.
|
|
9
9
|
*/
|
|
10
|
+
export type DoingHook = (
|
|
11
|
+
/**
|
|
12
|
+
* The name of the hook to check for.
|
|
13
|
+
* If omitted, will check for any hook being executed.
|
|
14
|
+
*/ hookName?: string
|
|
15
|
+
) => boolean;
|
|
10
16
|
|
|
11
17
|
/**
|
|
12
18
|
* Returns a function which, when invoked, will return whether a hook is
|
|
13
19
|
* currently being executed.
|
|
14
20
|
*
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
21
|
+
* @param hooks Hooks instance.
|
|
22
|
+
* @param storeKey
|
|
17
23
|
*
|
|
18
|
-
* @return
|
|
24
|
+
* @return Function that returns whether a hook is currently
|
|
19
25
|
* being executed.
|
|
20
26
|
*/
|
|
21
|
-
function createDoingHook( hooks, storeKey ) {
|
|
27
|
+
function createDoingHook( hooks: Hooks, storeKey: StoreKey ): DoingHook {
|
|
22
28
|
return function doingHook( hookName ) {
|
|
23
29
|
const hooksStore = hooks[ storeKey ];
|
|
24
30
|
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Hooks, StoreKey } from './types';
|
|
5
|
+
/**
|
|
3
6
|
*
|
|
4
7
|
* Returns whether any handlers are attached for the given hookName and optional namespace.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} hookName The name of the hook to check for.
|
|
7
|
-
* @param {string} [namespace] Optional. The unique namespace identifying the callback
|
|
8
|
-
* in the form `vendor/plugin/function`.
|
|
9
|
-
*
|
|
10
|
-
* @return {boolean} Whether there are handlers that are attached to the given hook.
|
|
11
8
|
*/
|
|
9
|
+
export type HasHook = (
|
|
10
|
+
/**
|
|
11
|
+
* The name of the hook to check for.
|
|
12
|
+
*/
|
|
13
|
+
hookname: string,
|
|
14
|
+
/**
|
|
15
|
+
* The unique namespace identifying the callback in the form `vendor/plugin/function`.
|
|
16
|
+
*/
|
|
17
|
+
namespace?: string
|
|
18
|
+
) => boolean;
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* Returns a function which, when invoked, will return whether any handlers are
|
|
14
22
|
* attached to a particular hook.
|
|
15
23
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
24
|
+
* @param hooks Hooks instance.
|
|
25
|
+
* @param storeKey
|
|
18
26
|
*
|
|
19
|
-
* @return
|
|
27
|
+
* @return Function that returns whether any handlers are
|
|
20
28
|
* attached to a particular hook and optional namespace.
|
|
21
29
|
*/
|
|
22
|
-
function createHasHook( hooks, storeKey ) {
|
|
30
|
+
function createHasHook( hooks: Hooks, storeKey: StoreKey ): HasHook {
|
|
23
31
|
return function hasHook( hookName, namespace ) {
|
|
24
32
|
const hooksStore = hooks[ storeKey ];
|
|
25
33
|
|
|
@@ -8,6 +8,7 @@ import createRunHook from './createRunHook';
|
|
|
8
8
|
import createCurrentHook from './createCurrentHook';
|
|
9
9
|
import createDoingHook from './createDoingHook';
|
|
10
10
|
import createDidHook from './createDidHook';
|
|
11
|
+
import type { Store } from './types';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal class for constructing hooks. Use `createHooks()` function
|
|
@@ -17,12 +18,32 @@ import createDidHook from './createDidHook';
|
|
|
17
18
|
* @private
|
|
18
19
|
*/
|
|
19
20
|
export class _Hooks {
|
|
21
|
+
public actions: Store;
|
|
22
|
+
public filters: Store;
|
|
23
|
+
|
|
24
|
+
public addAction: ReturnType< typeof createAddHook >;
|
|
25
|
+
public addFilter: ReturnType< typeof createAddHook >;
|
|
26
|
+
public removeAction: ReturnType< typeof createRemoveHook >;
|
|
27
|
+
public removeFilter: ReturnType< typeof createRemoveHook >;
|
|
28
|
+
public hasAction: ReturnType< typeof createHasHook >;
|
|
29
|
+
public hasFilter: ReturnType< typeof createHasHook >;
|
|
30
|
+
public removeAllActions: ReturnType< typeof createRemoveHook >;
|
|
31
|
+
public removeAllFilters: ReturnType< typeof createRemoveHook >;
|
|
32
|
+
public doAction: ReturnType< typeof createRunHook >;
|
|
33
|
+
public doActionAsync: ReturnType< typeof createRunHook >;
|
|
34
|
+
public applyFilters: ReturnType< typeof createRunHook >;
|
|
35
|
+
public applyFiltersAsync: ReturnType< typeof createRunHook >;
|
|
36
|
+
public currentAction: ReturnType< typeof createCurrentHook >;
|
|
37
|
+
public currentFilter: ReturnType< typeof createCurrentHook >;
|
|
38
|
+
public doingAction: ReturnType< typeof createDoingHook >;
|
|
39
|
+
public doingFilter: ReturnType< typeof createDoingHook >;
|
|
40
|
+
public didAction: ReturnType< typeof createDidHook >;
|
|
41
|
+
public didFilter: ReturnType< typeof createDidHook >;
|
|
42
|
+
|
|
20
43
|
constructor() {
|
|
21
|
-
/** @type {import('.').Store} actions */
|
|
22
44
|
this.actions = Object.create( null );
|
|
23
45
|
this.actions.__current = new Set();
|
|
24
46
|
|
|
25
|
-
/** @type {import('.').Store} filters */
|
|
26
47
|
this.filters = Object.create( null );
|
|
27
48
|
this.filters.__current = new Set();
|
|
28
49
|
|
|
@@ -47,14 +68,14 @@ export class _Hooks {
|
|
|
47
68
|
}
|
|
48
69
|
}
|
|
49
70
|
|
|
50
|
-
|
|
71
|
+
export type Hooks = _Hooks;
|
|
51
72
|
|
|
52
73
|
/**
|
|
53
74
|
* Returns an instance of the hooks object.
|
|
54
75
|
*
|
|
55
|
-
* @return
|
|
76
|
+
* @return A Hooks instance.
|
|
56
77
|
*/
|
|
57
|
-
function createHooks() {
|
|
78
|
+
function createHooks(): Hooks {
|
|
58
79
|
return new _Hooks();
|
|
59
80
|
}
|
|
60
81
|
|
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import validateNamespace from './validateNamespace
|
|
5
|
-
import validateHookName from './validateHookName
|
|
4
|
+
import validateNamespace from './validateNamespace';
|
|
5
|
+
import validateHookName from './validateHookName';
|
|
6
|
+
import type { Hooks, StoreKey } from './types';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* @callback RemoveHook
|
|
9
9
|
* Removes the specified callback (or all callbacks) from the hook with a given hookName
|
|
10
10
|
* and namespace.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} hookName The name of the hook to modify.
|
|
13
|
-
* @param {string} namespace The unique namespace identifying the callback in the
|
|
14
|
-
* form `vendor/plugin/function`.
|
|
15
|
-
*
|
|
16
|
-
* @return {number | undefined} The number of callbacks removed.
|
|
17
11
|
*/
|
|
12
|
+
export type RemoveHook = (
|
|
13
|
+
/**
|
|
14
|
+
* The name of the hook to modify.
|
|
15
|
+
*/
|
|
16
|
+
hookName: string,
|
|
17
|
+
/**
|
|
18
|
+
* The unique namespace identifying the callback in the form `vendor/plugin/function`.
|
|
19
|
+
*/
|
|
20
|
+
namespace: string
|
|
21
|
+
) => number | undefined;
|
|
18
22
|
|
|
19
23
|
/**
|
|
20
24
|
* Returns a function which, when invoked, will remove a specified hook or all
|
|
21
25
|
* hooks by the given name.
|
|
22
26
|
*
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
*
|
|
27
|
-
*
|
|
27
|
+
* @param hooks Hooks instance.
|
|
28
|
+
* @param storeKey
|
|
29
|
+
* @param [removeAll=false] Whether to remove all callbacks for a hookName,
|
|
30
|
+
* without regard to namespace. Used to create
|
|
31
|
+
* `removeAll*` functions.
|
|
28
32
|
*
|
|
29
|
-
* @return
|
|
33
|
+
* @return Function that removes hooks.
|
|
30
34
|
*/
|
|
31
|
-
function createRemoveHook(
|
|
35
|
+
function createRemoveHook(
|
|
36
|
+
hooks: Hooks,
|
|
37
|
+
storeKey: StoreKey,
|
|
38
|
+
removeAll: boolean = false
|
|
39
|
+
): RemoveHook {
|
|
32
40
|
return function removeHook( hookName, namespace ) {
|
|
33
41
|
const hooksStore = hooks[ storeKey ];
|
|
34
42
|
|
|
@@ -1,16 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Hooks, StoreKey } from './types';
|
|
5
|
+
|
|
6
|
+
export type RunHook = (
|
|
7
|
+
hookName: string,
|
|
8
|
+
...args: unknown[]
|
|
9
|
+
) => undefined | unknown;
|
|
10
|
+
|
|
1
11
|
/**
|
|
2
12
|
* Returns a function which, when invoked, will execute all callbacks
|
|
3
13
|
* registered to a hook of the specified type, optionally returning the final
|
|
4
14
|
* value of the call chain.
|
|
5
15
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
16
|
+
* @param hooks Hooks instance.
|
|
17
|
+
* @param storeKey
|
|
18
|
+
* @param returnFirstArg Whether each hook callback is expected to return its first argument.
|
|
19
|
+
* @param async Whether the hook callback should be run asynchronously
|
|
10
20
|
*
|
|
11
|
-
* @return
|
|
21
|
+
* @return Function that runs hook callbacks.
|
|
12
22
|
*/
|
|
13
|
-
function createRunHook(
|
|
23
|
+
function createRunHook(
|
|
24
|
+
hooks: Hooks,
|
|
25
|
+
storeKey: StoreKey,
|
|
26
|
+
returnFirstArg: boolean,
|
|
27
|
+
async: boolean
|
|
28
|
+
): RunHook {
|
|
14
29
|
return function runHook( hookName, ...args ) {
|
|
15
30
|
const hooksStore = hooks[ storeKey ];
|
|
16
31
|
|
|
@@ -3,38 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import createHooks from './createHooks';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef Handler
|
|
10
|
-
* @property {Callback} callback The callback
|
|
11
|
-
* @property {string} namespace The namespace
|
|
12
|
-
* @property {number} priority The namespace
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @typedef Hook
|
|
17
|
-
* @property {Handler[]} handlers Array of handlers
|
|
18
|
-
* @property {number} runs Run counter
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @typedef Current
|
|
23
|
-
* @property {string} name Hook name
|
|
24
|
-
* @property {number} currentIndex The index
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @typedef {Record<string, Hook> & {__current: Set<Current>}} Store
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @typedef {'actions' | 'filters'} StoreKey
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @typedef {import('./createHooks').Hooks} Hooks
|
|
37
|
-
*/
|
|
6
|
+
export * from './types';
|
|
38
7
|
|
|
39
8
|
export const defaultHooks = createHooks();
|
|
40
9
|
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
export type { Hooks } from './createHooks';
|
|
5
|
+
|
|
6
|
+
export type Callback = ( ...args: any[] ) => any;
|
|
7
|
+
|
|
8
|
+
export type Handler = {
|
|
9
|
+
callback: Callback;
|
|
10
|
+
namespace: string;
|
|
11
|
+
priority: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type Hook = {
|
|
15
|
+
handlers: Handler[];
|
|
16
|
+
runs: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type Current = {
|
|
20
|
+
name: string;
|
|
21
|
+
currentIndex: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type HookInfo = {
|
|
25
|
+
name: string;
|
|
26
|
+
currentIndex: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type Store = Record< string, Hook > & { __current: Set< Current > };
|
|
30
|
+
|
|
31
|
+
export type StoreKey = 'actions' | 'filters';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Validate a hookName string.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* @param hookName The hook name to validate. Should be a non empty string containing
|
|
5
|
+
* only numbers, letters, dashes, periods and underscores. Also,
|
|
6
|
+
* the hook name cannot begin with `__`.
|
|
7
7
|
*
|
|
8
|
-
* @return
|
|
8
|
+
* @return Whether the hook name is valid.
|
|
9
9
|
*/
|
|
10
|
-
function validateHookName( hookName ) {
|
|
10
|
+
function validateHookName( hookName: string ): boolean {
|
|
11
11
|
if ( 'string' !== typeof hookName || '' === hookName ) {
|
|
12
12
|
// eslint-disable-next-line no-console
|
|
13
13
|
console.error( 'The hook name must be a non-empty string.' );
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Validate a namespace string.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
5
|
-
*
|
|
4
|
+
* @param namespace The namespace to validate - should take the form
|
|
5
|
+
* `vendor/plugin/function`.
|
|
6
6
|
*
|
|
7
|
-
* @return
|
|
7
|
+
* @return Whether the namespace is valid.
|
|
8
8
|
*/
|
|
9
|
-
function validateNamespace( namespace ) {
|
|
9
|
+
function validateNamespace( namespace: string ): boolean {
|
|
10
10
|
if ( 'string' !== typeof namespace || '' === namespace ) {
|
|
11
11
|
// eslint-disable-next-line no-console
|
|
12
12
|
console.error( 'The namespace must be a non-empty string.' );
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/validateNamespace.js","./src/validateHookName.js","./src/createRemoveHook.js","./src/createHasHook.js","./src/createRunHook.js","./src/createCurrentHook.js","./src/createDoingHook.js","./src/createDidHook.js","./src/createHooks.js","./src/index.js","./src/createAddHook.js","../../typings/gutenberg-env/index.d.ts"],"fileIdsList":[[79,80,88],[88],[80,88],[81,82,83,84,85,86,88,89],[87]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"16fb2ca91cf5fe9e857e5214a31311487524ae87e69b23c7371040bb1a82eaa2","signature":"b5497c7dc69c7b5229d0b905c891103ab9b51bfa4d4687992898c4ed5425216f"},{"version":"acf2c9ac7d645ac867c9c6cf8238b1bf9d592c21e9aff3253aecbc546b605858","signature":"9b1069a77f42334ed54cd4e68591b85bf26e5f47052bb3049b52ebd9b7543520"},{"version":"6ade2d4a5b7fbd0d08bed49004ff33b2a39d8e90886a639f6014de17ecc15510","signature":"c7048acaf5edb534ee4a29e8469c7cdd87cfc40b5518a7983b7d83c2fcc5baa2"},{"version":"5c268d6816af1e751d387a9e573e9376cce62aeef7c7f772aa0572f9aab31726","signature":"0b48405ec967a9982c1001d4222b1c64091aba1441fc4318b08bc1cd4036794a"},{"version":"b5635ed8c0615131b296047b407baea64cd1673fb593c3d7e4a890dbe602a00f","signature":"f256b4c6469e0698e65216d1ed3378d5e433c1abe261b7b227d88cf4509524e4"},{"version":"4b4540f5d80dcd96c24a1f7ec24681dfa5d9761cb8a4abba54c6b2a9fa254b99","signature":"cba32c3504f555c7210c70e4f45ee7f364eb7e12fc1ed9015806a5b36ed44f0c"},{"version":"13cb1c07b4e5200c362fb7265b6bacc63984c536b688a2e5b32754fe5ad13671","signature":"12324a25a603147ab9cf9724d762a767dd8b22c3b4f3ea44357bb937565509c3"},{"version":"062731f93b86ef4bdf0f4f26b28248169cc6beb751c6c20626655f9342e31b6a","signature":"7966497f2357f63036d7c12917ee20d91b7a74c4d9d682e75c44f7b7f6ea4e5b"},{"version":"cee85c588cb78e9c801ae75ee12a68c5c5b53e7d689e750f6e7bccdd9878aa4a","signature":"4fa795e77b24d2a64eab73b8bc2c8c5992b629570e0c2bfc9bb475c312d79c65"},{"version":"aeb715f7ecb4a05818f7c05773dfff8ca0020ba069c23fa9cedbee7c29c18462","signature":"5061f5719dccae0d9ed5b195d2dc4ec5c08d1a34c84d57c7b3b9be8a820b58bd"},{"version":"60282105d2e5ca8103d56b34a8a4dd200f2565529638bf299ad4c31d6c696307","signature":"20f2b0befb27c07049565340fac3ab264c94afebacb3234dfb945e1c4a8ab5fb"},{"version":"cd62baba8e325afe998a6537894fcc0420146c242e1b6fdfdaaadfd21dc0d969","affectsGlobalScope":true}],"root":[[79,89]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"referencedMap":[[89,1],[84,2],[86,3],[85,2],[82,2],[87,4],[81,1],[83,2],[88,5]],"latestChangedDtsFile":"./build-types/createAddHook.d.ts","version":"5.7.2"}
|
|
1
|
+
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/validateNamespace.ts","./src/validateHookName.ts","./src/types.ts","./src/createRemoveHook.ts","./src/createHasHook.ts","./src/createRunHook.ts","./src/createCurrentHook.ts","./src/createDoingHook.ts","./src/createDidHook.ts","./src/createHooks.ts","./src/index.ts","./src/createAddHook.ts","../../typings/gutenberg-env/index.d.ts"],"fileIdsList":[[79,80,81,89],[81],[80,81],[81,82,83,84,85,86,87,90],[79,80,81],[81,88],[88]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"e1253eb55be84d14d5c10e30ea1b6f9e79dae3733ab95882c47bbab64712d832","signature":"03d9f0495757568dcb73858981c0d4b815d356cf342d51762bdf24f2c7279470"},{"version":"14b50a1d43fd552fdb65283f2ff5c7a1d02e2a14b2c48fc7a497266a3d352238","signature":"0590ee3956b81ebbc5f647e0ec08c1fd7c0638de9554f99148849d9090f9e122"},{"version":"71cfd69a08b659a602c7c16a9b1d040f1bc8fee5fc52e7703628a85a66f1235a","signature":"09fe1d225f4a83f48ea5f67f1be80f6e674280a4f8c38d0ebd649862237066bb"},{"version":"3b15f0e98330f504643609a2c379f30e26eff18b2f8b5a49512916818a88b190","signature":"4ad429086c5d55543eb1146b31a2de27e54ad772d1626d19b80502b3fff43b84"},{"version":"a4bc284bdd244499d25986ada3a18b9912cc29af4ef88318c324418541194270","signature":"6b089383aa85af6dd1619a6fb9468a1eec60c2ce83be3f4fc691a323275860c4"},{"version":"3cb580928782fb3aa6a39e26042989ffb0b58197f956ca0f95b417c4a2be98d6","signature":"cdbced29135877ea367650ee1c49c482a46cbbd0befdbfb730e8780d5982aa41"},{"version":"f08118811a2b1628612862594f2ef5b76bcd320e1f24846460bc62402ff5aab6","signature":"5461443f907ddbae5a8b8cd9a32ac614e396bf505acd4b09245d4ec0b1dbebd2"},{"version":"26266b011b9cc85293cb8db95852f6d93ace8a64dfaa7f27babfd88f123421c0","signature":"26a0c627921511b17209aa6e90510e25a424b8cb1b08ac74d29d98bfb35e1959"},{"version":"fcefb1354ad2ec0b0d05bc6a20f2d0320fdfd7adf2d5c0f88ec12e3ec016b239","signature":"6508e23a7d089883b385ab273c9ae40301e953e987c4363bdbc6f788b88ff9ce"},{"version":"da7d41aea1c5cdec901fe491e6f400fdf2aeecbfc20af7f68ee05e5b1795f2bf","signature":"ee1a1f6f69c6e3f7cdb0fd5a920d72cd9c2e69229919ad0d7b590dda51348bca"},{"version":"69f6893be14219f336fcc9992059c0829f4abd6f8ee0ccf8a261a7d3190c1d59","signature":"d150550f9f93d9b865bdba497dfee108bfc0af237d186fb173af51a0646e3643"},{"version":"70f2d77e850c90254053fa6c80fe55d9ad70c0b8d44bc96376599e4dc42d3000","signature":"e89c5f3e57750498ecc0904025a5faaa2067a54ce82dac6ba2b8cf0cfd41ccc2"},{"version":"cd62baba8e325afe998a6537894fcc0420146c242e1b6fdfdaaadfd21dc0d969","affectsGlobalScope":true}],"root":[[79,90]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"referencedMap":[[90,1],[85,2],[87,3],[86,2],[83,2],[88,4],[82,5],[84,2],[89,6],[81,7]],"latestChangedDtsFile":"./build-types/createAddHook.d.ts","version":"5.7.2"}
|