Skip to content
On this page

Module: features/achievements/achievement

Enumerations

AchievementDisplay

AchievementDisplay: Object

Modes for only displaying some achievements.

NameType
All"all"
Configurable"configurable"
Incomplete"incomplete"
None"none"

Defined in

profectus/src/features/achievements/achievement.tsx:51

Interfaces

AchievementOptions

AchievementOptions: Object

An object that configures an Achievement.

NameTypeDescription
classes?Computable<Record<string, boolean>>Dictionary of CSS classes to apply to this feature.
display?Computable<CoercableComponent | { effectDisplay?: CoercableComponent ; optionsDisplay?: CoercableComponent ; requirement?: CoercableComponent }>The display to use for this achievement.
image?Computable<string>An image to display as the background for this achievement.
mark?Computable<string | boolean>Shows a marker on the corner of the feature.
onComplete?VoidFunctionA function that is called when the achievement is completed.
requirements?RequirementsThe requirement(s) to earn this achievement. Can be left null if using complete.
showPopups?Computable<boolean>Whether or not to display a notification popup when this achievement is earned.
small?Computable<boolean>Toggles a smaller design for the feature.
style?Computable<StyleValue>CSS to apply to this feature.
visibility?Computable<boolean | Visibility>Whether this achievement should be visible.

Defined in

profectus/src/features/achievements/achievement.tsx:62


BaseAchievement

BaseAchievement: Object

The properties that are added onto a processed AchievementOptions to create an Achievement.

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.
completeVoidFunctionA function to complete this achievement.
earnedPersistent<boolean>Whether or not this achievement has been earned.
idstringAn auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates.
typetypeof AchievementTypeA symbol that helps identify features of the same type.

Defined in

profectus/src/features/achievements/achievement.tsx:98

Type Aliases

Achievement

Ƭ Achievement<T>: Replace<T & BaseAchievement, { classes: GetComputableType<T["classes"]> ; display: GetComputableType<T["display"]> ; image: GetComputableType<T["image"]> ; mark: GetComputableType<T["mark"]> ; showPopups: GetComputableTypeWithDefault<T["showPopups"], true> ; style: GetComputableType<T["style"]> ; visibility: GetComputableTypeWithDefault<T["visibility"], Visible> }>

An object that represents a feature with requirements that is passively earned upon meeting certain requirements.

Type parameters

NameType
Textends AchievementOptions

Defined in

profectus/src/features/achievements/achievement.tsx:114


GenericAchievement

Ƭ GenericAchievement: Replace<Achievement<AchievementOptions>, { showPopups: ProcessedComputable<boolean> ; visibility: ProcessedComputable<Visibility | boolean> }>

A type that matches any valid Achievement object.

Defined in

profectus/src/features/achievements/achievement.tsx:128

Variables

AchievementType

Const AchievementType: typeof AchievementType

A symbol used to identify Achievement features.

Defined in

profectus/src/features/achievements/achievement.tsx:48

Functions

createAchievement

createAchievement<T>(optionsFunc?, ...decorators): Achievement<T>

Lazily creates an achievement with the given options.

Type parameters
NameType
Textends AchievementOptions
Parameters
NameTypeDescription
optionsFunc?OptionsFunc<T, BaseAchievement, GenericAchievement>Achievement options.
...decoratorsGenericDecorator[]-
Returns

Achievement<T>

Defined in

profectus/src/features/achievements/achievement.tsx:140

Components

Achievement Component

Props

NameType
visibility*processedPropType<Visibility | boolean>(Number, Boolean)
displayprocessedPropType<UnwrapRef<GenericAchievement["display"]>>(Object, String, Function)
earned*processedPropType<boolean>(Boolean)
requirementsprocessedPropType<Requirements>(Object, Array)
imageprocessedPropType<string>(String)
styleprocessedPropType<StyleValue>(String, Object, Array)
classesprocessedPropType<Record<string, boolean>>(Object)
markprocessedPropType<boolean | string>(Boolean, String)
smallprocessedPropType<boolean>(Boolean)
id*string