Download src/shared/api.ts from tostido/weed-sim: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/tostido/weed-sim/resolve/main/src/shared/api.ts
- Command line
-
hf download hf://spaces/tostido/weed-sim/src/shared/api.ts
-
curl -L -o api.ts https://huggingface.co/spaces/tostido/weed-sim/resolve/main/src/shared/api.ts
1.25 kB
| import type { BusInbox, BusReceipt } from './bus'; | |
| import type { CrossPrediction, DeckSummary, GameState, LabPayload, SeedProfile } from './types'; | |
| export type ErrorResponse = { | |
| status: 'error'; | |
| message: string; | |
| }; | |
| export type InitResponse = { | |
| status: 'ok'; | |
| postId: string; | |
| username: string; | |
| state: GameState; | |
| deck: DeckSummary; | |
| }; | |
| export type InventoryResponse = { | |
| seeds: SeedProfile[]; | |
| }; | |
| export type SelectionResponse = { | |
| ids: string[]; | |
| }; | |
| export type SelectionRequest = { | |
| ids: string[]; | |
| }; | |
| export type CrossRequest = { | |
| parent1_id: string; | |
| parent2_id: string; | |
| n?: number; | |
| summary_only?: boolean; | |
| }; | |
| export type BreedRequest = { | |
| parent1_id: string; | |
| parent2_id: string; | |
| }; | |
| export type BreedResponse = { | |
| ok: true; | |
| offspring_id: string; | |
| }; | |
| export type CloneRequest = { | |
| seed_id: string; | |
| }; | |
| export type CloneResponse = { | |
| ok: true; | |
| clone_id: string; | |
| }; | |
| export type LabResponse = LabPayload; | |
| export type PredictCrossResponse = CrossPrediction; | |
| export type DeckSummaryResponse = DeckSummary; | |
| export type BusSignalsResponse = { | |
| available: boolean; | |
| count: number; | |
| task_list: BusInbox['task_list']; | |
| signals: BusInbox['signals']; | |
| }; | |
| export type BusReceiptsResponse = { | |
| receipts: BusReceipt[]; | |
| }; | |