import{_ as e,c as t,o as a,N as l}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/clickables/clickable","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/clickable.md","lastUpdated":null}'),c={name:"api/modules/features/clickable.md"},o=l('
• 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. |
profectus/src/features/clickables/clickable.ts:61
• 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. |
profectus/src/features/clickables/clickable.ts:29
Ƭ 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.
Name | Type |
---|---|
T | extends ClickableOptions |
profectus/src/features/clickables/clickable.ts:73
Ƭ GenericClickable: Replace
<Clickable
<ClickableOptions
>, { canClick
: ProcessedComputable
<boolean
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Clickable object.
profectus/src/features/clickables/clickable.ts:86
• Const
ClickableType: typeof ClickableType
A symbol used to identify Clickable features.
profectus/src/features/clickables/clickable.ts:24
▸ createClickable<T
>(optionsFunc?
, ...decorators
): Clickable
<T
>
Lazily creates a clickable with the given options.
Name | Type |
---|---|
T | extends ClickableOptions |
Name | Type | Description |
---|---|---|
optionsFunc? | OptionsFunc <T , BaseClickable , GenericClickable > | Clickable options. |
...decorators | GenericDecorator [] | - |
Clickable
<T
>
profectus/src/features/clickables/clickable.ts:98
▸ setupAutoClick(layer
, clickable
, autoActive?
): Unsubscribe
Utility to auto click a clickable whenever it can be.
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 |
Unsubscribe
profectus/src/features/clickables/clickable.ts:192
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 |