import { type ByteWindow } from '../../utils/ranges.ts'; import { TokenManager as OAuthTokenManager } from '../api/oauth.ts'; export interface BoxConfig { endpoint?: string; clientId?: string; clientSecret?: string; refreshToken?: string; enterpriseId?: string; accessToken?: string; refreshFn?: (refreshToken: string) => Promise<{ accessToken: string; refreshToken: string; expiresIn: number; }>; onRefreshTokenRotated?: (newRefreshToken: string) => void | Promise; } export declare class BoxApiError extends Error { readonly status: number; constructor(message: string, status: number); } export declare class BoxTokenManager extends OAuthTokenManager { readonly apiBase: string; private readonly config; private readonly devTokenMode; private readonly ccgMode; private currentRefreshToken; constructor(config: BoxConfig); /** * Returns the latest refresh token. Box rotates the refresh token on each * refresh, so the token passed to the constructor may be stale after the * first refresh. Persist this value if you want to survive restarts without * re-authenticating. Returns empty string in developer-token and * client-credentials modes. */ getRefreshToken(): string; protected refreshPair(): Promise<[string, number]>; } export declare function boxGet(tm: BoxTokenManager, url: string, params?: Record): Promise; export declare function boxGetBytes(tm: BoxTokenManager, url: string, params?: Record, window?: ByteWindow): Promise; export declare function boxGetStream(tm: BoxTokenManager, url: string, params?: Record): AsyncIterable; export declare function boxPostJson(tm: BoxTokenManager, url: string, body: Record): Promise; export declare function boxPutJson(tm: BoxTokenManager, url: string, body: Record): Promise; export declare function boxDelete(tm: BoxTokenManager, url: string, params?: Record): Promise; export declare function boxUploadMultipart(tm: BoxTokenManager, url: string, attributes: Record, filename: string, data: Uint8Array): Promise; //# sourceMappingURL=client.d.ts.map