import { type EntityQueryRequest, type EntityServerClientOptions } from "../index.js"; export interface UseEntityServerOptions extends EntityServerClientOptions { singleton?: boolean; tokenResolver?: () => string | undefined | null; /** * 페이지 새로고침 후 로그인 상태를 복원할 때 사용합니다. * 값 자체는 더 이상 사용하지 않고, 값이 있으면 마운트 시 `client.checkHealth(true)`로 * refresh 쿠키 기반 세션 부트스트랩을 시도합니다. */ resumeSession?: string; } /** useEntityClient가 요구하는 최소 클라이언트 인터페이스 */ export interface EntityClientShape { configure(options: Partial): void; setToken(token: string): void; checkHealth?: (bootstrapAuth?: boolean) => Promise; refreshToken(refreshToken?: string): Promise; submit(entity: string, data: Record, opts?: { transactionId?: string; skipHooks?: boolean; }): Promise<{ ok: boolean; seq: number; }>; delete(entity: string, seq: number, opts?: { transactionId?: string; hard?: boolean; skipHooks?: boolean; }): Promise<{ ok: boolean; deleted: number; }>; query(entity: string, req: EntityQueryRequest): Promise<{ ok: boolean; data: { items: T[]; count: number; }; }>; } type ClientConstructor = new (options?: EntityServerClientOptions) => TClient; export interface UseEntityClientResult { client: TClient; isPending: boolean; error: Error | null; reset: () => void; submit: (entity: string, data: Record, opts?: { transactionId?: string; skipHooks?: boolean; }) => Promise<{ ok: boolean; seq: number; }>; del: (entity: string, seq: number, opts?: { transactionId?: string; hard?: boolean; skipHooks?: boolean; }) => Promise<{ ok: boolean; deleted: number; }>; query: (entity: string, req: EntityQueryRequest) => Promise<{ ok: boolean; data: { items: T[]; count: number; }; }>; } export declare function useEntityClient(options: UseEntityServerOptions, config: { singletonInstance: TClient; ClientClass: ClientConstructor; }): UseEntityClientResult; export {};