import { FolderCtx } from '../views/folder'; import { BaseFormProps } from '../forms/base'; import { default as React } from 'react'; import { GuillotinaCommonObject, ItemColumn, RegistrySchema, SearchOrCommonObject } from '../types/guillotina'; import { MessageDescriptor } from 'react-intl'; import { Traversal } from '../contexts'; export interface RegistrySortValue { direction: 'asc' | 'des'; key: string; } export interface RegistryProperties { Buttons: React.ReactElement<{ Ctx?: Traversal; }>; Panels: React.ReactElement<{ Ctx?: Traversal; }>; default: string[]; ignoreField: string[]; } export interface IRegistry { paths: { [key: string]: React.FC; }; views: { [key: string]: React.ComponentType; }; actions: { [key: string]: (props: any) => React.ReactElement; }; forms: { [key: string]: (props: any) => React.ReactElement; }; behaviors: { [key: string]: (props: any | undefined) => React.ReactElement | null; }; itemsColumn: { [key: string]: () => ItemColumn[]; }; schemas: { [key: string]: RegistrySchema; }; properties: { [key: string]: RegistryProperties; }; components: { [key: string]: (props: any) => React.ReactNode | null | undefined; }; searchEngineQueryParamsFunction: { [key: string]: string; }; fieldsToFilter: { [key: string]: string[]; }; parseSearchQueryParamFunction: { [key: string]: (query: string, type: string) => string; }; defaultSortValue: { [key: string]: RegistrySortValue; }; actionsList: { [key: string]: (multiple: boolean) => { [key: string]: { text: MessageDescriptor; perms: string[]; action: string; }; }; }; } export interface IManageRegistry { registry: IRegistry; getPathComponent: (context: GuillotinaCommonObject | undefined, path: string, fallback?: React.FC) => React.ComponentType; getComponent: (name: string) => React.ComponentType; getView: (name: string) => React.ComponentType; getForm: (type: string, fallback?: React.FC) => React.FC; getAction: (type: string, fallback?: React.FC) => React.FC; getBehavior: (type: string, fallback?: React.FC) => React.FC; getProperties: (type: string) => RegistryProperties; getItemsColumn: (type: string) => ItemColumn[] | undefined; getSchemas: (type: string) => RegistrySchema; getFieldsToFilter: (type: string, fallback?: string[]) => string[]; getParsedSearchQueryParam: (query: string, type: string) => string; getDefaultSortValue: (type: string, fallback?: RegistrySortValue) => RegistrySortValue; getSearchEngineQueryParamsFunction: (type: string) => string; getActionsList: (type: string, multiple: boolean) => { [key: string]: { text: MessageDescriptor; perms: string[]; action: string; }; }; } export declare const defaultComponent: (context: GuillotinaCommonObject) => typeof FolderCtx; export declare function useRegistry(data: Partial): IManageRegistry;