# Interface Serializable<TProperties>

An object that can be serialized to/from plain JSON.

interface Serializable<TProperties> {
assignProperties(properties: Partial<TProperties>): void;
assignPropertiesAsync(properties: Partial<TProperties>): Promise<void>;
finishAssignProperties(): Promise<void>;
getDefault<K>(key: K): TProperties[K];
getDefaults(): Partial<TProperties>;
getSerializableProperties(serializeMode?: SerializeMode): PropertyDefs<TProperties>;
toJSON(serializeMode?: SerializeMode): Partial<TProperties>;
}

#### Type Parameters

- TProperties

#### Hierarchy (view full)

- Serializable
  - Relationship

#### Implemented by

- FeatureList
- FeatureSet
- SerializableBase

#####
Index

### Methods

assignProperties
assignPropertiesAsync
finishAssignProperties
getDefault
getDefaults
getSerializableProperties
toJSON

##
Methods

### assignProperties

- assignProperties(properties): void

- Sets the properties for this item.

  #### Parameters

  - properties: Partial<TProperties>

    A plain object containing property values to set, keyed by property name.

  #### Returns void

### assignPropertiesAsync

- assignPropertiesAsync(properties): Promise<void>

- Sets the properties for this item.

  This version will also await any asynchronous logic that is needed to set the properties.

  #### Parameters

  - properties: Partial<TProperties>

    A plain object containing property values to set, keyed by property name.

  #### Returns Promise<void>

### finishAssignProperties

- finishAssignProperties(): Promise<void>

- Waits for all deserialization logic initiated thus far to finish, whether invoked by passing properties into the constructor, or by invoking `assignProperties()` or `assignPropertiesAsync()`.

  #### Returns Promise<void>

### getDefault

- getDefault<K>(key): TProperties[K]

- Gets the default value of an object's property.

  #### Type Parameters

  - K extends string | number | symbol

  #### Parameters

  - key: K

    The property of the object for which to get the default value.

  #### Returns TProperties[K]

### getDefaults

- getDefaults(): Partial<TProperties>

- Gets the object's default property values.

  #### Returns Partial<TProperties>

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<TProperties>

- Returns the serializable properties.

  #### Parameters

  - `Optional` serializeMode: SerializeMode

    Optional. If specified, only properties that support the given serialization mode will be returned.

  #### Returns PropertyDefs<TProperties>

### toJSON

- toJSON(serializeMode?): Partial<TProperties>

- Returns a serializable representation of the item.

  #### Parameters

  - `Optional` serializeMode: SerializeMode

    If specified, only properties that are appropriate for the given mode are returned. Otherwise, all properties will be serialized.

  #### Returns Partial<TProperties>