anki.hooks
==========

.. py:module:: anki.hooks

.. autoapi-nested-parse::

   Tools for extending Anki.

   A hook takes a function that does not return a value.

   A filter takes a function that returns its first argument, optionally
   modifying it.



Functions
---------

.. autoapisummary::

   anki.hooks.runHook
   anki.hooks.runFilter
   anki.hooks.addHook
   anki.hooks.remHook
   anki.hooks.wrap


Module Contents
---------------

.. py:function:: runHook(hook: str, *args: Any) -> None

   Run all functions on hook.


.. py:function:: runFilter(hook: str, arg: Any, *args: Any) -> Any

.. py:function:: addHook(hook: str, func: collections.abc.Callable) -> None

   Add a function to hook. Ignore if already on hook.


.. py:function:: remHook(hook: Any, func: Any) -> None

   Remove a function if is on hook.


.. py:function:: wrap(old: Any, new: Any, pos: str = 'after') -> collections.abc.Callable

   Override an existing function.


