/** * Sweetlink Auto-Start * * Zero-config Sweetlink server that works with any Node.js app. * Just import this module in development to start the server automatically. * * Usage: * ```typescript * // At the top of your server entry file * import '@ytspar/sweetlink/auto'; * ``` * * Or with explicit configuration: * ```typescript * import { startSweetlink } from '@ytspar/sweetlink/auto'; * startSweetlink({ appPort: 3000 }); * ``` * * Port Calculation: * - Reads app port from process.env.PORT (default: 3000) * - WebSocket port = app port + 6223 (matches devbar's calculation) * - Example: app on 3000 → Sweetlink on 9223 */ export interface AutoStartOptions { /** * Your app's HTTP port. If not specified, reads from process.env.PORT * or defaults to 3000. */ appPort?: number; /** * WebSocket server port. If not specified, calculated as appPort + 6223. */ wsPort?: number; /** * Only start in development mode. Default: true */ devOnly?: boolean; } /** * Start Sweetlink server with automatic port configuration. * * @example * // Auto-detect port from process.env.PORT * startSweetlink(); * * @example * // Explicit app port * startSweetlink({ appPort: 3000 }); */ export declare function startSweetlink(options?: AutoStartOptions): void; /** * Stop the Sweetlink server */ export declare function stopSweetlink(): Promise; //# sourceMappingURL=auto.d.ts.map