Code format

This commit is contained in:
2024-06-12 00:03:25 +02:00
parent babeed7c53
commit c1c821d703
8 changed files with 107 additions and 108 deletions

View File

@@ -4,7 +4,6 @@
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { type Food, FoodService } from '$lib/database/food' import { type Food, FoodService } from '$lib/database/food'
import type { Writable } from 'svelte/store'
let food: Food[] = [] let food: Food[] = []
onMount(async () => { onMount(async () => {

View File

@@ -12,7 +12,8 @@ const FoodService = {
async GetAll() { async GetAll() {
return await db.select<Food[]>('SELECT rowid, food, amount, per100, energy FROM food ORDER BY date DESC') return await db.select<Food[]>('SELECT rowid, food, amount, per100, energy FROM food ORDER BY date DESC')
}, },
async SetAll(data: Food[]) {} async SetAll(data: Food[]) {
}
} }
export {FoodService} export { FoodService }

View File

@@ -8,22 +8,20 @@ declare global {
} }
// Function avoids 'window not defined' in SSR // Function avoids 'window not defined' in SSR
const invoke = () => window.__TAURI_INVOKE__; const invoke = () => window.__TAURI_INVOKE__
export function helloTauri() { export function helloTauri() {
return invoke()<string>("hello_tauri") return invoke()<string>('hello_tauri')
} }
export function hash256sum(hashInput: string) { export function hash256sum(hashInput: string) {
return invoke()<string>("hash256sum", { hashInput }) return invoke()<string>('hash256sum', { hashInput })
} }
export function storeSetKey(key: string, value: string) { export function storeSetKey(key: string, value: string) {
return invoke()<null>("store_set_key", { key,value }) return invoke()<null>('store_set_key', { key, value })
} }
export function storeReadKey(key: string) { export function storeReadKey(key: string) {
return invoke()<string | null>("store_read_key", { key }) return invoke()<string | null>('store_read_key', { key })
} }

View File

@@ -3,11 +3,11 @@
<h2 class="flex items-center text-3xl [&_img]:h-12"> <h2 class="flex items-center text-3xl [&_img]:h-12">
This is a &#160 This is a &#160
<span> <span>
<img src="/svelte_logo.svg" alt="svelte logo" /> <img alt="svelte logo" src="/svelte_logo.svg" />
</span> </span>
&#160-&#160 &#160-&#160
<span> <span>
<img src="/tauri_logo.svg" alt="svelte logo" /> <img alt="svelte logo" src="/tauri_logo.svg" />
</span> </span>
&#160 Template &#160 Template
</h2> </h2>

View File

@@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { getTauriVersion, getVersion, getName } from '@tauri-apps/api/app' import { getName, getTauriVersion, getVersion } from '@tauri-apps/api/app'
type Versions = { type Versions = {
tauri: string tauri: string
app: string app: string