提交 7f19bc2f 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

readonly id in constructor

上级 3bb39af0
...@@ -257,19 +257,15 @@ export class Contact extends Accessory implements Sayable { ...@@ -257,19 +257,15 @@ export class Contact extends Accessory implements Sayable {
*/ */
protected payload?: ContactPayload protected payload?: ContactPayload
public readonly id: string // Contact Id
/** /**
* @private * @private
*/ */
constructor ( constructor (
id: string, public readonly id: string,
) { ) {
super() super()
log.silly('Contact', `constructor(${id})`) log.silly('Contact', `constructor(${id})`)
this.id = id
// tslint:disable-next-line:variable-name // tslint:disable-next-line:variable-name
const MyClass = instanceToClass(this, Contact) const MyClass = instanceToClass(this, Contact)
......
...@@ -114,42 +114,6 @@ export class Friendship extends Accessory implements Acceptable { ...@@ -114,42 +114,6 @@ export class Friendship extends Accessory implements Acceptable {
throw new Error('to be implemented') throw new Error('to be implemented')
} }
// public static createConfirm(
// contactId: string,
// ): FriendRequestPayload {
// log.verbose('Friendship', 'createConfirm(%s)',
// contactId,
// )
// const payload: FriendRequestPayloadConfirm = {
// type : FriendRequestType.Confirm,
// contactId,
// }
// return payload
// }
// public static createReceive(
// contactId : string,
// hello : string,
// ticket : string,
// ): FriendRequestPayload {
// log.verbose('Friendship', 'createReceive(%s, %s, %s)',
// contactId,
// hello,
// ticket,
// )
// const payload: FriendRequestPayloadReceive = {
// type : FriendRequestType.Receive,
// contactId,
// hello,
// ticket,
// }
// return payload
// }
/** /**
* *
* Instance Properties * Instance Properties
...@@ -162,7 +126,7 @@ export class Friendship extends Accessory implements Acceptable { ...@@ -162,7 +126,7 @@ export class Friendship extends Accessory implements Acceptable {
protected payload?: FriendshipPayload protected payload?: FriendshipPayload
constructor ( constructor (
public id: string, public readonly id: string,
) { ) {
super() super()
log.verbose('Friendship', 'constructor(id=%s)', id) log.verbose('Friendship', 'constructor(id=%s)', id)
......
...@@ -55,7 +55,7 @@ export class RoomInvitation extends Accessory implements Acceptable { ...@@ -55,7 +55,7 @@ export class RoomInvitation extends Accessory implements Acceptable {
* *
*/ */
constructor ( constructor (
public id: string, public readonly id: string,
) { ) {
super() super()
log.verbose('RoomInvitation', 'constructor(id=%s)', id) log.verbose('RoomInvitation', 'constructor(id=%s)', id)
......
...@@ -269,19 +269,15 @@ export class Room extends Accessory implements Sayable { ...@@ -269,19 +269,15 @@ export class Room extends Accessory implements Sayable {
*/ */
protected payload?: RoomPayload protected payload?: RoomPayload
public readonly id: string // Room Id
/** /**
* @private * @private
*/ */
constructor ( constructor (
id: string, public readonly id: string,
) { ) {
super() super()
log.silly('Room', `constructor(${id})`) log.silly('Room', `constructor(${id})`)
this.id = id
// tslint:disable-next-line:variable-name // tslint:disable-next-line:variable-name
const MyClass = instanceToClass(this, Room) const MyClass = instanceToClass(this, Room)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册