Module: features/action
Interfaces
ActionOptions
• ActionOptions: Object
An object that configures an Action.
Name | Type | Description |
---|---|---|
autoStart? | Computable <boolean > | Whether or not the action should perform automatically when the cooldown is finished. |
barOptions? | Partial <BarOptions > | A pass-through to the Bar used to display the cooldown progress for the action. |
canClick? | Computable <boolean > | Whether or not the clickable may be clicked. |
classes? | Computable <Record <string , boolean >> | Dictionary of CSS classes to apply to this feature. |
display? | Computable <CoercableComponent | { description : CoercableComponent ; title? : CoercableComponent }> | The display to use for this clickable. |
duration | Computable <DecimalSource > | The cooldown during which the action cannot be performed again, in seconds. |
mark? | Computable <string | boolean > | Shows a marker on the corner of the feature. |
onClick | (amount : DecimalSource ) => void | A function that is called when the action is clicked. |
small? | boolean | Toggles a smaller design for the feature. |
style? | Computable <StyleValue > | CSS to apply to this feature. |
visibility? | Computable <boolean | Visibility > | Whether this clickable should be visible. |
Defined in
profectus/src/features/action.tsx:42
BaseAction
• BaseAction: Object
The properties that are added onto a processed ActionOptions to create an Action.
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. |
id | string | An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates. |
isHolding | Ref <boolean > | Whether or not the player is holding down the action. Actions will be considered clicked as soon as the cooldown completes when being held down. |
progress | Ref <DecimalSource > | The current amount of progress through the cooldown. |
progressBar | GenericBar | The bar used to display the current cooldown progress. |
type | typeof ActionType | A symbol that helps identify features of the same type. |
update | (diff : number ) => void | Update the cooldown the specified number of seconds |
Defined in
profectus/src/features/action.tsx:56
Type Aliases
Action
Ƭ Action<T
>: Replace
<T
& BaseAction
, { autoStart
: GetComputableTypeWithDefault
<T
["autoStart"
], false
> ; canClick
: GetComputableTypeWithDefault
<T
["canClick"
], true
> ; classes
: GetComputableType
<T
["classes"
]> ; display
: JSXFunction
; duration
: GetComputableType
<T
["duration"
]> ; mark
: GetComputableType
<T
["mark"
]> ; onClick
: VoidFunction
; style
: GetComputableType
<T
["style"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
An object that represents a feature that can be clicked upon, and then has a cooldown before it can be clicked again.
Type parameters
Name | Type |
---|---|
T | extends ActionOptions |
Defined in
profectus/src/features/action.tsx:76
GenericAction
Ƭ GenericAction: Replace
<Action
<ActionOptions
>, { autoStart
: ProcessedComputable
<boolean
> ; canClick
: ProcessedComputable
<boolean
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Action object.
Defined in
profectus/src/features/action.tsx:92
Variables
ActionType
• Const
ActionType: typeof ActionType
A symbol used to identify Action features.
Defined in
profectus/src/features/action.tsx:37
Functions
createAction
▸ createAction<T
>(optionsFunc?
, ...decorators
): Action
<T
>
Lazily creates an action with the given options.
Type parameters
Name | Type |
---|---|
T | extends ActionOptions <T > |
Parameters
Name | Type | Description |
---|---|---|
optionsFunc? | OptionsFunc <T , BaseAction , GenericAction > | Action options. |
...decorators | GenericDecorator [] | - |
Returns
Action
<T
>