import{_ as e,c as t,o as a,N as r}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Module: features/reset","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/reset.md","lastUpdated":null}'),s={name:"api/modules/features/reset.md"},o=r('
• 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. |
profectus/src/features/reset.ts:30
• 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 <Record <string , unknown >[]> | List of things to reset. Can include objects which will be recursed over for persistent values. |
profectus/src/features/reset.ts:20
Ƭ GenericReset: Reset
<ResetOptions
>
A type that matches any valid Reset object.
profectus/src/features/reset.ts:48
Ƭ Reset<T
>: Replace
<T
& BaseReset
, { thingsToReset
: GetComputableType
<T
["thingsToReset"
]> }>
An object that represents a reset mechanic, which resets progress back to its initial state.
Name | Type |
---|---|
T | extends ResetOptions |
profectus/src/features/reset.ts:40
• Const
ResetType: typeof ResetType
A symbol used to identify Reset features.
profectus/src/features/reset.ts:15
▸ createReset<T
>(optionsFunc
): Reset
<T
>
Lazily creates a reset with the given options.
Name | Type |
---|---|
T | extends ResetOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , BaseReset , GenericReset > | Reset options. |
Reset
<T
>
profectus/src/features/reset.ts:54
▸ trackResetTime(layer
, reset
): Persistent
<default
>
Track the time since the specified reset last occured.
Name | Type | Description |
---|---|---|
layer | BaseLayer | The layer the reset is attached to |
reset | GenericReset | The reset mechanic to track the time since |