@wordpress/hooks
Version:
WordPress hooks library.
30 lines • 864 B
TypeScript
/**
* Internal dependencies
*/
import type { Hooks, StoreKey } from './types';
/**
*
* Returns whether any handlers are attached for the given hookName and optional namespace.
*/
export type HasHook = (
/**
* The name of the hook to check for.
*/
hookname: string,
/**
* The unique namespace identifying the callback in the form `vendor/plugin/function`.
*/
namespace?: string) => boolean;
/**
* Returns a function which, when invoked, will return whether any handlers are
* attached to a particular hook.
*
* @param hooks Hooks instance.
* @param storeKey
*
* @return Function that returns whether any handlers are
* attached to a particular hook and optional namespace.
*/
declare function createHasHook(hooks: Hooks, storeKey: StoreKey): HasHook;
export default createHasHook;
//# sourceMappingURL=createHasHook.d.ts.map