Skip to content
On this page

Module: features/challenges/challenge

Components

Interfaces

Type Aliases

Challenge

Ƭ Challenge<T>: Replace<T & BaseChallenge, { canComplete: GetComputableTypeWithDefault<T["canComplete"], Ref<boolean>> ; canStart: GetComputableTypeWithDefault<T["canStart"], true> ; classes: GetComputableType<T["classes"]> ; completionLimit: GetComputableTypeWithDefault<T["completionLimit"], 1> ; display: GetComputableType<T["display"]> ; goal: GetComputableType<T["goal"]> ; mark: GetComputableTypeWithDefault<T["mark"], Ref<boolean>> ; style: GetComputableType<T["style"]> ; visibility: GetComputableTypeWithDefault<T["visibility"], Visible> }>

Type parameters

NameType
Textends ChallengeOptions

Defined in

profectus/src/features/challenges/challenge.tsx:66


GenericChallenge

Ƭ GenericChallenge: Replace<Challenge<ChallengeOptions>, { canComplete: ProcessedComputable<boolean | DecimalSource> ; canStart: ProcessedComputable<boolean> ; completionLimit: ProcessedComputable<DecimalSource> ; mark: ProcessedComputable<boolean> ; visibility: ProcessedComputable<Visibility> }>

Defined in

profectus/src/features/challenges/challenge.tsx:81

Variables

ChallengeType

Const ChallengeType: typeof ChallengeType

Defined in

profectus/src/features/challenges/challenge.tsx:25

Functions

createActiveChallenge

createActiveChallenge(challenges): Ref<GenericChallenge | undefined>

Parameters

NameType
challengesGenericChallenge[]

Returns

Ref<GenericChallenge | undefined>


createChallenge

createChallenge<T>(optionsFunc): Challenge<T>

Type parameters

NameType
Textends ChallengeOptions

Parameters

NameType
optionsFuncOptionsFunc<T, BaseChallenge, GenericChallenge>

Returns

Challenge<T>


isAnyChallengeActive

isAnyChallengeActive(challenges): Ref<boolean>

Parameters

NameType
challengesGenericChallenge[] | Ref<undefined | GenericChallenge>

Returns

Ref<boolean>


setupAutoComplete

setupAutoComplete(challenge, autoActive?, exitOnComplete?): WatchStopHandle

Parameters

NameTypeDefault value
challengeGenericChallengeundefined
autoActiveComputable<boolean>true
exitOnCompletebooleantrue

Returns

WatchStopHandle