export type Result < T , E > = Success < T , E > | Failure < T , E > ; export class Success < T , E > { constructor ( readonly value ) { } type = "success" as const ; isSuccess ( ) { return true ; } isFailure ( ) { return false ; } } export class Failure < T , E > { constructor ( readonly value ) { } type = "failure" as const ; isSuccess ( ) { return false ; } isFailure ( ) { return true ; } } export class NoSuchRoomError extends Error { }