Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ComponentDatabaseMap<DBSchema, StoreName>

A class to tell a DynamicComponent how its DynamicComponentControlledProps maps to the Database.

Unlike most generic types in this library, you will need to explicitly set the type parameters on construction, as there's no way to infer a NamedSchema from any of the arguments to its constructor, but they constrain the possible values of its properties.

Type parameters

Hierarchy

  • ComponentDatabaseMap

Index

Constructors

Properties

Constructors

constructor

Properties

key

key: StoreKey<DBSchema["schema"], StoreName> | (() => StoreKey<DBSchema["schema"], StoreName>)

property

property: null | undefined

storeName

storeName: StoreName

Static propType

propType: Requireable<ComponentDatabaseMap<NamedSchema<string, number, any>, string>> = PropTypes.exact({storeName: PropTypes.string.isRequired,key: PropTypes.oneOfType([PropTypes.string.isRequired,PropTypes.number.isRequired,PropTypes.func.isRequired,]).isRequired,// We need to cast this because `PropTypes.arrayOf` doesn't know how to// limit the number of elements in the array, and so creates the// incompatible type of `(string | symbol)[]`. This does mean the// prop validatiion will let through some invalid `property`s.property: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string.isRequired,PropTypes.symbol.isRequired,]).isRequired) as PropTypes.Requireable<[string] | [string, string | symbol]>,})

The proptype validator for a ComponentDatabaseMap.

Generated using TypeDoc