{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Server as HttpServer } from 'http';\nimport { Server, Socket, AttachOptions, ServerOptions } from 'engine.io-latest';\n\n/**\n * Creates a new Engine.IO server instance attached to an existing HTTP server.\n *\n * @param httpServer - An existing HTTP server to attach the Engine.IO server to.\n * @param options - Optional configuration options for the Engine.IO server.\n * @returns A new `Server` instance attached to the specified HTTP server.\n */\nfunction engine(httpServer: HttpServer, options?: ServerOptions & AttachOptions): Server;\n\n/**\n * Creates a new standalone Engine.IO server instance with specified options.\n *\n * @param options - Configuration options for the Engine.IO server.\n * @returns A new `Server` instance.\n */\nfunction engine(options?: ServerOptions & AttachOptions): Server;\n\n/**\n * Implementation of the `engine` function, creating a `Server` instance based on provided arguments.\n *\n * @param arg1 - Either an HTTP server or options for the Engine.IO server.\n * @param arg2 - Optional configuration options if `arg1` is an HTTP server.\n * @returns A new `Server` instance.\n */\nfunction engine(arg1?: unknown, arg2?: ServerOptions & AttachOptions): Server {\n\tif (arg1 instanceof HttpServer) {\n\t\tconst server = new Server(arg2);\n\t\tserver.attach(arg1, arg2);\n\t\treturn server;\n\t} else {\n\t\treturn new Server(arg1 as ServerOptions & AttachOptions);\n\t}\n}\n\nexport default engine;\n\n/**\n * `QSocketTransportEIOLatestServer` is a class from `engine.io-latest`, used to create a new Engine.IO server instance.\n * It manages incoming connections, allowing real-time, low-latency communication.\n *\n * @type {Server}\n */\nexport const QSocketTransportEIOLatestServer: typeof Server = Server;\n\n/**\n * `QSocketTransportEIOLatestSocket` represents an individual socket connection in the Engine.IO server.\n * This class manages the interaction with a specific client, enabling data transfer.\n *\n * @type {Socket}\n */\nexport const QSocketTransportEIOLatestSocket: typeof Socket = Socket;\n\n/**\n * `IQSocketTransportEIOLatestServer` is a type alias for the `Server` class from `engine.io-latest`.\n * This type represents the Engine.IO server instance used to manage connections.\n */\nexport type IQSocketTransportEIOLatestServer = Server;\n\n/**\n * `IQSocketTransportEIOLatestSocket` is a type alias for the `Socket` class from `engine.io-latest`.\n * This type represents an individual client connection on the server.\n */\nexport type IQSocketTransportEIOLatestSocket = Socket;\n\n/**\n * `IQSocketTransportEIOLatestAttachOptions` is a type alias for the `AttachOptions` from `engine.io-latest`.\n * This type is used to specify options when attaching the Engine.IO server to an HTTP server.\n */\nexport type IQSocketTransportEIOLatestAttachOptions = AttachOptions;\n\n/**\n * `IQSocketTransportEIOLatestServerOptions` is a type alias for the `ServerOptions` from `engine.io-latest`.\n * This type represents configuration options for initializing the Engine.IO server instance.\n */\nexport type IQSocketTransportEIOLatestServerOptions = ServerOptions;\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,oCAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAAqC,gBACrCC,EAA6D,4BA0B7D,SAASC,EAAOC,EAAgBC,EAA8C,CAC7E,GAAID,aAAgB,EAAAE,OAAY,CAC/B,IAAMC,EAAS,IAAI,SAAOF,CAAI,EAC9B,OAAAE,EAAO,OAAOH,EAAMC,CAAI,EACjBE,CACR,KACC,QAAO,IAAI,SAAOH,CAAqC,CAEzD,CAEA,IAAOI,EAAQL,EAQFM,EAAiD,SAQjDC,EAAiD","names":["src_exports","__export","QSocketTransportEIOLatestServer","QSocketTransportEIOLatestSocket","src_default","__toCommonJS","import_http","import_engine","engine","arg1","arg2","HttpServer","server","src_default","QSocketTransportEIOLatestServer","QSocketTransportEIOLatestSocket"]}