diff options
| author | Árni Dagur <arni@dagur.eu> | 2020-06-21 16:41:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-21 16:41:21 -0400 |
| commit | 4bb4cb4e6c49226740e80a8dd1639274e0719b53 (patch) | |
| tree | 62c3fe064a8bc39bc694bf22b80c7c1e3b755865 /adblock/adblock.pyi | |
| parent | 26b2ffa2e7d1970c30af5d9e97530575916fe769 (diff) | |
Add type stubs to project (#7)
Diffstat (limited to 'adblock/adblock.pyi')
| -rw-r--r-- | adblock/adblock.pyi | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/adblock/adblock.pyi b/adblock/adblock.pyi new file mode 100644 index 0000000..50a61e8 --- /dev/null +++ b/adblock/adblock.pyi | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | from typing import Optional, Dict, List, Set | ||
| 2 | |||
| 3 | class BlockerResult: | ||
| 4 | matched: bool | ||
| 5 | explicit_cancel: bool | ||
| 6 | important: bool | ||
| 7 | redirect: Optional[str] | ||
| 8 | exception: Optional[str] | ||
| 9 | filter: Optional[str] | ||
| 10 | error: Optional[str] | ||
| 11 | def __repr__(self) -> str: | ||
| 12 | pass | ||
| 13 | |||
| 14 | class HostnameSpecificResources: | ||
| 15 | hide_selectors: Set[str] | ||
| 16 | style_selectors: Dict[str, List[str]] | ||
| 17 | exceptions: Set[str] | ||
| 18 | injected_script: str | ||
| 19 | def __repr__(self) -> str: | ||
| 20 | pass | ||
| 21 | |||
| 22 | class Engine: | ||
| 23 | def __init__( | ||
| 24 | self, | ||
| 25 | network_filters: Optional[List[str]] = None, | ||
| 26 | load_network: bool = True, | ||
| 27 | load_cosmetic: bool = False, | ||
| 28 | debug: bool = False, | ||
| 29 | ) -> None: | ||
| 30 | pass | ||
| 31 | def check_network_urls( | ||
| 32 | self, url: str, source_url: str, request_type: str | ||
| 33 | ) -> BlockerResult: | ||
| 34 | pass | ||
| 35 | def check_network_urls_with_hostnames( | ||
| 36 | self, | ||
| 37 | url: str, | ||
| 38 | hostname: str, | ||
| 39 | source_hostname: str, | ||
| 40 | request_type: str, | ||
| 41 | third_party_request: Optional[bool], | ||
| 42 | ) -> BlockerResult: | ||
| 43 | pass | ||
| 44 | def check_network_urls_with_hostnames_subset( | ||
| 45 | self, | ||
| 46 | url: str, | ||
| 47 | hostname: str, | ||
| 48 | source_hostname: str, | ||
| 49 | request_type: str, | ||
| 50 | third_party_request: Optional[bool], | ||
| 51 | previously_matched_rule: bool, | ||
| 52 | force_check_exceptions: bool, | ||
| 53 | ) -> BlockerResult: | ||
| 54 | pass | ||
| 55 | def serialize(self) -> bytes: | ||
| 56 | pass | ||
| 57 | def serialize_to_file(self, file: str) -> None: | ||
| 58 | pass | ||
| 59 | def deserialize(self, serialized: bytes) -> None: | ||
| 60 | pass | ||
| 61 | def deserialize_from_file(self, file: str) -> None: | ||
| 62 | pass | ||
| 63 | def add_filter_list(self, filter_list: str) -> None: | ||
| 64 | pass | ||
| 65 | def filter_exists(self, filter: str) -> bool: | ||
| 66 | pass | ||
| 67 | def tags_enable(self, tags: List[str]) -> None: | ||
| 68 | pass | ||
| 69 | def tags_disable(self, tags: List[str]) -> None: | ||
| 70 | pass | ||
| 71 | def tag_exists(self, tag: str) -> bool: | ||
| 72 | pass | ||
| 73 | def hostname_cosmetic_resources(self, hostname: str) -> HostnameSpecificResources: | ||
| 74 | pass | ||
| 75 | def hidden_class_id_selectors( | ||
| 76 | self, classes: List[str], ids: List[str], exceptions: Set[str] | ||
| 77 | ) -> List[str]: | ||
| 78 | pass | ||
