import type { PropsWithChildren } from "react"; import type { AutoSaveIndicatorProps, BaseKey, MutationMode } from "@refinedev/core"; export type ActionButtonRenderer> = ((context: { defaultButtons: React.ReactNode; } & TExtraProps) => React.ReactNode) | React.ReactNode; /** * This should be the base type for `List` crud component implementations in UI integrations. */ export type RefineCrudListProps, THeaderButtonProps extends {} = Record, TWrapperProps extends {} = Record, THeaderProps extends {} = Record, TContentProps extends {} = Record, TExtraProps extends {} = {}> = PropsWithChildren<{ /** * Resource name for API data interactions * @default Reads `:resource` from the URL */ resource?: string; /** * Title of the create view * @default Plural of the resource.name */ title?: React.ReactNode; /** * Props for the wrapper component of the view */ wrapperProps?: TWrapperProps; /** * Props for the header component */ headerProps?: THeaderProps; /** * Props for the content wrapper component */ contentProps?: TContentProps; /** * Breadcrumb to be displayed in the header * @default `` */ breadcrumb?: React.ReactNode; /** * Header action buttons to be displayed in the header * @default If `canCreate` is passed `` otherwise `null` */ headerButtons?: ActionButtonRenderer<{ /** * Default `` props */ createButtonProps: TCreateButtonProps | undefined; }>; /** * Additional props to be passed to the wrapper of the header buttons */ headerButtonProps?: THeaderButtonProps; /** * Adds create button * @default If the resource is passed a create component, `true` else `false` */ canCreate?: boolean; /** * Adds props for create button */ createButtonProps?: TCreateButtonProps; }> & TExtraProps; /** * This should be the base type for `Create` crud component implementations in UI integrations. */ export type RefineCrudCreateProps, THeaderButtonProps extends {} = Record, TFooterButtonProps extends {} = Record, TWrapperProps extends {} = Record, THeaderProps extends {} = Record, TContentProps extends {} = Record, TExtraProps extends {} = {}> = PropsWithChildren<{ /** * Resource name for API data interactions * @default Reads `:resource` from the URL */ resource?: string; /** * Title of the create view * @default Create {resource.name} */ title?: React.ReactNode; /** * Props for the wrapper component of the view */ wrapperProps?: TWrapperProps; /** * Props for the header component */ headerProps?: THeaderProps; /** * Props for the content wrapper component */ contentProps?: TContentProps; /** * Breadcrumb to be displayed in the header * @default `` */ breadcrumb?: React.ReactNode; /** * Back button element at the top left of the page */ goBack?: React.ReactNode; /** * Header action buttons to be displayed in the header * @default `null` */ headerButtons?: ActionButtonRenderer; /** * Additional props to be passed to the wrapper of the header buttons */ headerButtonProps?: THeaderButtonProps; /** * Footer action buttons to be displayed in the footer * @default `` */ footerButtons?: ActionButtonRenderer<{ /** * Default `` props */ saveButtonProps: TSaveButtonProps | undefined; }>; /** * Additional props to be passed to the wrapper of the footer buttons */ footerButtonProps?: TFooterButtonProps; /** * Loading state of the component */ isLoading?: boolean; /** * Additional props for the `` component */ saveButtonProps?: TSaveButtonProps; }> & TExtraProps; /** * This should be the base type for `Edit` crud component implementations in UI integrations. */ export type RefineCrudEditProps, TDeleteButtonProps extends {} = Record, THeaderButtonProps extends {} = Record, TFooterButtonProps extends {} = Record, TWrapperProps extends {} = Record, THeaderProps extends {} = Record, TContentProps extends {} = Record, TExtraProps extends {} = {}, TRefreshButtonProps extends {} = Record, TListButtonProps extends {} = Record> = PropsWithChildren<{ /** * Resource name for API data interactions * @default Reads `:resource` from the URL */ resource?: string; /** * Title of the edit view * @default Edit {resource.name} */ title?: React.ReactNode; /** * Props for the wrapper component of the view */ wrapperProps?: TWrapperProps; /** * Props for the header component */ headerProps?: THeaderProps; /** * Props for the content wrapper component */ contentProps?: TContentProps; /** * Breadcrumb to be displayed in the header * @default `` */ breadcrumb?: React.ReactNode; /** * Back button element at the top left of the page */ goBack?: React.ReactNode; /** * Header action buttons to be displayed in the header * @default If `recordItemId` is passed `` otherwise ` ` */ headerButtons?: ActionButtonRenderer<{ /** * Default `` props */ refreshButtonProps: TRefreshButtonProps | undefined; /** * Default `` props */ listButtonProps: TListButtonProps | undefined; }>; /** * Additional props to be passed to the wrapper of the header buttons */ headerButtonProps?: THeaderButtonProps; /** * Footer action buttons to be displayed in the footer * @default If `canDelete` is passed ` ` otherwise `` */ footerButtons?: ActionButtonRenderer<{ /** * Default `` props */ deleteButtonProps: TDeleteButtonProps | undefined; /** * Default `` props */ saveButtonProps: TSaveButtonProps | undefined; }>; /** * Additional props to be passed to the wrapper of the footer buttons */ footerButtonProps?: TFooterButtonProps; /** * To specify a data provider other than default use this property */ dataProviderName?: string; /** * Loading state of the component * @default `false` */ isLoading?: boolean; /** * Adds a `` * @default If the resource has `canDelete` prop it is `true` else `false` */ canDelete?: boolean; /** * Additional props for the `` component */ saveButtonProps?: TSaveButtonProps; /** * Adds properties for `` */ deleteButtonProps?: TDeleteButtonProps; /** * [Determines when mutations are executed](/docs/advanced-tutorials/mutation-mode/) * @default `"pessimistic"`\* */ mutationMode?: MutationMode; /** * The record id for `` */ recordItemId?: BaseKey; /** * Show component on header buttons */ autoSaveProps?: AutoSaveIndicatorProps; }> & TExtraProps; /** * This should be the base type for `Show` crud component implementations in UI integrations. */ export type RefineCrudShowProps, TFooterButtonProps extends {} = Record, TWrapperProps extends {} = Record, THeaderProps extends {} = Record, TContentProps extends {} = Record, TExtraProps extends {} = {}, TEditButtonProps extends {} = Record, TDeleteButtonProps extends {} = Record, TRefreshButtonProps extends {} = Record, TListButtonProps extends {} = Record> = PropsWithChildren<{ /** * Resource name for API data interactions * @default Reads `:resource` from the URL */ resource?: string; /** * Title of the edit view * @default Show {resource.name} */ title?: React.ReactNode; /** * Props for the wrapper component of the view */ wrapperProps?: TWrapperProps; /** * Props for the header component */ headerProps?: THeaderProps; /** * Props for the content wrapper component */ contentProps?: TContentProps; /** * Breadcrumb to be displayed in the header * @default `` */ breadcrumb?: React.ReactNode; /** * Back button element at the top left of the page */ goBack?: React.ReactNode; /** * Header action buttons to be displayed in the header */ headerButtons?: ActionButtonRenderer<{ /** * Default `` props */ editButtonProps: TEditButtonProps | undefined; /** * Default `` props */ deleteButtonProps: TDeleteButtonProps | undefined; /** * Default `` props */ refreshButtonProps: TRefreshButtonProps | undefined; /** * Default `` props */ listButtonProps: TListButtonProps | undefined; }>; /** * Additional props to be passed to the wrapper of the header buttons */ headerButtonProps?: THeaderButtonProps; /** * Footer action buttons to be displayed in the footer * @default `null` */ footerButtons?: ActionButtonRenderer; /** * Additional props to be passed to the wrapper of the footer buttons */ footerButtonProps?: TFooterButtonProps; /** * To specify a data provider other than default use this property */ dataProviderName?: string; /** * Loading state of the component */ isLoading?: boolean; /** * Adds a `` * @default If the resource has `canDelete` prop it is `true` else `false` */ canDelete?: boolean; /** * Adds properties for `` */ deleteButtonProps?: TDeleteButtonProps; /** * Adds a `` * @default If the resource is passed a edit component, `true` else `false` */ canEdit?: boolean; /** * The record id for `` */ recordItemId?: BaseKey; }> & TExtraProps; //# sourceMappingURL=crud.d.ts.map