mirror of
https://github.com/hulthe/inkopslista.git
synced 2026-09-18 09:53:39 +02:00
favourite buttons are based on how often a good i added to list finished implementing setting category made number of days until button an environment variable rebase on main and fix ran cargo fmt
43 lines
1.0 KiB
Plaintext
43 lines
1.0 KiB
Plaintext
export struct SItem {
|
|
name: string,
|
|
checked: bool,
|
|
amount: int,
|
|
}
|
|
|
|
export struct SButtonItem{
|
|
name: string,
|
|
category: string,
|
|
}
|
|
|
|
export enum ConnectionStatus {
|
|
Idle,
|
|
Syncing,
|
|
Error,
|
|
}
|
|
|
|
export global State {
|
|
in-out property <[SItem]> list: [
|
|
{ name: "Test 1", checked: true },
|
|
{ name: "Test 2", checked: false },
|
|
{ name: "Test 3", checked: false },
|
|
];
|
|
callback refresh-list();
|
|
callback add-to-list(string);
|
|
callback check-item(string);
|
|
callback delete-checked();
|
|
callback inc-amount(string);
|
|
callback dec-amount(string);
|
|
callback set-cat(string, string);
|
|
in-out property <string> server-address;
|
|
in property <[SButtonItem]> favorites: [
|
|
{ name: "mjölk", category: "kyl" },
|
|
{ name: "ost", category: "kyl" },
|
|
];
|
|
|
|
callback set-server-address(string);
|
|
set-server-address(address) => {
|
|
server-address = address;
|
|
}
|
|
in-out property <ConnectionStatus> connection-status: ConnectionStatus.Syncing;
|
|
}
|