Module: features/reset
Interfaces
BaseReset
• BaseReset: Object
The properties that are added onto a processed ResetOptions to create an Reset.
Name | Type | Description |
---|---|---|
id | string | An auto-generated ID for identifying which reset is being performed. Will not persist between refreshes or updates. |
reset | VoidFunction | Trigger the reset. |
type | typeof ResetType | A 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.
Name | Type | Description |
---|---|---|
onReset? | VoidFunction | A function that is called when the reset is performed. |
thingsToReset | Computable <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
Name | Type |
---|---|
T | extends 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
Name | Type |
---|---|
T | extends ResetOptions |
Parameters
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <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
Name | Type | Description |
---|---|---|
layer | BaseLayer | The layer the reset is attached to |
reset | GenericReset | The reset mechanic to track the time since |