import type { GameModelAPI } from '../domains/gameModel.js'; import type { Scalars, SeedPropertyInput } from '../generated/graphql.js'; import { type KitInvokeResult } from './shared.js'; /** Options for {@link ObjectsKit}. Must match the deployed lock blueprint. */ export interface ObjectsKitOptions { /** The `objectTypeName` the lock blueprint was deployed with. Defaults to `'Lockable'`. */ objectTypeName?: string; /** The `keyTypeName` the lock blueprint was deployed with. */ keyTypeName?: string; } /** * Runtime helpers for the {@link lockBlueprint} conventions: instantiate * lockable world objects, grant key items, and operate the objects through * their authority-gated `open`/`close` functions. Authorization is decided * entirely server-side; a denied attempt resolves with `success: false`. * * Obtained via `client.kit(appId).objects` (or `client.kit(appId) * .objectsFor('Door')` for a non-default type name). */ export declare class ObjectsKit { private readonly appId; private readonly gameModel; private readonly names; constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: ObjectsKitOptions); /** * Instantiate a lockable object (admin/studio call — the type is * admin-instantiable). For key-gated objects set `requiredKeyId` to the key * id that opens it; for owner-gated objects set `ownerUserId`; for * chunk-permission-gated objects set `chunk` to where the object stands * (feeds the `has_chunk_permission` policy). */ create(input: { displayName: string; requiredKeyId?: string; ownerUserId?: Scalars['BigInt']['input']; /** The chunk the object occupies (chunkPermission authority). */ chunk?: { x: number; y: number; z: number; }; properties?: SeedPropertyInput[]; sessionId?: string; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** * Grant a player a key item (admin/studio call). Creates a key container * owned by the player, with the owner mirrored into the `owner_user_id` * property that the key condition policy reads. */ grantKey(input: { keyId: string; toUserId: Scalars['BigInt']['input']; displayName?: string; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** List the key items a player holds. */ keysOf(userId: Scalars['BigInt']['input']): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }[]>; /** * Try to open an object. Pass `keyId` (the **container id** of a key the * caller holds) when the object is key-gated; owner/grid/group authorities * need no params. A denial is not an exception — check `success`. */ open(objectId: string, options?: { keyId?: string; }): Promise>; /** Try to close an object; same authority as {@link open}. */ close(objectId: string, options?: { keyId?: string; }): Promise>; /** Read whether an object is currently open. */ isOpen(objectId: string): Promise; /** List all objects of this lockable type. */ list(options?: { sessionId?: string; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }[]>; } //# sourceMappingURL=objects.d.ts.map