import{_ as e,c as t,o,N as a}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Module: features/action","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/action.md","lastUpdated":null}'),c={name:"api/modules/features/action.md"},d=a('

Module: features/action

Interfaces

ActionOptions

ActionOptions: Object

An object that configures an Action.

NameTypeDescription
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.
durationComputable<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) => voidA function that is called when the action is clicked.
small?booleanToggles 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.

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.
idstringAn auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates.
isHoldingRef<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.
progressRef<DecimalSource>The current amount of progress through the cooldown.
progressBarGenericBarThe bar used to display the current cooldown progress.
typetypeof ActionTypeA symbol that helps identify features of the same type.
update(diff: number) => voidUpdate 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

NameType
Textends 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
NameType
Textends ActionOptions<T>
Parameters
NameTypeDescription
optionsFunc?OptionsFunc<T, BaseAction, GenericAction>Action options.
...decoratorsGenericDecorator[]-
Returns

Action<T>

Defined in

profectus/src/features/action.tsx:105

',47),l=[d];function r(i,n,s,h,f,p){return o(),t("div",null,l)}const g=e(c,[["render",r]]);export{b as __pageData,g as default};