Expose InterceptorType via qutebrowser.api.interceptor

This commit is contained in:
Florian Bruhin 2018-12-13 19:44:48 +01:00
parent 02596fd325
commit f49384f0bf
2 changed files with 6 additions and 1 deletions

View File

@ -24,7 +24,11 @@ from qutebrowser.extensions import interceptors
from qutebrowser.extensions.interceptors import Request
def register(interceptor: interceptors.InterceptorType) -> None:
#: Type annotation for an interceptor function.
InterceptorType = interceptors.InterceptorType
def register(interceptor: InterceptorType) -> None:
"""Register a request interceptor.
Whenever a request happens, the interceptor gets called with a

View File

@ -47,6 +47,7 @@ class Request:
self.is_blocked = True
#: Type annotation for an interceptor function.
InterceptorType = typing.Callable[[Request], None]