Module: features/repeatable
Interfaces
BaseRepeatable
• BaseRepeatable: Object
The properties that are added onto a processed RepeatableOptions to create a Repeatable.
Name | Type | Description |
---|---|---|
[Component] | GenericComponent | The Vue component used to render this feature. |
[GatherProps] | () => Record <string , unknown > | A function to gather the props the vue component requires for this feature. |
amount | Persistent <DecimalSource > | The current amount this repeatable has. |
amountToIncrease | Ref <DecimalSource > | How much amount can be increased by, or 1 if unclickable. |
canClick | ProcessedComputable <boolean > | Whether or not this repeatable can be clicked. |
id | string | An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates. |
maxed | Ref <boolean > | Whether or not this repeatable's amount is at it's limit. |
onClick | (event? : MouseEvent | TouchEvent ) => void | A function that gets called when this repeatable is clicked. |
type | typeof RepeatableType | A symbol that helps identify features of the same type. |
Defined in
profectus/src/features/repeatable.tsx:77
RepeatableOptions
• RepeatableOptions: Object
An object that configures a Repeatable.
Name | Type | Description |
---|---|---|
classes? | Computable <Record <string , boolean >> | Dictionary of CSS classes to apply to this feature. |
display? | Computable <RepeatableDisplay > | The display to use for this repeatable. |
initialAmount? | DecimalSource | The initial amount this repeatable has on a new save / after reset. |
limit? | Computable <DecimalSource > | The maximum amount obtainable for this repeatable. |
mark? | Computable <string | boolean > | Shows a marker on the corner of the feature. |
requirements | Requirements | The requirement(s) to increase this repeatable. |
small? | Computable <boolean > | Toggles a smaller design for the feature. |
style? | Computable <StyleValue > | CSS to apply to this feature. |
visibility? | Computable <boolean | Visibility > | Whether this repeatable should be visible. |
Defined in
profectus/src/features/repeatable.tsx:53
Type Aliases
GenericRepeatable
Ƭ GenericRepeatable: Replace
<Repeatable
<RepeatableOptions
>, { limit
: ProcessedComputable
<DecimalSource
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Repeatable object.
Defined in
profectus/src/features/repeatable.tsx:116
Repeatable
Ƭ Repeatable<T
>: Replace
<T
& BaseRepeatable
, { classes
: GetComputableType
<T
["classes"
]> ; display
: Ref
<CoercableComponent
> ; limit
: GetComputableTypeWithDefault
<T
["limit"
], default
> ; mark
: GetComputableType
<T
["mark"
]> ; requirements
: GetComputableType
<T
["requirements"
]> ; small
: GetComputableType
<T
["small"
]> ; style
: GetComputableType
<T
["style"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
An object that represents a feature with multiple "levels" with scaling requirements.
Type parameters
Name | Type |
---|---|
T | extends RepeatableOptions |
Defined in
profectus/src/features/repeatable.tsx:101
RepeatableDisplay
Ƭ RepeatableDisplay: CoercableComponent
| { description?
: CoercableComponent
; effectDisplay?
: CoercableComponent
; showAmount?
: boolean
; title?
: CoercableComponent
}
A type that can be used to customize the Repeatable display.
Defined in
profectus/src/features/repeatable.tsx:39
Variables
RepeatableType
• Const
RepeatableType: typeof RepeatableType
A symbol used to identify Repeatable features.
Defined in
profectus/src/features/repeatable.tsx:36
Functions
createRepeatable
▸ createRepeatable<T
>(optionsFunc
, ...decorators
): Repeatable
<T
>
Lazily creates a repeatable with the given options.
Type parameters
Name | Type |
---|---|
T | extends RepeatableOptions |
Parameters
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , BaseRepeatable , GenericRepeatable > | Repeatable options. |
...decorators | GenericDecorator [] | - |
Returns
Repeatable
<T
>