@wordpress/hooks
Version:
WordPress hooks library.
20 lines • 825 B
TypeScript
/**
* Internal dependencies
*/
import type { Hooks, StoreKey } from './types';
export type RunHook = (hookName: string, ...args: unknown[]) => undefined | unknown;
/**
* Returns a function which, when invoked, will execute all callbacks
* registered to a hook of the specified type, optionally returning the final
* value of the call chain.
*
* @param hooks Hooks instance.
* @param storeKey
* @param returnFirstArg Whether each hook callback is expected to return its first argument.
* @param async Whether the hook callback should be run asynchronously
*
* @return Function that runs hook callbacks.
*/
declare function createRunHook(hooks: Hooks, storeKey: StoreKey, returnFirstArg: boolean, async: boolean): RunHook;
export default createRunHook;
//# sourceMappingURL=createRunHook.d.ts.map