Skip to content
On this page

Module: features/clickables/clickable

Interfaces

BaseClickable

BaseClickable: Object

The properties that are added onto a processed ClickableOptions to create an Clickable.

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.
typetypeof ClickableTypeA 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.

NameTypeDescription
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) => voidA function that is called when the clickable is clicked.
onHold?VoidFunctionA function that is called when the clickable is held down.
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/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

NameType
Textends 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
NameType
Textends ClickableOptions
Parameters
NameTypeDescription
optionsFunc?OptionsFunc<T, BaseClickable, GenericClickable>Clickable options.
...decoratorsGenericDecorator[]-
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
NameTypeDefault valueDescription
layerBaseLayerundefinedThe layer the clickable is apart of
clickableGenericClickableundefinedThe clicker to click automatically
autoActiveComputable<boolean>trueWhether or not the clickable should currently be auto-clicking
Returns

Unsubscribe

Defined in

profectus/src/features/clickables/clickable.ts:192

Components

Clickable Component

Props

NameType
display*processedPropType<UnwrapRef<GenericClickable["display"]>>(
Object,
String,
Function
)
visibility*processedPropType<Visibility | boolean>(Number, Boolean)
styleprocessedPropType<StyleValue>(Object, String, Array)
classesprocessedPropType<Record<string, boolean>>(Object)
onClick(e?: MouseEvent | TouchEvent) => void
onHoldVoidFunction
canClick*processedPropType<boolean>(Boolean)
smallboolean
markprocessedPropType<boolean | string>(Boolean, String)
id*string