clan ui: setup typed api method

This commit is contained in:
Johannes Kirschbauer
2024-05-20 19:34:27 +02:00
parent 6ebfd29c87
commit 8687801cee
16 changed files with 375 additions and 96 deletions

18
pkgs/clan-cli/api.py Normal file
View File

@@ -0,0 +1,18 @@
from clan_cli import create_parser
from clan_cli.api import API
from clan_cli.api.schema_compat import to_json_schema
def main() -> None:
# Create the parser to register the API functions
create_parser()
schema = to_json_schema(API._registry)
print(
f"""export const schema = {schema} as const;
"""
)
if __name__ == "__main__":
main()