Migrate to private class properties/methods

This commit is contained in:
Jamie Kyle 2025-01-14 11:11:52 -08:00 committed by GitHub
parent 7dbe57084b
commit aa9f53df57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
100 changed files with 3795 additions and 3944 deletions

View file

@ -9,7 +9,7 @@ type StringKey<T> = keyof T & string;
export class MessageModel {
public get id(): string {
return this._attributes.id;
return this.#_attributes.id;
}
public get<keyName extends StringKey<MessageAttributesType>>(
@ -21,7 +21,7 @@ export class MessageModel {
attributes: Partial<MessageAttributesType>,
{ noTrigger }: { noTrigger?: boolean } = {}
): void {
this._attributes = {
this.#_attributes = {
...this.attributes,
...attributes,
};
@ -34,12 +34,12 @@ export class MessageModel {
}
public get attributes(): Readonly<MessageAttributesType> {
return this._attributes;
return this.#_attributes;
}
private _attributes: MessageAttributesType;
#_attributes: MessageAttributesType;
constructor(attributes: MessageAttributesType) {
this._attributes = attributes;
this.#_attributes = attributes;
this.set(
window.Signal.Types.Message.initializeSchemaVersion({