import type { GraphQLClient } from '../client.js'; import { type UserAvatarsQuery, type AvatarByIdQuery, type MyAvatarsQuery, type AvatarAppStateQuery, type AvatarAppStatesQuery, type CreateAvatarMutation, type UpdateAvatarMutation, type DeleteAvatarMutation, type UpdateAvatarStateMutation, type UpdateAvatarAppStateMutation, type CreateAvatarInput, type UpdateAvatarInput, type UpdateAvatarStateInput, type UpdateAvatarAppStateInput } from '../generated/graphql.js'; /** * Avatars + per-app avatar state — exposed as `client.avatars`. * * Targets the **game-api**. Avatars are durable player identities (distinct * from realtime actors). Reads are owner-aware: non-owners receive * `privateState` stripped to `null`. Create/update/delete and state writes are * owner-exclusive (throw on a non-owner). All require a valid session; state * blobs are base64-encoded binary; `BigInt` ids are decimal strings. * * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` without a session; an * authorization error when writing an avatar you do not own. */ export declare class AvatarsAPI { private readonly graphql; constructor(graphql: GraphQLClient); /** * List a user's avatars (owner-aware: `privateState` stripped for non-owners). * * @param userId - Owner user id. * @returns The user's avatars. */ listForUser(userId: string): Promise; /** * Fetch one avatar by id (owner-aware). Throws if it does not exist. * * @param id - Avatar id. * @returns The avatar. */ get(id: string): Promise; /** * List the authenticated caller's own avatars (full state included). * * @returns The caller's avatars. */ mine(): Promise; /** * Read one avatar's per-app state (public read). Returns `null` when unset. * * @param appId - App id the state is scoped to. * @param avatarId - Avatar id whose per-app state to read. * @returns The per-app state, or `null`. */ appState(appId: string, avatarId: string): Promise; /** * Batch-read per-app state for many avatars under one app (public read). * * @param appId - App id the states are scoped to. * @param avatarIds - Avatar ids to fetch. * @returns The per-app states (avatars with no row are omitted). */ appStates(appId: string, avatarIds: string[]): Promise; /** * Create a new avatar owned by the caller. * * @param input - {@link CreateAvatarInput} (optional `name`). * @returns The created avatar. */ create(input: CreateAvatarInput): Promise; /** * Update an avatar's mutable fields (owner-exclusive). * * @param id - Avatar id. * @param input - {@link UpdateAvatarInput} fields to change. * @returns The updated avatar. */ update(id: string, input: UpdateAvatarInput): Promise; /** * Permanently delete an avatar (owner-exclusive). Returns the deleted row. * * @param id - Avatar id. * @param idempotencyKey - Optional idempotency key for safe retries. * @returns The now-deleted avatar. */ delete(id: string, idempotencyKey?: string): Promise; /** * Replace an avatar's public/private state blobs (owner-exclusive). * * @param id - Avatar id. * @param input - {@link UpdateAvatarStateInput} (base64 blobs). * @returns The updated avatar. */ updateState(id: string, input: UpdateAvatarStateInput): Promise; /** * Create/replace an avatar's per-app state (owner-exclusive write, public * read). * * @param input - {@link UpdateAvatarAppStateInput} (appId, avatarId, state). * @returns The upserted per-app state. */ updateAppState(input: UpdateAvatarAppStateInput): Promise; } //# sourceMappingURL=avatars.d.ts.map