export declare function onPublishRefusal(listener: ((body: unknown) => void) | null): void; /** The publish API refused, and said why. */ export declare class StudioPublishError extends Error { readonly statusCode: number; readonly body: unknown; constructor(statusCode: number, message: string, body: unknown); } /** * Was this a failure that asking again could get past? * * No answer at all (the request never got through) and the answers that mean * "not now" -- a timeout, too many requests, a server or gateway error. Every * other status is content answering, and the same request gets the same * answer. */ export declare function isTransientPublishError(error: unknown): boolean; /** * One JSON call through this origin, with the session cookie: its body, or a * `StudioPublishError` carrying the answer's own message. */ export declare function callJson(fetchImpl: typeof fetch, url: string, method: "GET" | "POST", body?: unknown): Promise; /** * One JSON READ through this origin, BY VERSION: `held` is the answer the * caller holds, with its `ETag`, which goes as `If-None-Match`. While the * answer is still that one (a 304, with no body) it is `held` again; * otherwise the new body, `parse`d, with its `ETag` -- `null` when the answer * named none, so there is nothing to hold it by. Errors as {@link callJson} * throws them. */ export declare function readJsonByVersion(fetchImpl: typeof fetch, url: string, held: { etag: string; value: T; } | null, parse: (body: unknown) => T): Promise<{ etag: string | null; value: T; }>;