-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
from collections.abc import Iterable | ||
from typing import Any, Literal, overload | ||
|
||
from typing_extensions import Self, TypeAlias, deprecated | ||
|
||
JSON: TypeAlias = Any | ||
|
||
class _EmptyValue: ... | ||
|
||
_NO_VALUE: _EmptyValue | ||
|
||
class _JqStatePool: | ||
def __init__(self, program_bytes: bytes, args: Any) -> None: ... | ||
|
||
class _Program: | ||
def __init__(self, program_bytes: bytes, args: Any) -> None: ... | ||
@overload | ||
def input(self, value: JSON, text: _EmptyValue = _NO_VALUE) -> _ProgramWithInput: ... | ||
@overload | ||
def input(self, value: _EmptyValue = _NO_VALUE, *, text: str) -> _ProgramWithInput: ... | ||
def input_value(self, value: JSON) -> _ProgramWithInput: ... | ||
def input_values(self, values: Iterable[JSON]) -> _ProgramWithInput: ... | ||
def input_text(self, text: str, *, slurp: bool = False) -> _ProgramWithInput: ... | ||
@property | ||
def program_string(self) -> str: ... | ||
def __repr__(self) -> str: ... | ||
@overload | ||
@deprecated("'transform' is kept for 0.1.x backwards compatibility") | ||
def transform( | ||
self, | ||
value: JSON | _EmptyValue = _NO_VALUE, | ||
text: JSON | _EmptyValue = _NO_VALUE, | ||
*, | ||
text_output: Literal[True], | ||
multiple_output: Literal[False] = False, | ||
) -> str: ... | ||
@overload | ||
@deprecated("'transform' is kept for 0.1.x backwards compatibility") | ||
def transform( | ||
self, | ||
value: JSON | _EmptyValue = _NO_VALUE, | ||
text: JSON | _EmptyValue = _NO_VALUE, | ||
*, | ||
text_output: Literal[False] = False, | ||
multiple_output: Literal[True], | ||
) -> list[JSON]: ... | ||
@overload | ||
@deprecated("'transform' is kept for 0.1.x backwards compatibility") | ||
def transform( | ||
self, | ||
value: JSON | _EmptyValue = _NO_VALUE, | ||
text: JSON | _EmptyValue = _NO_VALUE, | ||
text_output: Literal[False] = False, | ||
multiple_output: Literal[False] = False, | ||
) -> JSON: ... | ||
|
||
class _ProgramWithInput: | ||
def __init__(self, jq_state_pool: _JqStatePool, bytes_input: bytes, *, slurp: bool) -> None: ... | ||
def __iter__(self) -> _ResultIterator: ... | ||
def text(self) -> str: ... | ||
def all(self) -> list[JSON]: ... | ||
def first(self) -> JSON: ... | ||
|
||
class _ResultIterator: | ||
def __init__(self, jq_state_pool: _JqStatePool, bytes_input: bytes, *, slurp: bool) -> None: ... | ||
def __iter__(self) -> Self: ... | ||
def __next__(self) -> JSON: ... | ||
|
||
def compile(program: str, args: Any | None = None) -> _Program: ... | ||
@overload | ||
def all(program: str, value: JSON, text: _EmptyValue = _NO_VALUE) -> list[JSON]: ... | ||
@overload | ||
def all(program: str, value: _EmptyValue = _NO_VALUE, *, text: str) -> list[JSON]: ... | ||
@overload | ||
def first(program: str, value: JSON, text: _EmptyValue = _NO_VALUE) -> JSON: ... | ||
@overload | ||
def first(program: str, value: _EmptyValue = _NO_VALUE, *, text: str) -> JSON: ... | ||
@overload | ||
def iter(program: str, value: JSON, text: _EmptyValue = _NO_VALUE) -> _ResultIterator: ... | ||
@overload | ||
def iter(program: str, value: _EmptyValue = _NO_VALUE, *, text: str) -> _ResultIterator: ... | ||
@overload | ||
def text(program: str, value: JSON, text: _EmptyValue = _NO_VALUE) -> str: ... | ||
@overload | ||
def text(program: str, value: _EmptyValue = _NO_VALUE, *, text: str) -> str: ... | ||
@deprecated("'jq' is kept for 0.1.x backwards compatibility") | ||
def jq(program: str) -> _Program: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters