UNPKG

@jsheaven/astro-client-generator

Version:

Generates TypeScript API client code for your Astro endpoints. No manual `fetch()` code writing anymore.

22 lines (21 loc) 612 B
#!/usr/bin/env node import yargs from 'yargs-parser'; export type Arguments = yargs.Arguments; export declare enum Commands { HELP = "help", VERSION = "version", GENERATE = "generate" } export type Command = 'help' | 'version' | 'generate'; export interface CLIState { cmd: Command; options: { apiDir?: string; baseUrl?: string; outDir?: string; }; } /** Determine which action the user requested */ export declare const resolveArgs: (flags: yargs.Arguments) => CLIState; /** The primary CLI action */ export declare const cli: (args: string[]) => Promise<never>;