import{_ as e,c as t,o as a,a as o}from"./app.ab34650d.js";const m=JSON.parse('{"title":"Module: data/common","description":"","frontmatter":{"editLink":false},"headers":[{"level":2,"title":"Interfaces","slug":"interfaces"},{"level":2,"title":"Type Aliases","slug":"type-aliases"},{"level":3,"title":"GenericLayerTreeNode","slug":"genericlayertreenode"},{"level":3,"title":"GenericResetButton","slug":"genericresetbutton"},{"level":3,"title":"LayerTreeNode","slug":"layertreenode"},{"level":3,"title":"ResetButton","slug":"resetbutton"},{"level":2,"title":"Functions","slug":"functions"},{"level":3,"title":"colorText","slug":"colortext"},{"level":3,"title":"createCollapsibleModifierSections","slug":"createcollapsiblemodifiersections"},{"level":3,"title":"createLayerTreeNode","slug":"createlayertreenode"},{"level":3,"title":"createResetButton","slug":"createresetbutton"}],"relativePath":"api/modules/data/common.md","lastUpdated":null}'),d={name:"api/modules/data/common.md"},r=o('
\u01AC GenericLayerTreeNode: Replace
<LayerTreeNode
<LayerTreeNodeOptions
>, { append?
: ProcessedComputable
<boolean
> ; display
: ProcessedComputable
<CoercableComponent
> }>
A type that matches any valid LayerTreeNode object.
profectus/src/data/common.tsx:196
\u01AC GenericResetButton: Replace
<GenericClickable
& ResetButton
<ResetButtonOptions
>, { canClick
: ProcessedComputable
<boolean
> ; display
: ProcessedComputable
<CoercableComponent
> ; minimumGain
: ProcessedComputable
<DecimalSource
> ; resetDescription
: ProcessedComputable
<string
> ; showNextAt
: ProcessedComputable
<boolean
> }>
A type that matches any valid ResetButton object.
profectus/src/data/common.tsx:79
\u01AC LayerTreeNode<T
>: Replace
<TreeNode
<T
>, { append
: GetComputableType
<T
["append"
]> ; display
: GetComputableTypeWithDefault
<T
["display"
], T
["layerID"
]> }>
A tree node that is associated with a given layer, and which opens the layer when clicked.
Name | Type |
---|---|
T | extends LayerTreeNodeOptions |
profectus/src/data/common.tsx:188
\u01AC ResetButton<T
>: Replace
<Clickable
<T
>, { canClick
: GetComputableTypeWithDefault
<T
["canClick"
], Ref
<boolean
>> ; display
: GetComputableTypeWithDefault
<T
["display"
], Ref
<JSX.Element
>> ; minimumGain
: GetComputableTypeWithDefault
<T
["minimumGain"
], 1
> ; onClick
: VoidFunction
; resetDescription
: GetComputableTypeWithDefault
<T
["resetDescription"
], Ref
<string
>> ; showNextAt
: GetComputableTypeWithDefault
<T
["showNextAt"
], true
> }>
A button that is used to control a conversion. It will show how much can be converted currently, and can show when that amount will go up, as well as handle only being clickable when a sufficient amount of currency can be gained. Assumes this button is associated with a specific node on a tree, and triggers that tree's reset propagation.
Name | Type |
---|---|
T | extends ResetButtonOptions |
profectus/src/data/common.tsx:66
\u25B8 colorText(textToColor
, color?
): JSX.Element
Creates an HTML string for a span that writes some given text in a given color.
Name | Type | Default value | Description |
---|---|---|---|
textToColor | string | undefined | The content to change the color of |
color | string | "var(--accent2)" | The color to change the content to look like. Defaults to the current theme's accent 2 variable. |
JSX.Element
\u25B8 createCollapsibleModifierSections(sections
): [JSXFunction
, Persistent
<boolean
>[]]
Takes an array of modifier "sections", and creates a JSXFunction that can render all those sections, and allow each section to be collapsed. Also returns a list of persistent refs that are used to control which sections are currently collapsed.
Name | Type |
---|---|
sections | Section [] |
[JSXFunction
, Persistent
<boolean
>[]]
\u25B8 createLayerTreeNode<T
>(optionsFunc
): LayerTreeNode
<T
>
Lazily creates a tree node that's associated with a specific layer, with the given options.
Name | Type |
---|---|
T | extends LayerTreeNodeOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , Record <string , unknown >, Record <string , unknown >> | A function that returns the options object for this tree node. |
\u25B8 createResetButton<T
>(optionsFunc
): ResetButton
<T
>
Lazily creates a reset button with the given options.
Name | Type |
---|---|
T | extends ClickableOptions & ResetButtonOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , Record <string , unknown >, Record <string , unknown >> | A function that returns the options object for this reset button. |
ResetButton
<T
>