import { invoke } from '@tauri-apps/api/core' export type PlanetMinecraftDownload = { pageUrl: string fileName?: string | null directUrl?: string | null sha256?: string | null } export type PlanetMinecraftVersion = { id: string name: string gameVersions: string[] download: PlanetMinecraftDownload } export type PlanetMinecraftProject = { id: string title: string pageUrl: string summary?: string | null versions: PlanetMinecraftVersion[] } export function planetMinecraftConnectorAvailable() { return invoke('plugin:planet-minecraft|planet_minecraft_connector_available') } export function searchPlanetMinecraftProjects(query: string, gameVersion?: string | null) { return invoke( 'plugin:planet-minecraft|planet_minecraft_search_projects', { query, gameVersion: gameVersion ?? null, }, ) } export function getPlanetMinecraftProject(id: string) { return invoke('plugin:planet-minecraft|planet_minecraft_get_project', { id, }) }