bun-plugin-screeps
Version:
Bun build plugin + CLI to upload JS/WASM bundles to the Screeps API
48 lines (47 loc) • 1.57 kB
TypeScript
import { z } from "zod";
export declare const ScreepsConfigSchema: z.ZodObject<{
token: z.ZodOptional<z.ZodString>;
email: z.ZodOptional<z.ZodString>;
password: z.ZodOptional<z.ZodString>;
protocol: z.ZodDefault<z.ZodEnum<["http", "https"]>>;
hostname: z.ZodDefault<z.ZodString>;
port: z.ZodDefault<z.ZodNumber>;
path: z.ZodDefault<z.ZodString>;
branch: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodString]>>;
}, "strip", z.ZodTypeAny, {
protocol: "http" | "https";
hostname: string;
port: number;
path: string;
branch: string;
token?: string | undefined;
email?: string | undefined;
password?: string | undefined;
}, {
token?: string | undefined;
email?: string | undefined;
password?: string | undefined;
protocol?: "http" | "https" | undefined;
hostname?: string | undefined;
port?: number | undefined;
path?: string | undefined;
branch?: string | undefined;
}>;
export type ScreepsConfig = z.infer<typeof ScreepsConfigSchema>;
export declare function readConfig(file?: string): Promise<{
protocol: "http" | "https";
hostname: string;
port: number;
path: string;
branch: string;
token?: string | undefined;
email?: string | undefined;
password?: string | undefined;
}>;
export interface CodeList {
[key: string]: string | {
binary: string;
};
}
export declare function collectCode(mainOutputFile: string): Promise<CodeList>;
export declare function uploadCode(cfg: ScreepsConfig, code: CodeList): Promise<void>;