///
import type { DataCollectionStateMap, DataResolverProps, Editor } from 'grapesjs';
import type { Font, InternalFont, ProjectConfigType } from '../types';
export type AnyObject = Record;
export type StringObject = Record;
export type ValidReactNode = React.ReactNode | (() => React.ReactNode);
export declare enum ProjectType {
web = "web",
email = "email",
document = "document",
react = "react"
}
type PluginOptions = Record;
export declare enum StudioPluginCategory {
components = "Components",
rte = "Rich Text Editor",
canvas = "Canvas",
layout = "Layout",
assetProviders = "Asset Providers"
}
export interface StudioPageSettings {
slug?: string;
title?: string;
favicon?: string;
description?: string;
keywords?: string;
socialTitle?: string;
socialImage?: string;
fonts?: Record;
socialDescription?: string;
customCodeHead?: string;
customCodeBody?: string;
}
export interface InstallablePlugin {
id: string;
src: string;
version: string;
name: string;
description: string;
category: StudioPluginCategory;
projectType: ProjectConfigType[];
image?: string;
options?: PluginOptions;
instructions?: string;
}
export interface StorablePluginProps extends Pick {
}
export type LocalSettingsData = {
plugins?: InstallablePlugin[];
};
export interface ProjectDataCustom {
id?: string;
projectName?: string;
projectType?: ProjectConfigType;
plugins?: StorablePluginProps[];
globalPageSettings?: StudioPageSettings;
}
export interface ProjectData {
[key: string]: any;
custom?: ProjectDataCustom;
}
export interface ProjectItem {
id: string;
name: string;
media?: string;
previewUrl?: string | null;
publishedUrl?: string | null;
author?: {
name: string;
link?: string;
};
isTemplate?: boolean;
data?: ProjectData;
}
export interface BeforeInstallPromptEvent extends Event {
readonly platforms: string[];
readonly userChoice: Promise<{
outcome: 'accepted' | 'dismissed';
platform: string;
}>;
prompt(): Promise;
}
declare global {
interface WindowEventMap {
beforeinstallprompt: BeforeInstallPromptEvent;
}
}
export interface AdditionalDataSources extends DataCollectionStateMap {
}
export type PrimitiveValue = string | Record;
export interface ConnectDataSources {
hasDataResolverValue: boolean;
dataResolverValue?: string;
enableDataValue: boolean;
initialDataValue: DataResolverProps | PrimitiveValue;
handleDataValueChange: (value: DataResolverProps) => void;
handleValueClear: () => void;
additionalSources?: AdditionalDataSources;
editor: Editor;
}
export {};