Skip to content

Commit

Permalink
server: extra flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
crucialfelix committed Apr 24, 2017
1 parent 2ca2f38 commit 60ca4c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export default class Server extends EventEmitter {
var stdoutBuffer = '';
// watch for ready message
this._serverObservers.stdout
.takeWhile(text => {
.takeWhile((text: string): boolean => {
stdoutBuffer += text;
return !stdoutBuffer.match(/SuperCollider 3 server ready/);
})
Expand Down Expand Up @@ -514,7 +514,7 @@ export default class Server extends EventEmitter {
*
* @returns {Promise} - resolves when udp responds
*/
connect() {
connect(): Promise<Server> {
return new Promise((resolve, reject) => {
const udpListening = 'udp is listening';

Expand Down Expand Up @@ -547,7 +547,7 @@ export default class Server extends EventEmitter {
// which will cause a udp listening event.
// After server responds then we are truly connected.
this.callAndResponse(notify()).then(() => {
resolve();
resolve(this);
});
});
}
Expand Down Expand Up @@ -595,7 +595,7 @@ export default class Server extends EventEmitter {
* @returns {Promise}
*/
oscOnce(matchArgs: Array<string | number>, timeout: number = 4000): Promise {
return new Promise((resolve, reject) => {
return new Promise((resolve: Function, reject: Function) => {
var subscription = this.receive.subscribe(msg => {
var command = msg.slice(0, matchArgs.length);
if (_.isEqual(command, matchArgs)) {
Expand Down

0 comments on commit 60ca4c0

Please sign in to comment.