// @generated by FORGE - DO NOT EDIT

import { getForgeClient, createSubscriptionStore } from "@forge-rs/svelte";
import type {
  CreateTodoInput,
  Todo,
  UpdateTodoInput,
} from "./types";

// Queries
export const listTodos = (): Promise<Todo[]> =>
  getForgeClient().call("list_todos", null);

// Subscriptions
export const listTodosStore$ = () =>
  createSubscriptionStore<null, Todo[]>("list_todos", null);

// Mutations
export const createTodo = (args: CreateTodoInput): Promise<Todo> =>
  getForgeClient().call("create_todo", args);
export const deleteTodo = (args: { id: string }): Promise<boolean> =>
  getForgeClient().call("delete_todo", args);
export const updateTodo = (args: UpdateTodoInput): Promise<Todo> =>
  getForgeClient().call("update_todo", args);
