diff --git a/pyrage-stubs/pyrage-stubs/__init__.pyi b/pyrage-stubs/pyrage-stubs/__init__.pyi deleted file mode 100644 index feac123..0000000 --- a/pyrage-stubs/pyrage-stubs/__init__.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from io import BufferedIOBase -from typing import Sequence, Union - -from pyrage import ssh, x25519, passphrase, plugin - -Identity = Union[ssh.Identity, x25519.Identity, plugin.IdentityPluginV1] -Recipient = Union[ssh.Recipient, x25519.Recipient, plugin.RecipientPluginV1] - - -class RecipientError(Exception): - ... - -class IdentityError(Exception): - ... - - -def encrypt(plaintext: bytes, recipients: Sequence[Recipient]) -> bytes: ... -def encrypt_file(infile: str, outfile: str, recipients: Sequence[Recipient]) -> None: ... -def encrypt_io(in_io: BufferedIOBase, recipients: Sequence[Recipient]) -> bytes: ... -def decrypt(ciphertext: bytes, identities: Sequence[Identity]) -> bytes: ... -def decrypt_file(infile: str, outfile: str, identities: Sequence[Identity]) -> None: ... -def decrypt_io(in_io: BufferedIOBase, out_io: BufferedIOBase, recipient: Sequence[Identity]) -> None: ... diff --git a/pyrage-stubs/pyrage/__init__.pyi b/pyrage-stubs/pyrage/__init__.pyi new file mode 100644 index 0000000..80faa60 --- /dev/null +++ b/pyrage-stubs/pyrage/__init__.pyi @@ -0,0 +1,42 @@ +from io import BufferedIOBase +from typing import Sequence, Union + +from pyrage import passphrase, plugin, ssh, x25519 +from pyrage.plugin import IdentityPluginV1, RecipientPluginV1 +from pyrage.ssh import Identity as SSHIdentity +from pyrage.ssh import Recipient as SSHRecipient +from pyrage.x25519 import Identity as X25519Identity +from pyrage.x25519 import Recipient as X25519Recipient + +_Identity = Union[SSHIdentity, X25519Identity, IdentityPluginV1] +_Recipient = Union[SSHRecipient, X25519Recipient, RecipientPluginV1] + +__all__ = ( + "ssh", + "x25519", + "passphrase", + "plugin", + "encrypt", + "encrypt_file", + "encrypt_io", + "decrypt", + "decrypt_file", + "decrypt_io", + "RecipientError", + "IdentityError", +) + + +class RecipientError(Exception): + ... + +class IdentityError(Exception): + ... + + +def encrypt(plaintext: bytes, recipients: Sequence[_Recipient]) -> bytes: ... +def encrypt_file(infile: str, outfile: str, recipients: Sequence[_Recipient]) -> None: ... +def encrypt_io(in_io: BufferedIOBase, out_io: BufferedIOBase, recipients: Sequence[_Recipient]) -> bytes: ... +def decrypt(ciphertext: bytes, identities: Sequence[_Identity]) -> bytes: ... +def decrypt_file(infile: str, outfile: str, identities: Sequence[_Identity]) -> None: ... +def decrypt_io(in_io: BufferedIOBase, out_io: BufferedIOBase, recipient: Sequence[_Identity]) -> None: ... diff --git a/pyrage-stubs/pyrage-stubs/passphrase.py b/pyrage-stubs/pyrage/passphrase.pyi similarity index 100% rename from pyrage-stubs/pyrage-stubs/passphrase.py rename to pyrage-stubs/pyrage/passphrase.pyi diff --git a/pyrage-stubs/pyrage-stubs/plugin.pyi b/pyrage-stubs/pyrage/plugin.pyi similarity index 100% rename from pyrage-stubs/pyrage-stubs/plugin.pyi rename to pyrage-stubs/pyrage/plugin.pyi diff --git a/pyrage-stubs/pyrage/py.typed b/pyrage-stubs/pyrage/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyrage-stubs/pyrage-stubs/ssh.py b/pyrage-stubs/pyrage/ssh.pyi similarity index 100% rename from pyrage-stubs/pyrage-stubs/ssh.py rename to pyrage-stubs/pyrage/ssh.pyi diff --git a/pyrage-stubs/pyrage-stubs/x25519.py b/pyrage-stubs/pyrage/x25519.pyi similarity index 100% rename from pyrage-stubs/pyrage-stubs/x25519.py rename to pyrage-stubs/pyrage/x25519.pyi