server.select() returns either a single server or a list of servers, not void

This commit is contained in:
Krueger, Brandon 2015-10-20 20:18:27 -05:00
parent 68548c2daa
commit 2e1db438fb

14
hapi/hapi.d.ts vendored
View File

@ -2104,12 +2104,14 @@ declare module "hapi" {
Returns a server object with connections set to the requested subset. Selecting again on a selection operates as a logic AND statement between the individual selections.
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80, labels: ['a', 'b'] });
server.connection({ port: 8080, labels: ['a', 'c'] });
server.connection({ port: 8081, labels: ['b', 'c'] });
var a = server.select('a'); // 80, 8080
var ac = a.select('c'); // 8080*/
select(labels: string|string[]): void;
server.connection({ port: 80, labels: ['a'] });
server.connection({ port: 8080, labels: ['b'] });
server.connection({ port: 8081, labels: ['c'] });
server.connection({ port: 8082, labels: ['c','d'] });
var a = server.select('a'); // The server with port 80
var ab = server.select(['a','b']); // A list of servers containing the server with port 80 and the server with port 8080
var c = server.select('c'); // A list of servers containing the server with port 8081 and the server with port 8082 */
select(labels: string|string[]): Server|Server[];
/** server.start([callback])
Starts the server connections by listening for incoming requests on the configured port of each listener (unless the connection was configured with autoListen set to false), where:
callback - optional callback when server startup is completed or failed with the signature function(err) where: