Skip to content

Commit

Permalink
Update types with payload and times as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelclapham committed Aug 27, 2024
1 parent 9f42370 commit 40050fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export namespace ServerTypes {
export interface Client {
id: string;
name: string;
lastJoinTime: string;
}
export interface Session {
id: string;
Expand All @@ -16,7 +17,6 @@ export namespace ServerTypes {
}
export interface CreateSessionMsg {
type: "CreateSession";
addClientId: string;
}
export interface UpdateClientMsg {
type: "UpdateClient";
Expand All @@ -32,24 +32,24 @@ export namespace ServerTypes {
clientId: string;
sessionId: string;
sessionOwnerId: string;
clientMap: { [key: string]: Client };
clientMap: {[key: string]: Client};
}
export interface ClientLeftSessionMsg {
type: "ClientLeftSession";
clientId: string;
sessionId: string;
sessionOwnerId: string;
clientMap: { [key: string]: Client };
clientMap: {[key: string]: Client};
}
export interface BroadcastToSessionMsg {
type: "BroadcastToSession";
payload: any;
payload: string;
}
export interface BroadcastFromSessionMsg {
type: "BroadcastFromSession";
fromSessionOwner: boolean;
senderId: string;
payload: any;
payload: string;
}
export interface ErrorMsg {
type: "Error";
Expand Down
3 changes: 3 additions & 0 deletions msg_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func convertToTS() {
Add(InfoMsg{})

converter.CreateInterface = true
converter.ManageType(time.Time{}, typescriptify.TypeOptions{
TSType: "string",
})
converter.BackupDir = ""
tsString, err := converter.Convert(make(map[string]string))
if err != nil {
Expand Down

0 comments on commit 40050fa

Please sign in to comment.