import React from 'react'; import type { DocumentLiveState, RolePermissions, UnpublishDocumentOptions } from '@pantheon-systems/css-client'; import type { RedirectTarget } from '../utils/unpublishRedirectTargets.js'; import type { UnpublishChildPages } from '../utils/unpublishChildPages.js'; export interface PublishControlLiveProps { loading: boolean; /** `null` when the page has never been published; `undefined` when unknown, which hides the status line. */ lastPublishedAt?: Date | null; /** When the page was last unpublished from live, while it is still down. */ unpublishedAt?: string; changeCount: number; siteUrl: string; onPublish: () => Promise; onReview?: () => void; } export interface PublishControlProps { context: 'main' | 'branch'; permissions?: RolePermissions | null; mainPermissions?: RolePermissions | null; mainPermissionsError?: boolean; /** Disables the Publish/Go-live actions, e.g. while previewing a read-only historical version. */ disabled?: boolean; live?: PublishControlLiveProps; onGoLive?: () => void; onGoLivePage?: () => void; onCreateWorkstream?: () => void; onDeleteDocument?: () => Promise | void; /** * Unpublishes the open page from live, sending its visitors to `redirectTo` when given. Offered on Live only. * `options` carries `redirectTo` too, so it can be passed to `documents.unpublish` as it is. */ onUnpublish?: (redirectTo?: string, options?: UnpublishDocumentOptions) => Promise; /** Pages the confirmation offers as the redirect target; the first is preselected. */ redirectTargets?: RedirectTarget[]; /** The live pages under the open page, which the confirmation offers to take down too. */ childPages?: UnpublishChildPages; /** Whether the open page is live. Unpublish is hidden until this is known. */ liveState?: DocumentLiveState; /** Path of the open page, shown in the Unpublish confirmation. */ pagePath?: string; /** The site's host, shown before the page's path in the Unpublish confirmation. */ siteHost?: string; } export declare function PublishControl({ context, permissions, mainPermissions, mainPermissionsError, disabled, live, onGoLive, onGoLivePage, onCreateWorkstream, onDeleteDocument, onUnpublish, redirectTargets, childPages, liveState, pagePath, siteHost, }: PublishControlProps): React.ReactElement;