/** * Dev command - watch mode with automatic sync */ import { type ResolvedConfig, type DevMode } from "../config.js"; import { type BuildCommandResult } from "./build.js"; import { type TinybirdBranch } from "../../api/branches.js"; import { type SchemaValidationResult } from "../utils/schema-validation.js"; import { type LocalWorkspace } from "../../api/local.js"; /** * Login result info */ export interface LoginInfo { /** Workspace name */ workspaceName?: string; /** User email */ userEmail?: string; } /** * Dev command options */ export interface DevCommandOptions { /** Working directory (defaults to cwd) */ cwd?: string; /** Debounce delay in milliseconds (default: 100) */ debounce?: number; /** Callback when build starts */ onBuildStart?: () => void; /** Callback when build completes */ onBuildComplete?: (result: BuildCommandResult) => void; /** Callback when an error occurs */ onError?: (error: Error) => void; /** Callback when branch is created/detected */ onBranchReady?: (info: BranchReadyInfo) => void; /** Callback when login is needed and completed */ onLoginComplete?: (info: LoginInfo) => void; /** Callback when schema validation completes */ onSchemaValidation?: (result: SchemaValidationResult) => void; /** Override the devMode from config */ devModeOverride?: DevMode; /** Copy the last partition of production data when creating a branch */ lastPartition?: boolean; } /** * Information about the branch being used */ export interface BranchReadyInfo { /** Git branch name */ gitBranch: string | null; /** Whether we're on the main branch */ isMainBranch: boolean; /** Tinybird branch info (null if on main or local mode) */ tinybirdBranch?: TinybirdBranch; /** Whether the branch was newly created */ wasCreated?: boolean; /** Whether using local mode */ isLocal?: boolean; /** Local workspace info (only in local mode) */ localWorkspace?: LocalWorkspace; /** Dashboard URL for the branch (only in branch mode) */ dashboardUrl?: string; } /** * Dev command controller */ export interface DevController { /** Stop watching and clean up */ stop: () => Promise; /** Trigger a manual rebuild */ rebuild: () => Promise; /** The configuration being used */ config: ResolvedConfig; /** The effective token (branch token or main token) */ effectiveToken: string; /** Branch info */ branchInfo: BranchReadyInfo; } /** * Run the dev command * * Watches for file changes and automatically rebuilds and pushes to Tinybird. * Automatically manages Tinybird branches based on git branch: * - Main branch: uses workspace token and /v1/deploy * - Feature branches: creates/reuses Tinybird branch and uses /v1/build * * @param options - Dev options * @returns Dev controller */ export declare function runDev(options?: DevCommandOptions): Promise; //# sourceMappingURL=dev.d.ts.map