Expose InterceptorType via qutebrowser.api.interceptor
This commit is contained in:
parent
02596fd325
commit
f49384f0bf
@ -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
|
||||
|
@ -47,6 +47,7 @@ class Request:
|
||||
self.is_blocked = True
|
||||
|
||||
|
||||
#: Type annotation for an interceptor function.
|
||||
InterceptorType = typing.Callable[[Request], None]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user