import { type BatchResponse, type Channel, type CreateChannelArgs, type Group, TwistApi, type User, type Workspace, type WorkspaceUser } from '@doist/twist-sdk'; export declare function createWrappedTwistClient(token: string): TwistApi; export declare function getTwistClient(): Promise; export declare function fetchWorkspaces(): Promise; export declare function clearWorkspaceCache(): void; export declare function getCurrentWorkspaceId(flagValue?: number): Promise; export declare function getSessionUser(): Promise; export declare function getWorkspaceUsers(workspaceId: number, options?: { includeRemoved?: boolean; }): Promise; export declare function getWorkspaceGroups(workspaceId: number): Promise; export declare function getGroup(id: number): Promise; export declare function createGroup(args: { workspaceId: number; name: string; userIds?: number[]; }): Promise; export declare function updateGroup(args: { id: number; name?: string; }): Promise; export declare function deleteGroup(id: number): Promise; export declare function addUsersToGroup(id: number, userIds: number[]): Promise; export declare function removeUsersFromGroup(id: number, userIds: number[]): Promise; export declare function createChannel(args: CreateChannelArgs): Promise; export declare function deleteChannel(id: number): Promise; export declare function archiveChannel(id: number): Promise; export declare function unarchiveChannel(id: number): Promise; export declare function addUsersToChannel(id: number, userIds: number[]): Promise; export declare function removeUsersFromChannel(id: number, userIds: number[]): Promise; export declare function clearUserCache(): void; type BatchResult = Pick, 'code' | 'data'>; /** * Validates a batch response and returns the data, throwing on errors. * Also handles the case where the SDK fails to validate the response schema * (e.g. when the batch API wraps entities in a key like `{comment: {...}}`). * In that case, the raw transformed data is returned — check for expected fields. */ export declare function assertBatchData(response: BatchResult, label: string): T; export declare function buildBatchNameMap(ids: readonly number[], responses: readonly BatchResult[], label: string): Map; /** * Like `assertBatchData` but tolerates a null `data` with a success code as a * valid empty state (e.g. `getUnread` returning null when there are no unread * threads). Real API errors (`code >= 400`) still throw. Returns `null` when * the response is a success-but-empty so the caller can fall back (e.g. `?? []`). */ export declare function getOptionalBatchData(response: BatchResult, label: string): T | null; /** * Like `buildBatchNameMap` but skips entries whose `data` is null with a success * code (e.g. a user that no longer exists). Real API errors (`code >= 400`) still * throw via `assertBatchData`. Callers should provide a fallback for missing keys. */ export declare function buildOptionalBatchNameMap(ids: readonly number[], responses: readonly BatchResult[], label: string): Map; export type { Channel, Group, User, Workspace, WorkspaceUser }; //# sourceMappingURL=api.d.ts.map