Module: features/clickables/clickable
Interfaces
BaseClickable
• BaseClickable: Object
The properties that are added onto a processed ClickableOptions to create an Clickable.
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. |
type | typeof ClickableType | A symbol that helps identify features of the same type. |
Defined in
profectus/src/features/clickables/clickable.ts:61
ClickableOptions
• ClickableOptions: Object
An object that configures a Clickable.
Name | Type | Description |
---|---|---|
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. |
mark? | Computable <string | boolean > | Shows a marker on the corner of the feature. |
onClick? | (e? : MouseEvent | TouchEvent ) => void | A function that is called when the clickable is clicked. |
onHold? | VoidFunction | A function that is called when the clickable is held down. |
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/clickables/clickable.ts:29
Type Aliases
Clickable
Ƭ Clickable<T
>: Replace
<T
& BaseClickable
, { canClick
: GetComputableTypeWithDefault
<T
["canClick"
], true
> ; classes
: GetComputableType
<T
["classes"
]> ; display
: GetComputableType
<T
["display"
]> ; mark
: GetComputableType
<T
["mark"
]> ; style
: GetComputableType
<T
["style"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
An object that represents a feature that can be clicked or held down.
Type parameters
Name | Type |
---|---|
T | extends ClickableOptions |
Defined in
profectus/src/features/clickables/clickable.ts:73
GenericClickable
Ƭ GenericClickable: Replace
<Clickable
<ClickableOptions
>, { canClick
: ProcessedComputable
<boolean
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Clickable object.
Defined in
profectus/src/features/clickables/clickable.ts:86
Variables
ClickableType
• Const
ClickableType: typeof ClickableType
A symbol used to identify Clickable features.
Defined in
profectus/src/features/clickables/clickable.ts:24
Functions
createClickable
▸ createClickable<T
>(optionsFunc?
, ...decorators
): Clickable
<T
>
Lazily creates a clickable with the given options.
Type parameters
Name | Type |
---|---|
T | extends ClickableOptions |
Parameters
Name | Type | Description |
---|---|---|
optionsFunc? | OptionsFunc <T , BaseClickable , GenericClickable > | Clickable options. |
...decorators | GenericDecorator [] | - |
Returns
Clickable
<T
>
Defined in
profectus/src/features/clickables/clickable.ts:98
setupAutoClick
▸ setupAutoClick(layer
, clickable
, autoActive?
): Unsubscribe
Utility to auto click a clickable whenever it can be.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
layer | BaseLayer | undefined | The layer the clickable is apart of |
clickable | GenericClickable | undefined | The clicker to click automatically |
autoActive | Computable <boolean > | true | Whether or not the clickable should currently be auto-clicking |
Returns
Unsubscribe
Defined in
profectus/src/features/clickables/clickable.ts:192
Components
Clickable Component
Props
Name | Type |
---|---|
display * | processedPropType<UnwrapRef<GenericClickable["display"]>>( |
visibility * | processedPropType<Visibility | boolean>(Number, Boolean) |
style | processedPropType<StyleValue>(Object, String, Array) |
classes | processedPropType<Record<string, boolean>>(Object) |
onClick | (e?: MouseEvent | TouchEvent) => void |
onHold | VoidFunction |
canClick * | processedPropType<boolean>(Boolean) |
small | boolean |
mark | processedPropType<boolean | string>(Boolean, String) |
id * | string |