Use app.d.ts for jsdoc

This commit is contained in:
ditatompel 2024-05-08 20:07:51 +07:00
parent ef6d2a481f
commit 394f5654c6
No known key found for this signature in database
GPG key ID: 31D3D06D77950979
2 changed files with 8 additions and 10 deletions

View file

@ -22,6 +22,12 @@ declare global {
is_available: boolean;
nettype: string;
}
interface ApiResponse {
status: string;
message: string;
data: null | object | object[];
}
}
export {};

View file

@ -2,17 +2,10 @@
import { invalidateAll, goto } from '$app/navigation';
import { apiUri } from '$lib/utils/common';
import { ProgressBar } from '@skeletonlabs/skeleton';
/** @type {import('./$types').PageData} */
export let data;
/**
* @typedef formResult
* @type {object}
* @property {string} status
* @property {string} message
* @property {null | object} data
*/
/** @type {formResult} */
/** @type {ApiResponse} */
export let formResult;
let isProcessing = false;
@ -31,7 +24,6 @@
isProcessing = false;
if (formResult.status === 'ok') {
// rerun all `load` functions, following the successful update
await invalidateAll();
goto('/remote-nodes');
}