Merge pull request #669 from andrew8er/feature/add-server-bindasync-definition

Add missing Typescript definition for Server.bindAsync()
This commit is contained in:
Michael Lumish 2018-12-05 14:00:33 -08:00 committed by GitHub
commit db205a82b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -230,9 +230,21 @@ declare module "grpc" {
* "address:port"
* @param creds Server credential object to be used for SSL. Pass an
* insecure credentials object for an insecure port.
* @return The bound port number or 0 if the opreation failed.
* @return The bound port number or 0 if the operation failed.
*/
bind(port: string, creds: ServerCredentials): number;
/**
* Binds the server to the given port, with SSL disabled if creds is an
* insecure credentials object. Provides the result asynchronously.
* @param port The port that the server should bind on, in the format "address:port"
* @param creds Server credential object to be used for
* SSL. Pass an insecure credentials object for an insecure port.
* @param callback Called with the result of attempting to bind a port
* - error: If non-null, indicates that binding the port failed.
* - port: The bound port number. If binding the port fails, this will be negative to match the output of bind.
*/
bindAsync(port: string, creds: ServerCredentials, callback: (error: Error | null, port: number) => void): void;
}
/**