import React from 'react';
import { IJaenConnection } from '../../types';
import { IJaenPageProps } from './types';
/**
* @function connectPage Connects a gatsby page with Jaen.
*
* @see {@link connectTemplate} for more information.
*
* Warning: This component must be used to wrap a page, not a template.
*/
export declare const connectPage:
(Component: React.ComponentType
, options: {
displayName: string;
children?: string[];
}) => IJaenConnection
;
export type IPageConnection = ReturnType;
/**
* @function connectTemplate Connects a gatsby template with Jaen.
*
* @param Component The template page to wrap
* @param {JaenTemplateOptions} templateOptions Configuration for the page
*
* Warning: This component must be used in conjunction with the graphql`
* query($jaenPageId: String!) {
* ...JaenPageData
* }
* ``
*
* @example
* ```
* export default connectTemplate(
* p => {
* return (
* <>
* Blog
* {JSON.stringify(p)}
* >
* )
* },
* {
* displayName: 'Simple Blog Page'
* }
* )
*
* export const query = graphql`
* query($jaenPageId: String!) {
* ...JaenPageData
* }
* `
* ```
*/
export declare const connectTemplate: (Component: React.ComponentType
, options: ITemplateOptions) => IJaenConnection
;
export type ITemplateOptions = {
displayName: string;
children: Array;
isRootTemplate?: boolean;
};
export type ITemplateConnection = ReturnType;
export type ISectionOptions = {
displayName: string;
name: string;
};
/**
* @function connectSection Connects a section with Jaen.
*
* @param Component The component to wrap
*/
export declare const connectSection: (Component: React.ComponentType
, options: ISectionOptions) => IJaenConnection
;
export type ISectionConnection = ReturnType;
export interface JaenFieldProps {
name: string;
displayName?: string;
defaultValue: IDefaultValue;
style?: React.CSSProperties;
className?: string;
}
export interface FieldOptions {
fieldType: string;
getAdminWidget?: (props: {
field: {
defaultValue: IDefaultValue;
value: IValue;
onChange: (value: IValue) => void;
name: string;
};
} & IProps) => JSX.Element;
}
/**
* @function connectField - Connects a field to Jaen.
*
* @param Component The component to wrap
*
* @example
* ```
* const T = connectField(props => {
* const {name, defaultValue, style, className} = props.jaenField
* return null
* })
* ```
*/
export declare const connectField: (Component: React.ComponentType & {
staticValue?: IValue | undefined;
value?: IValue | undefined;
isEditing: boolean;
onUpdateValue: (value: IValue) => void;
};
}>>, options: FieldOptions) => React.NamedExoticComponent>;
export type IFieldConnection = ReturnType;