# Class SerializableBase<TProperties>`Abstract`

Default implementation of a Serializable that supports observability and serialization.

#### Type Parameters

- TProperties

#### Hierarchy (view full)

- Evented
  - SerializableBase
    - LanguageResources
    - LayerPresetSetting
    - DateFormatter
    - NumberFormatter
    - TimeFormatter

#### Implements

- Serializable<TProperties>

#####
Index

### Constructors

constructor

### Methods

_getSerializableProperties
_toPropertyDef
assignProperties
assignPropertiesAsync
finishAssignProperties
getDefault
getDefaults
getSerializableProperties
toJSON

##
Constructors

### constructor

- new SerializableBase<TProperties>(_properties?): SerializableBase<TProperties>

- #### Type Parameters

  - TProperties

  #### Parameters

  - `Optional`_properties: TProperties

  #### Returns SerializableBase<TProperties>

  Overrides Evented.constructor

##
Methods

### `Protected`_getSerializableProperties

- _getSerializableProperties(): PropertyDefs<TProperties>

- The property keys and their metadata that are used to implement serializing and deserializing the class instance.

  #### Returns PropertyDefs<TProperties>

### `Protected`_toPropertyDef

- _toPropertyDef<T>(def): PropertyDef<T>

- Converts the value to a PropertyDef object.

  #### Type Parameters

  - T

  #### Parameters

  - def: PropertyDefSerializeMode | PropertyDefSerializeMode[] | PropertyDef<T>

    The value to convert.

  #### Returns PropertyDef<T>

### 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

  Implementation of Serializable.assignProperties

### 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>

  Implementation of Serializable.assignPropertiesAsync

### 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>

  Implementation of Serializable.finishAssignProperties

### 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]

  Implementation of Serializable.getDefault

### getDefaults

- getDefaults(): TProperties

- Gets the object's default property values.

  #### Returns TProperties

  Implementation of Serializable.getDefaults

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<TProperties>

- Returns the serializable properties.

  #### Parameters

  - serializeMode: SerializeMode = "all"

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

  #### Returns PropertyDefs<TProperties>

  Implementation of Serializable.getSerializableProperties

### toJSON

- toJSON(serializeMode?): TProperties

- Returns a serializable representation of the item.

  #### Parameters

  - serializeMode: SerializeMode = "all"

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

  #### Returns TProperties

  Implementation of Serializable.toJSON