<!DOCTYPE html><htmlclass="default"lang="en"><head><metacharset="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>PokerogueSystemSavedataApi | pokemon-rogue-battle</title><metaname="description"content="Documentation for pokemon-rogue-battle"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="../assets/style.css"/><linkrel="stylesheet"href="../assets/highlight.css"/><scriptdefersrc="../assets/main.js"></script><scriptasyncsrc="../assets/icons.js"id="tsd-icons-script"></script><scriptasyncsrc="../assets/search.js"id="tsd-search-script"></script><scriptasyncsrc="../assets/navigation.js"id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme=localStorage.getItem("tsd-theme")||"os";document.body.style.display="none";setTimeout(()=>app?app.showPage():document.body.style.removeProperty("display"),500)</script><headerclass="tsd-page-toolbar"><divclass="tsd-toolbar-contents container"><divclass="table-cell"id="tsd-search"data-base=".."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget tsd-toolbar-icon search no-caption"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-search"></use></svg></label><inputtype="text"id="tsd-search-field"aria-label="Search"/></div><divclass="field"><divid="tsd-toolbar-links"></div></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="../index.html"class="title">pokemon-rogue-battle</a></div><divclass="table-cell"id="tsd-widgets"><ahref="#"class="tsd-widget tsd-toolbar-icon menu no-caption"data-toggle="menu"aria-label="Menu"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><divclass="container container-main"><divclass="col-content"><divclass="tsd-page-title"><ulclass="tsd-breadcrumb"><li><ahref="../index.html">pokemon-rogue-battle</a></li><li><ahref="../modules/plugins_api_pokerogue_system_savedata_api.html">plugins/api/pokerogue-system-savedata-api</a></li><li><ahref="plugins_api_pokerogue_system_savedata_api.PokerogueSystemSavedataApi.html">PokerogueSystemSavedataApi</a></li></ul><h1>Class PokerogueSystemSavedataApi</h1></div><sectionclass="tsd-panel tsd-comment"><divclass="tsd-comment tsd-typography"><p>A wrapper for PokéRogue system savedata API requests.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">path</span>: <spanclass="tsd-signature-type">string</span></span><divclass="tsd-comment tsd-typography"><p>The path to send the request to.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">path</span>: <spanclass="tsd-signature-type">string</span></span><divclass="tsd-comment tsd-typography"><p>The path to send the request to.</p>
</div><sectionclass="tsd-panel"><h4>Type Parameters</h4><ulclass="tsd-type-parameter-list"><li><span><aid="doPost.doPost-1.D"class="tsd-anchor"></a><spanclass="tsd-kind-type-parameter">D</span> = <spanclass="tsd-signature-type">undefined</span></span></li></ul></section><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">path</span>: <spanclass="tsd-signature-type">string</span></span><divclass="tsd-comment tsd-typography"><p>THe path to send the request to.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><codeclass="tsd-tag">Optional</code><spanclass="tsd-kind-parameter">bodyData</span>: <aclass="tsd-signature-type tsd-kind-type-parameter"href="plugins_api_api_base.ApiBase.html#doPost.doPost-1.D">D</a></span><divclass="tsd-comment tsd-typography"><p>The body-data to send.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">dataType</span>: <spanclass="tsd-signature-type">DataType</span><spanclass="tsd-signature-symbol"> = "json"</span></span><divclass="tsd-comment tsd-typography"><p>The data-type of the bodyData.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">params</span>: <ahref="../interfaces/_types_PokerogueSystemSavedataApi.GetSystemSavedataRequest.html"class="tsd-signature-type tsd-kind-interface">GetSystemSavedataRequest</a></span><divclass="tsd-comment tsd-typography"><p>The <ahref="../interfaces/_types_PokerogueSystemSavedataApi.GetSystemSavedataRequest.html"class="tsd-kind-interface"><code>GetSystemSavedataRequest</code></a> to send</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">null</span><spanclass="tsd-signature-symbol"> | </span><spanclass="tsd-signature-type">string</span><spanclass="tsd-signature-symbol">></span></h4><p>The system savedata as <code>string</code> or <code>null</code> on error</p>
Any key with a value of <code>undefined</code> will be ignored.
Any key with a value of <code>null</code> will be included.</p>
</div><sectionclass="tsd-panel"><h4>Type Parameters</h4><ulclass="tsd-type-parameter-list"><li><span><aid="toUrlSearchParams.toUrlSearchParams-1.D-1"class="tsd-anchor"></a><spanclass="tsd-kind-type-parameter">D</span><spanclass="tsd-signature-keyword"> extends </span><spanclass="tsd-signature-type">Record</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">string</span><spanclass="tsd-signature-symbol">, </span><spanclass="tsd-signature-type">any</span><spanclass="tsd-signature-symbol">></span></span></li></ul></section><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">data</span>: <aclass="tsd-signature-type tsd-kind-type-parameter"href="plugins_api_api_base.ApiBase.html#toUrlSearchParams.toUrlSearchParams-1.D-1">D</a></span><divclass="tsd-comment tsd-typography"><p>the data to transform to URLSearchParams</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">URLSearchParams</span></h4><p>a URLSearchParams representaton of data</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><p>Inherited from <ahref="plugins_api_api_base.ApiBase.html">ApiBase</a>.<ahref="plugins_api_api_base.ApiBase.html#toUrlSearchParams">toUrlSearchParams</a></p><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/dd904fe7827eb2695c5362f0864e32d58df10c6c/src/plugins/api/api-base.ts#L86">src/plugins/api/api-base.ts:86</a></li></ul></aside></li></ul></section><sectionclass="tsd-panel tsd-member"><aid="update"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>update</span><ahref="#update"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="update.update-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">update</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">params</span>, <spanclass="tsd-kind-parameter">rawSystemData</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">string</span><spanclass="tsd-signature-symbol">></span><ahref="#update.update-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Update a system savedata.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">params</span>: <ahref="_types_PokerogueSystemSavedataApi.UpdateSystemSavedataRequest.html"class="tsd-signature-type tsd-kind-class">UpdateSystemSavedataRequest</a></span><divclass="tsd-comment tsd-typography"><p>The <ahref="_types_PokerogueSystemSavedataApi.UpdateSystemSavedataRequest.html"class="tsd-kind-class"><code>UpdateSystemSavedataRequest</code></a> to send</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">rawSystemData</span>: <spanclass="tsd-signature-type">string</span></span><divclass="tsd-comment tsd-typography"><p>The raw SystemSaveData</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">string</span><spanclass="tsd-signature-symbol">></span></h4><p>An error message if something went wrong</p>