Skip to main content
Version: 3.0.0-beta

Function: buildProperty()

buildProperty<T, P, M>(property): P extends StringProperty ? StringProperty : P extends NumberProperty ? NumberProperty : P extends BooleanProperty ? BooleanProperty : P extends DateProperty ? DateProperty : P extends GeopointProperty ? GeopointProperty : P extends ReferenceProperty ? ReferenceProperty : P extends ArrayProperty ? ArrayProperty : P extends MapProperty ? MapProperty : P extends PropertyBuilder<T, M> ? PropertyBuilder<T, M> : never

Identity function we use to defeat the type system of Typescript and preserve the property keys.

Type Parameters​

• T extends CMSType = CMSType

• P extends StringProperty | NumberProperty | BooleanProperty | DateProperty | GeopointProperty | ReferenceProperty | MapProperty<Record<string, any>> | ArrayProperty<CMSType[], any> | ArrayProperty<CMSType[] & Record<string, any>, any> | PropertyBuilder<T, Record<string, any>> = PropertyOrBuilder<T>

• M extends Record<string, any> = Record<string, any>

Parameters​

• property: P

Returns​

P extends StringProperty ? StringProperty : P extends NumberProperty ? NumberProperty : P extends BooleanProperty ? BooleanProperty : P extends DateProperty ? DateProperty : P extends GeopointProperty ? GeopointProperty : P extends ReferenceProperty ? ReferenceProperty : P extends ArrayProperty ? ArrayProperty : P extends MapProperty ? MapProperty : P extends PropertyBuilder<T, M> ? PropertyBuilder<T, M> : never

Defined in​

packages/firecms_core/src/util/builders.ts:42

Sign up to our newsletter to get the latest news and updates. No spam!