@@ -53,16 +53,16 @@ function StringArrayPromise:cancel() end
5353function StringArrayPromise :and_then (cb ) end
5454
5555
56- --- @class (exact ) ClientPromise : Promise
57- local ClientPromise = {}
56+ --- @class (exact ) SessionPromise : Promise
57+ local SessionPromise = {}
5858--- block until promise is ready and return value
59- --- @return Client
60- function ClientPromise :await () end
59+ --- @return Session
60+ function SessionPromise :await () end
6161--- cancel promise execution
62- function ClientPromise :cancel () end
63- --- @param cb fun ( x : Client ) callback to invoke
62+ function SessionPromise :cancel () end
63+ --- @param cb fun ( x : Session ) callback to invoke
6464--- invoke callback asynchronously as soon as promise is ready
65- function ClientPromise :and_then (cb ) end
65+ function SessionPromise :and_then (cb ) end
6666
6767
6868--- @class (exact ) WorkspacePromise : Promise
@@ -216,107 +216,107 @@ function WorkspaceIdentifierListPromise:and_then(cb) end
216216-- [[ END ASYNC STUFF ]]
217217
218218
219- --- @class (exact ) Client
219+ --- @class (exact ) Session
220220--- the effective local client, handling connecting to codemp server
221- local Client = {}
221+ local Session = {}
222222
223223--- @return UserInfo
224224--- current logged in user for this client
225- function Client :current_user () end
225+ function Session :current_user () end
226226
227227--- @return string[]
228228--- array of all currently active workspace names
229- function Client :active_workspaces () end
229+ function Session :active_workspaces () end
230230
231231--- @return NilPromise
232232--- @async
233233--- @nodiscard
234234--- refresh current user token if possible
235- function Client :refresh () end
235+ function Session :refresh () end
236236
237237--- @param user string workspace owning user
238238--- @param ws string workspace id to connect to
239239--- @return WorkspacePromise
240240--- @async
241241--- @nodiscard
242242--- join requested workspace if possible and subscribe to event bus
243- function Client :attach_workspace (user , ws ) end
243+ function Session :attach_workspace (user , ws ) end
244244
245245--- @param ws string workspace id to create
246246--- @return NilPromise
247247--- @async
248248--- @nodiscard
249249--- create a new workspace with given id
250- function Client :create_workspace (ws ) end
250+ function Session :create_workspace (ws ) end
251251
252252--- @param user string workspace owning user
253253--- @param ws string workspace id to leave
254254--- leave workspace with given id, detaching and disconnecting
255- function Client :leave_workspace (user , ws ) end
255+ function Session :leave_workspace (user , ws ) end
256256
257257--- @param ws string workspace id to delete
258258--- @return NilPromise
259259--- @async
260260--- @nodiscard
261261--- delete workspace with given id
262- function Client :delete_workspace (ws ) end
262+ function Session :delete_workspace (ws ) end
263263
264264--- @param user string user owning the workspace to quit
265265--- @param workspace string workspace to quit
266266--- @return NilPromise
267267--- @async
268268--- @nodiscard
269269--- quit a joined workspace, by user + workspace name
270- function Client :quit_workspace (user , workspace ) end
270+ function Session :quit_workspace (user , workspace ) end
271271
272272--- @param user string user inviting us
273273--- @param workspace string workspace being invited to
274274--- @return NilPromise
275275--- @async
276276--- @nodiscard
277277--- accept an invite to a new workspace
278- function Client :accept_invite (user , workspace ) end
278+ function Session :accept_invite (user , workspace ) end
279279
280280--- @param user string user inviting us
281281--- @param workspace string workspace being invited to
282282--- @return NilPromise
283283--- @async
284284--- @nodiscard
285285--- reject an invite to a new workspace
286- function Client :reject_invite (user , workspace ) end
286+ function Session :reject_invite (user , workspace ) end
287287
288288--- @param ws string workspace id to delete
289289--- @param user string user name to invite to given workspace
290290--- @return NilPromise
291291--- @async
292292--- @nodiscard
293293--- grant user acccess to workspace
294- function Client :invite_to_workspace (ws , user ) end
294+ function Session :invite_to_workspace (ws , user ) end
295295
296296--- @return WorkspaceIdentifierListPromise
297297--- @async
298298--- @nodiscard
299299--- fetch and list owned workspaces
300- function Client :fetch_owned_workspaces () end
300+ function Session :fetch_owned_workspaces () end
301301
302302--- @return WorkspaceIdentifierListPromise
303303--- @async
304304--- @nodiscard
305305--- fetch and list joined workspaces
306- function Client :fetch_joined_workspaces () end
306+ function Session :fetch_joined_workspaces () end
307307
308308--- @param user string user owning this workspace
309309--- @param ws string workspace id to get
310310--- @return Workspace ?
311311--- get an active workspace by name
312- function Client :get_workspace (user , ws ) end
312+ function Session :get_workspace (user , ws ) end
313313
314314--- @param user string username to lookup
315315--- @return UserInfoPromise
316316--- @async
317317--- @nodiscard
318318--- get full user info for given username from server
319- function Client :get_user_info (user ) end
319+ function Session :get_user_info (user ) end
320320
321321--- @class (exact ) SessionEvent
322322--- @field kind integer (SessionEventKind ) event kind
@@ -327,26 +327,26 @@ function Client:get_user_info(user) end
327327--- @async
328328--- @nodiscard
329329--- try to receive session events, returning nil if none is available
330- function Client :try_recv () end
330+ function Session :try_recv () end
331331
332332--- @return SessionEventPromise
333333--- @async
334334--- @nodiscard
335335--- block until next client event and return it
336- function Client :recv () end
336+ function Session :recv () end
337337
338338--- @return NilPromise
339339--- @async
340340--- @nodiscard
341341--- block until next session event without returning it
342- function Client :poll () end
342+ function Session :poll () end
343343
344344--- clears any previously registered session callback
345- function Client :clear_callback () end
345+ function Session :clear_callback () end
346346
347- --- @param cb fun ( w : Client ) callback to invoke on each workspace event received
347+ --- @param cb fun ( w : Session ) callback to invoke on each workspace event received
348348--- register a new callback to be called on session events (replaces any previously registered one)
349- function Client :callback (cb ) end
349+ function Session :callback (cb ) end
350350
351351
352352
@@ -657,7 +657,7 @@ function CursorController:callback(cb) end
657657local Codemp = {}
658658
659659--- @param config Config configuration for
660- --- @return ClientPromise
660+ --- @return SessionPromise
661661--- @async
662662--- @nodiscard
663663--- connect to codemp server, authenticate and return client
0 commit comments