import{_ as e,c as t,o as a,N as o}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/repeatable","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/repeatable.md","lastUpdated":null}'),l={name:"api/modules/features/repeatable.md"},r=o('
• 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. Capped at 1 if maximize is false. |
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. |
profectus/src/features/repeatable.tsx:79
• 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. |
maximize? | Computable <boolean > | Whether or not clicking this repeatable should attempt to maximize amount based on the requirements met. Requires requirements to be a requirement or array of requirements with Requirement.canMaximize true. |
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. |
profectus/src/features/repeatable.tsx:53
Ƭ GenericRepeatable: Replace
<Repeatable
<RepeatableOptions
>, { limit
: ProcessedComputable
<DecimalSource
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Repeatable object.
profectus/src/features/repeatable.tsx:120
Ƭ Repeatable<T
>: Replace
<T
& BaseRepeatable
, { classes
: GetComputableType
<T
["classes"
]> ; display
: Ref
<CoercableComponent
> ; limit
: GetComputableTypeWithDefault
<T
["limit"
], default
> ; mark
: GetComputableType
<T
["mark"
]> ; maximize
: GetComputableType
<T
["maximize"
]> ; 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.
Name | Type |
---|---|
T | extends RepeatableOptions |
profectus/src/features/repeatable.tsx:104
Ƭ RepeatableDisplay: CoercableComponent
| { description?
: CoercableComponent
; effectDisplay?
: CoercableComponent
; showAmount?
: boolean
; title?
: CoercableComponent
}
A type that can be used to customize the Repeatable display.
profectus/src/features/repeatable.tsx:39
• Const
RepeatableType: typeof RepeatableType
A symbol used to identify Repeatable features.
profectus/src/features/repeatable.tsx:36
▸ createRepeatable<T
>(optionsFunc
, ...decorators
): Repeatable
<T
>
Lazily creates a repeatable with the given options.
Name | Type |
---|---|
T | extends RepeatableOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , BaseRepeatable , GenericRepeatable > | Repeatable options. |
...decorators | GenericDecorator [] | - |
Repeatable
<T
>