Skip to content
On this page

Module: features/reset

Interfaces

BaseReset

BaseReset: Object

The properties that are added onto a processed ResetOptions to create an Reset.

NameTypeDescription
idstringAn auto-generated ID for identifying which reset is being performed. Will not persist between refreshes or updates.
resetVoidFunctionTrigger the reset.
typetypeof ResetTypeA symbol that helps identify features of the same type.

Defined in

profectus/src/features/reset.ts:31


ResetOptions

ResetOptions: Object

An object that configures a Clickable.

NameTypeDescription
onReset?VoidFunctionA function that is called when the reset is performed.
thingsToResetComputable<unknown[]>List of things to reset. Can include objects which will be recursed over for persistent values.

Defined in

profectus/src/features/reset.ts:21

Type Aliases

GenericReset

Ƭ GenericReset: Reset<ResetOptions>

A type that matches any valid Reset object.

Defined in

profectus/src/features/reset.ts:49


Reset

Ƭ Reset<T>: Replace<T & BaseReset, { thingsToReset: GetComputableType<T["thingsToReset"]> }>

An object that represents a reset mechanic, which resets progress back to its initial state.

Type parameters

NameType
Textends ResetOptions

Defined in

profectus/src/features/reset.ts:41

Variables

ResetType

Const ResetType: typeof ResetType

A symbol used to identify Reset features.

Defined in

profectus/src/features/reset.ts:16

Functions

createReset

createReset<T>(optionsFunc): Reset<T>

Lazily creates a reset with the given options.

Type parameters
NameType
Textends ResetOptions
Parameters
NameTypeDescription
optionsFuncOptionsFunc<T, BaseReset, GenericReset>Reset options.
Returns

Reset<T>

Defined in

profectus/src/features/reset.ts:55


trackResetTime

trackResetTime(layer, reset): Persistent<default>

Track the time since the specified reset last occured.

Parameters
NameTypeDescription
layerBaseLayerThe layer the reset is attached to
resetGenericResetThe reset mechanic to track the time since
Returns

Persistent<default>

Defined in

profectus/src/features/reset.ts:101