import type { GameAppsAPI } from '../domains/gameApps.js'; import type { GameModelAPI } from '../domains/gameModel.js'; import type { Scalars, SeedPropertyInput } from '../generated/graphql.js'; import { type KitInvokeResult } from './shared.js'; /** Options for {@link PlotsKit}. Must match the deployed plot blueprint. */ export interface PlotsKitOptions { /** The `typeName` the plot blueprint was deployed with. Defaults to `'Plot'`. */ typeName?: string; } /** A parsed view of one plot. */ export interface KitPlot { containerId: string; displayName: string; gridId: number; price: number; /** * 0 when unowned. Parsed numerically for both owner-mirror kinds: with * `ownerIdKind: 'string'` blueprints the stored decimal string converts, * and the for-sale sentinel `""` parses to 0. */ ownerUserId: number; rentPrice?: number; rentTtlSeconds?: number; } /** * Runtime helpers for the {@link plotBlueprint} conventions: list/create * plots and drive the buy/rent/evict functions whose permission effects grant * or revoke real, replication-enforced grid permissions transactionally with * the currency mutation. Authorization (wallet ownership, price, plot * ownership) is enforced server-side — a denial resolves with * `success: false`, never an exception. * * Obtained via `client.kit(appId).plots`. */ export declare class PlotsKit { private readonly appId; private readonly gameModel; private readonly gameApps; private readonly names; constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, gameApps: GameAppsAPI, options?: PlotsKitOptions); /** * Instantiate a plot over an existing grid (admin — the type is * admin-instantiable). Create the grid first (`client.gameApps.createGrid`) * and pass its id here. */ create(input: { displayName: string; gridId: Scalars['BigInt']['input']; price: number; rentPrice?: number; rentTtlSeconds?: number; properties?: SeedPropertyInput[]; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** List plots with parsed state (grid, price, current owner). */ list(): Promise; /** * Buy a plot: spends the price from the caller's wallet AND grants the * blueprint's grid permissions in one transaction. Resolves with the * wallet's remaining balance. */ buy(plotId: string, walletId: string): Promise>; /** * Rent a plot (blueprint deployed with `rentable: true`): like {@link buy} * but the grant expires after the plot's `rent_ttl_seconds`. */ rent(plotId: string, walletId: string): Promise>; /** Revoke a user's permissions on a plot (plot owner or app admin). */ evict(plotId: string, targetUserId: Scalars['BigInt']['input']): Promise; /** * A user's effective permission keys on a plot's grid (for HUD display — * enforcement happens server-side regardless). */ accessOf(userId: Scalars['BigInt']['input'], gridId: Scalars['BigInt']['input']): Promise; } //# sourceMappingURL=plots.d.ts.map