///
import { Cursor } from '@staticcms/core/lib/util';
import AssetProxy from '@staticcms/core/valueObjects/AssetProxy';
import type { BackendClass, BackendEntry, ConfigWithDefaults, DataFile, DisplayURL, ImplementationEntry, ImplementationFile, ImplementationMediaFile, PersistOptions, UnpublishedEntry, User } from '@staticcms/core';
import type { WorkflowStatus } from '@staticcms/core/constants/publishModes';
type RepoFile = {
path: string;
content: string | AssetProxy;
isDirectory?: boolean;
};
type RepoTree = {
[key: string]: RepoFile | RepoTree;
};
type Diff = {
id: string;
originalPath?: string;
path: string;
newFile: boolean;
status: string;
content: string | AssetProxy;
};
type UnpublishedRepoEntry = {
slug: string;
collection: string;
status: WorkflowStatus;
diffs: Diff[];
updatedAt: string;
};
declare global {
interface Window {
repoFiles: RepoTree;
repoFilesUnpublished: {
[key: string]: UnpublishedRepoEntry;
};
}
}
export declare function getFolderFiles(tree: RepoTree, folder: string, extension: string, depth: number, files?: RepoFile[], path?: string, includeFolders?: boolean): RepoFile[];
export default class TestBackend implements BackendClass {
mediaFolder?: string;
options: {
initialWorkflowStatus?: string;
};
constructor(config: ConfigWithDefaults, options?: {});
status(): Promise<{
auth: {
status: boolean;
};
api: {
status: boolean;
statusPage: string;
};
}>;
authComponent(): import("react").FC;
restoreUser(): Promise;
authenticate(): Promise;
logout(): null;
getToken(): Promise;
traverseCursor(cursor: Cursor, action: string): Promise<{
entries: {
data: string;
file: {
path: string;
id: string;
};
}[];
cursor: Cursor;
}>;
entriesByFolder(folder: string, extension: string, depth: number): Promise<{
data: string;
file: {
path: string;
id: string;
};
}[]>;
entriesByFiles(files: ImplementationFile[]): Promise<{
file: ImplementationFile;
data: string;
}[]>;
getEntry(path: string): Promise<{
file: {
path: string;
id: null;
};
data: string;
}>;
persistEntry(entry: BackendEntry, options: PersistOptions): Promise;
getMedia(mediaFolder?: string | undefined, folderSupport?: boolean): Promise;
getMediaFile(path: string): Promise<{
id: string;
displayURL: string;
path: string;
name: string;
size: number;
url: string;
}>;
normalizeAsset(assetProxy: AssetProxy): ImplementationMediaFile;
persistMedia(assetProxy: AssetProxy): Promise;
deleteFiles(paths: string[]): Promise;
allEntriesByFolder(folder: string, extension: string, depth: number): Promise;
getMediaDisplayURL(_displayURL: DisplayURL): Promise;
/**
* Editorial Workflow
*/
unpublishedEntries(): Promise;
unpublishedEntry({ id, collection, slug, }: {
id?: string;
collection?: string;
slug?: string;
}): Promise;
unpublishedEntryDataFile(collection: string, slug: string, path: string): Promise;
unpublishedEntryMediaFile(collection: string, slug: string, path: string): Promise;
deleteUnpublishedEntry(collection: string, slug: string): Promise;
addOrUpdateUnpublishedEntry(key: string, dataFiles: DataFile[], assetProxies: AssetProxy[], slug: string, collection: string, status: WorkflowStatus): Promise;
updateUnpublishedEntryStatus(collection: string, slug: string, newStatus: WorkflowStatus): Promise;
publishUnpublishedEntry(collection: string, slug: string): Promise;
getDeployPreview(): Promise;
}
export {};