Skip to content

Commit

Permalink
docs: add stubs for python bindings generated from pybind11-stubgen
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Mar 6, 2024
1 parent 7902769 commit b19f531
Showing 1 changed file with 288 additions and 0 deletions.
288 changes: 288 additions & 0 deletions python/src/endstone/_internal/endstone_python.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
from __future__ import annotations
import typing
__all__ = ['ColorFormat', 'Logger', 'Plugin', 'PluginDescription', 'PluginLoader', 'PluginManager', 'Server']
class ColorFormat:
AQUA: typing.ClassVar[str] = '§b'
BLACK: typing.ClassVar[str] = '§0'
BLUE: typing.ClassVar[str] = '§9'
BOLD: typing.ClassVar[str] = '§l'
DARK_AQUA: typing.ClassVar[str] = '§3'
DARK_BLUE: typing.ClassVar[str] = '§1'
DARK_GRAY: typing.ClassVar[str] = '§8'
DARK_GREEN: typing.ClassVar[str] = '§2'
DARK_PURPLE: typing.ClassVar[str] = '§5'
DARK_RED: typing.ClassVar[str] = '§4'
GOLD: typing.ClassVar[str] = '§6'
GRAY: typing.ClassVar[str] = '§7'
GREEN: typing.ClassVar[str] = '§a'
ITALIC: typing.ClassVar[str] = '§o'
LIGHT_PURPLE: typing.ClassVar[str] = '§d'
MATERIAL_AMETHYST: typing.ClassVar[str] = '§u'
MATERIAL_COPPER: typing.ClassVar[str] = '§n'
MATERIAL_DIAMOND: typing.ClassVar[str] = '§s'
MATERIAL_EMERALD: typing.ClassVar[str] = '§q'
MATERIAL_GOLD: typing.ClassVar[str] = '§p'
MATERIAL_IRON: typing.ClassVar[str] = '§i'
MATERIAL_LAPIS: typing.ClassVar[str] = '§t'
MATERIAL_NETHERITE: typing.ClassVar[str] = '§j'
MATERIAL_QUARTZ: typing.ClassVar[str] = '§h'
MATERIAL_REDSTONE: typing.ClassVar[str] = '§m'
MINECOIN_GOLD: typing.ClassVar[str] = '§g'
OBFUSCATED: typing.ClassVar[str] = '§k'
RED: typing.ClassVar[str] = '§c'
RESET: typing.ClassVar[str] = '§r'
WHITE: typing.ClassVar[str] = '§f'
YELLOW: typing.ClassVar[str] = '§e'
class Logger:
class Level:
"""
Members:
TRACE
DEBUG
INFO
WARNING
ERROR
CRITICAL
"""
CRITICAL: typing.ClassVar[Logger.Level] # value = <Level.CRITICAL: 5>
DEBUG: typing.ClassVar[Logger.Level] # value = <Level.DEBUG: 1>
ERROR: typing.ClassVar[Logger.Level] # value = <Level.ERROR: 4>
INFO: typing.ClassVar[Logger.Level] # value = <Level.INFO: 2>
TRACE: typing.ClassVar[Logger.Level] # value = <Level.TRACE: 0>
WARNING: typing.ClassVar[Logger.Level] # value = <Level.WARNING: 3>
__members__: typing.ClassVar[dict[str, Logger.Level]] # value = {'TRACE': <Level.TRACE: 0>, 'DEBUG': <Level.DEBUG: 1>, 'INFO': <Level.INFO: 2>, 'WARNING': <Level.WARNING: 3>, 'ERROR': <Level.ERROR: 4>, 'CRITICAL': <Level.CRITICAL: 5>}
def __eq__(self, other: typing.Any) -> bool:
...
def __getstate__(self) -> int:
...
def __hash__(self) -> int:
...
def __index__(self) -> int:
...
def __init__(self, value: int) -> None:
...
def __int__(self) -> int:
...
def __ne__(self, other: typing.Any) -> bool:
...
def __repr__(self) -> str:
...
def __setstate__(self, state: int) -> None:
...
def __str__(self) -> str:
...
@property
def name(self) -> str:
...
@property
def value(self) -> int:
...
CRITICAL: typing.ClassVar[Logger.Level] # value = <Level.CRITICAL: 5>
DEBUG: typing.ClassVar[Logger.Level] # value = <Level.DEBUG: 1>
ERROR: typing.ClassVar[Logger.Level] # value = <Level.ERROR: 4>
INFO: typing.ClassVar[Logger.Level] # value = <Level.INFO: 2>
TRACE: typing.ClassVar[Logger.Level] # value = <Level.TRACE: 0>
WARNING: typing.ClassVar[Logger.Level] # value = <Level.WARNING: 3>
def critical(self, msg: str) -> None:
"""
Log a message at the CRITICAL level.
"""
def debug(self, msg: str) -> None:
"""
Log a message at the DEBUG level.
"""
def error(self, msg: str) -> None:
"""
Log a message at the ERROR level.
"""
def info(self, msg: str) -> None:
"""
Log a message at the INFO level.
"""
def is_enabled_for(self, level: Logger.Level) -> bool:
"""
Check if the Logger instance is enabled for the given log Level.
"""
def set_level(self, level: Logger.Level) -> None:
"""
Set the logging level for this Logger instance.
"""
def trace(self, msg: str) -> None:
"""
Log a message at the TRACE level.
"""
def warning(self, msg: str) -> None:
"""
Log a message at the WARNING level.
"""
@property
def name(self) -> str:
"""
Get the name of this Logger instance.
"""
class Plugin:
def __init__(self) -> None:
...
def _get_description(self) -> PluginDescription:
...
def on_disable(self) -> None:
"""
Called when this plugin is disabled
"""
def on_enable(self) -> None:
"""
Called when this plugin is enabled
"""
def on_load(self) -> None:
"""
Called after a plugin is loaded but before it has been enabled.
"""
@property
def enabled(self) -> bool:
"""
Returns a value indicating whether or not this plugin is currently enabled
"""
@property
def logger(self) -> Logger:
"""
Returns the plugin logger associated with this server's logger.
"""
@property
def name(self) -> str:
"""
Returns the name of the plugin.
"""
@property
def plugin_loader(self) -> PluginLoader:
"""
Gets the associated PluginLoader responsible for this plugin
"""
@property
def server(self) -> Server:
"""
Returns the Server instance currently running this plugin
"""
class PluginDescription:
def __init__(self, name: str, version: str, description: str | None = None, authors: list[str] | None = None, prefix: str | None = None, *args, **kwargs) -> None:
...
@property
def authors(self) -> list[str]:
"""
Gives the list of authors for the plugin.
"""
@property
def description(self) -> str:
"""
Gives a human-friendly description of the functionality the plugin provides.
"""
@property
def full_name(self) -> str:
"""
Returns the name of a plugin, including the version.
"""
@property
def name(self) -> str:
"""
Gives the name of the plugin. This name is a unique identifier for plugins.
"""
@property
def prefix(self) -> str:
"""
Gives the token to prefix plugin-specific logging messages with.
"""
@property
def version(self) -> str:
"""
Gives the version of the plugin.
"""
class PluginLoader:
def __init__(self, server: Server) -> None:
...
def disable_plugin(self, plugin: Plugin) -> None:
"""
Disables the specified plugin
"""
def enable_plugin(self, plugin: Plugin) -> None:
"""
Enables the specified plugin
"""
def load_plugins(self, directory: str) -> list[Plugin]:
"""
Loads the plugin contained within the specified directory
"""
class PluginManager:
def clear_plugins(self) -> None:
"""
Disables and removes all plugins
"""
def disable_plugin(self, plugin: Plugin) -> None:
"""
Disables the specified plugin
"""
def disable_plugins(self) -> None:
"""
Disables all the loaded plugins
"""
def enable_plugin(self, plugin: Plugin) -> None:
"""
Enables the specified plugin
"""
def enable_plugins(self) -> None:
"""
Enable all the loaded plugins
"""
def get_plugin(self, name: str) -> Plugin:
"""
Checks if the given plugin is loaded and returns it when applicable.
"""
@typing.overload
def is_plugin_enabled(self, plugin: str) -> bool:
"""
Checks if the given plugin is enabled or not
"""
@typing.overload
def is_plugin_enabled(self, plugin: Plugin) -> bool:
"""
Checks if the given plugin is enabled or not
"""
def load_plugins(self, directory: str) -> list[Plugin]:
"""
Loads the plugin contained within the specified directory
"""
@property
def plugins(self) -> list[Plugin]:
"""
Gets a list of all currently loaded plugins
"""
class Server:
@property
def logger(self) -> Logger:
"""
Returns the primary logger associated with this server instance.
"""
@property
def minecraft_version(self) -> str:
"""
Gets the Minecraft version that this server is running.
"""
@property
def name(self) -> str:
"""
Gets the name of this server implementation.
"""
@property
def plugin_manager(self) -> PluginManager:
"""
Gets the plugin manager for interfacing with plugins.
"""
@property
def version(self) -> str:
"""
Gets the name of this server implementation.
"""

0 comments on commit b19f531

Please sign in to comment.