/** * Sweetlink Next.js Plugin * * Zero-config integration for Next.js projects. * Wraps your Next.js config to automatically start the Sweetlink WebSocket server in dev mode. * * Usage: * ```javascript * // next.config.mjs * import { withSweetlink } from '@ytspar/sweetlink/next'; * * const nextConfig = { ... }; * export default withSweetlink(nextConfig); * ``` * * Port detection (in order of precedence): * 1. process.argv: `--port 3002` or `-p 3002` * 2. process.env.PORT * 3. Default: 3000 */ export interface WithSweetlinkOptions { /** * Override the app port detection. If not specified, auto-detected from * process.argv (--port / -p) or process.env.PORT, defaulting to 3000. */ port?: number; } /** * Wrap a Next.js config to auto-start Sweetlink in development. * * Mirrors the Vite plugin (`@ytspar/sweetlink/vite`) pattern: * - Detects the app port from CLI args * - Starts the WebSocket server on `appPort + 6223` * - Registers graceful shutdown handlers * - No-ops in production */ export declare function withSweetlink(nextConfig: T, options?: WithSweetlinkOptions): T; export default withSweetlink; //# sourceMappingURL=next.d.ts.map