Skip to content
On this page

Module: features/repeatable

Interfaces

BaseRepeatable

BaseRepeatable: Object

The properties that are added onto a processed RepeatableOptions to create a Repeatable.

NameTypeDescription
[Component]GenericComponentThe Vue component used to render this feature.
[GatherProps]() => Record<string, unknown>A function to gather the props the vue component requires for this feature.
amountPersistent<DecimalSource>The current amount this repeatable has.
amountToIncreaseRef<DecimalSource>How much amount can be increased by, or 1 if unclickable.
canClickProcessedComputable<boolean>Whether or not this repeatable can be clicked.
idstringAn auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates.
maxedRef<boolean>Whether or not this repeatable's amount is at it's limit.
onClick(event?: MouseEvent | TouchEvent) => voidA function that gets called when this repeatable is clicked.
typetypeof RepeatableTypeA 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.

NameTypeDescription
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?DecimalSourceThe 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.
requirementsRequirementsThe 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

NameType
Textends 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
NameType
Textends RepeatableOptions
Parameters
NameTypeDescription
optionsFuncOptionsFunc<T, BaseRepeatable, GenericRepeatable>Repeatable options.
...decoratorsGenericDecorator[]-
Returns

Repeatable<T>

Defined in

profectus/src/features/repeatable.tsx:128