Module: features/achievements/achievement
Enumerations
AchievementDisplay
• AchievementDisplay: Object
Modes for only displaying some achievements.
Name | Type |
---|---|
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.
Name | Type | Description |
---|---|---|
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? | VoidFunction | A function that is called when the achievement is completed. |
requirements? | Requirements | The 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.
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. |
complete | VoidFunction | A function to complete this achievement. |
earned | Persistent <boolean > | Whether or not this achievement has been earned. |
id | string | An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates. |
type | typeof AchievementType | A 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
Name | Type |
---|---|
T | extends 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
Name | Type |
---|---|
T | extends AchievementOptions |
Parameters
Name | Type | Description |
---|---|---|
optionsFunc? | OptionsFunc <T , BaseAchievement , GenericAchievement > | Achievement options. |
...decorators | GenericDecorator [] | - |
Returns
Achievement
<T
>
Defined in
profectus/src/features/achievements/achievement.tsx:140
Components
Achievement Component
Props
Name | Type |
---|---|
visibility * | processedPropType<Visibility | boolean>(Number, Boolean) |
display | processedPropType<UnwrapRef<GenericAchievement["display"]>>(Object, String, Function) |
earned * | processedPropType<boolean>(Boolean) |
requirements | processedPropType<Requirements>(Object, Array) |
image | processedPropType<string>(String) |
style | processedPropType<StyleValue>(String, Object, Array) |
classes | processedPropType<Record<string, boolean>>(Object) |
mark | processedPropType<boolean | string>(Boolean, String) |
small | processedPropType<boolean>(Boolean) |
id * | string |