# Class Encryptable<T>

Represents an encryptable event with optional updates.

#### Type Parameters

- T extends EventTemplate

- Defined in packages/util/src/Encryptable.ts:17

#####
Index

### Constructors

constructor

### Properties

event
updates

### Methods

reconcile

##
Constructors

### constructor

- new Encryptable< T extends EventTemplate >(
  event: Partial< T >,
  updates: Partial< EventContent >,
  ): Encryptable < T >

- Creates an instance of Encryptable.

  #### Type Parameters

  - T extends EventTemplate

  #### Parameters

  - event: Partial< T >

    An EventTemplate with optional tags and content.

  - updates: Partial< EventContent >

    Plaintext updates to be applied to the event content.

  #### Returns Encryptable < T >

  #### Example

  Here's an example which enables updating a private mute list:

      const event = {kind: 10000, content: "", tags: []} // An event, only kind is required
      const encryptable = new Encryptable(event, {content: JSON.stringify([["e", "bad word"]])})
      const eventTemplate = await encryptable.reconcile(myEncryptFunction)

  - Defined in packages/util/src/Encryptable.ts:30

##
Properties

### `Readonly` event

event: Partial< T >

An EventTemplate with optional tags and content.

- Defined in packages/util/src/Encryptable.ts:30

### `Readonly` updates

updates: Partial< EventContent >

Plaintext updates to be applied to the event content.

- Defined in packages/util/src/Encryptable.ts:30

##
Methods

### reconcile

- reconcile(encrypt: Encrypt ): Promise< T >

- Encrypts plaintext updates and merges them into the event template.

  #### Parameters

  - encrypt: Encrypt

    The encryption function to be used.

  #### Returns Promise< T >

  A promise that resolves to the reconciled and encrypted event.

  - Defined in packages/util/src/Encryptable.ts:37