1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-29 00:34:26 +03:00

Refactor slightly

This commit is contained in:
Tae Won Ha 2017-12-15 14:09:39 +01:00
parent 907a106eb5
commit d0c3d3e201
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -81,7 +81,11 @@ public class NvimApi {
public typealias Response<R> = Result<R, NvimApi.Error>
public var notificationCallback: ((MsgPackRpc.MessageType, String, [NvimApi.Value]) -> Void)? {
public typealias NotificationCallback = Connection.NotificationCallback
public typealias UnknownCallback = Connection.UnknownMessageCallback
public typealias ErrorCallback = Connection.ErrorCallback
public var notificationCallback: NotificationCallback? {
get {
return self.session.notificationCallback
}
@ -91,7 +95,7 @@ public class NvimApi {
}
}
public var unknownMessageCallback: (([NvimApi.Value]) -> Void)? {
public var unknownMessageCallback: UnknownCallback? {
get {
return self.session.unknownMessageCallback
}
@ -101,7 +105,7 @@ public class NvimApi {
}
}
public var errorCallback: ((NvimApi.Value) -> Void)? {
public var errorCallback: ErrorCallback? {
get {
return self.session.errorCallback
}
@ -111,9 +115,9 @@ public class NvimApi {
}
}
public class Session {
class Session {
var notificationCallback: ((MsgPackRpc.MessageType, String, [NvimApi.Value]) -> Void)? {
var notificationCallback: NotificationCallback? {
get {
return self.connection.notificationCallback
}
@ -123,7 +127,7 @@ public class NvimApi {
}
}
var unknownMessageCallback: (([NvimApi.Value]) -> Void)? {
var unknownMessageCallback: UnknownCallback? {
get {
return self.connection.unknownMessageCallback
}
@ -133,7 +137,7 @@ public class NvimApi {
}
}
var errorCallback: ((NvimApi.Value) -> Void)? {
var errorCallback: ErrorCallback? {
get {
return self.connection.errorCallback
}