# Interface PropertyDef<T>

Metadata that describes how (and whether) a given property should be serialized and deserialized.

interface PropertyDef<T> {
default?: T;
deserialize?: false | ((config: T) => void | Promise<void>);
isDefault?: ((value: T, serializeMode: SerializeMode) => boolean);
serialize?: false | ((mode?: SerializeMode) => T);
serializeModes?: PropertyDefSerializeMode[];
}

#### Type Parameters

- T

#####
Index

### Properties

default?
deserialize?
isDefault?
serialize?
serializeModes?

##
Properties

### `Optional` default

default?: T

The default value of the property. This is used to prevent unnecessary config from making its way into an exported json file.

### `Optional` deserialize

deserialize?: false | ((config: T) => void | Promise<void>)

A function that deserializes configuration into the property. Setting this to `false` will disable deserialization for this property.

### `Optional` isDefault

isDefault?: ((value: T, serializeMode: SerializeMode) => boolean)

A function that takes in a serialized value of the property and returns a boolean depicting whether or not the value is equivalent to the property's default value. This is used to prevent unnecessary config from making its way into an exported json file.

### `Optional` serialize

serialize?: false | ((mode?: SerializeMode) => T)

A function that serializes the property into configuration. Setting this to `false` will disable serialization for this property.

### `Optional` serializeModes

serializeModes?: PropertyDefSerializeMode[]

The flag values that will cause the property to serialize.