Interface IPropsRegistryBuilder
interface IPropsRegistryBuilder
Extends com.amazon.apmf.IStandard
Builder for adding different types of props
for a keplerscript view manager.
Methods
stringProp()
Add a prop of string type. Since no default value is provided, it is compulsory to provide an explicit value from JavaScript layer.IPropsRegistryBuilder*stringProp(stringname)
Parameters
name
string — Required
Name of the prop.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
stringPropWithDefault()
Add a prop of string type.IPropsRegistryBuilder*stringPropWithDefault(stringname,stringdefaultValue)
Parameters
name
string — Required
Name of the prop.
defaultValue
string — Required
Default value of the prop,
to be picked up when there is no explicit value set
from the React Native JavaScript layer of the component.
The default value is automatically converted from UTF-8
to the appropriate JavaScript String.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
boolProp()
Add a prop of boolean type. Since no default value is provided, it is compulsory to provide an explicit value from JavaScript layer.IPropsRegistryBuilder*boolProp(stringname)
Parameters
name
string — Required
Name of the prop.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
boolPropWithDefault()
Add a prop of boolean type.IPropsRegistryBuilder*boolPropWithDefault(stringname,booldefaultValue)
Parameters
name
string — Required
Name of the prop.
defaultValue
bool — Required
Default value of the prop,
to be picked up when there is no explicit value set
from the React Native JavaScript layer of the component.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
doubleProp()
Add a prop of IEEE 754 double type, except that all IEEE 754 NaN values are mapped to the single JavaScript NaN value. +/- infinities are mapped to +/- infinities in JavaScript. Since no default value is provided, it is compulsory to provide an explicit value from JavaScript layer.IPropsRegistryBuilder*doubleProp(stringname)
Parameters
name
string — Required
Name of the prop.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
doublePropWithDefault()
Add a prop of IEEE 754 double type, except that all IEEE 754 NaN values are mapped to the single JavaScript NaN value. +/- infinities are mapped to +/- infinities in JavaScript.IPropsRegistryBuilder*doublePropWithDefault(stringname,doubledefaultValue)
Parameters
name
string — Required
Name of the prop.
defaultValue
double — Required
Default value of the prop,
to be picked up when there is no explicit value set
from the React Native JavaScript layer of the component.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
intProp()
Add a prop of signed 64-bit type, except that values outside the range ofIPropsRegistryBuilder*intProp(stringname)
Number.MIN_SAFE_INTEGER -(2**53 - 1) and
Number.MAX_SAFE_INTEGER (2**53 - 1)
will lose precision.
Since no default value is provided,
it is compulsory to provide
an explicit value from JavaScript layer.
Parameters
name
string — Required
Name of the prop.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
intPropWithDefault()
Add a prop of signed 64-bit type, except that values outside the range ofIPropsRegistryBuilder*intPropWithDefault(stringname,i64defaultValue)
Number.MIN_SAFE_INTEGER -(2**53 - 1) and
Number.MAX_SAFE_INTEGER (2**53 - 1)
will lose precision.
Parameters
name
string — Required
Name of the prop.
defaultValue
i64 — Required
Default value of the prop,
to be picked up when there is no explicit value set
from the React Native JavaScript layer of the component.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
arrayProp()
Add a prop of IJsArray type. Since no default value is provided, it is compulsory to provide an explicit value from JavaScript layer.IPropsRegistryBuilder*arrayProp(stringname)
Parameters
name
string — Required
Name of the prop.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
arrayPropWithDefault()
Add a prop of IJsArray type.IPropsRegistryBuilder*arrayPropWithDefault(stringname,IJsArray*defaultValue)
Parameters
name
string — Required
Name of the prop.
defaultValue
IJsArray* — Required
Default value of the prop,
to be picked up when there is no explicit value set
from the React Native JavaScript layer of the component.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
objectProp()
Add a prop of IJsObject type. Since no default value is provided, it is compulsory to provide an explicit value from JavaScript layer.IPropsRegistryBuilder*objectProp(stringname)
Parameters
name
string — Required
Name of the prop.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
objectPropWithDefault()
Add a prop of IJsObject type.IPropsRegistryBuilder*objectPropWithDefault(stringname,IJsObject*defaultValue)
Parameters
name
string — Required
Name of the prop.
defaultValue
IJsObject* — Required
Default value of the prop,
to be picked up when there is no explicit value set
from the React Native JavaScript layer of the component.
Returns
IPropsRegistryBuilder*
Builder instance to continue building out
the props registry.
Throws
DuplicatePropNameError— Thrown if attempting to add multiple props of the same name.
build()
Build the final props registry object.IPropsRegistry*build()
Returns
IPropsRegistry*
IPropsRegistry

