{"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/DocumentDrawer/types.ts"],"sourcesContent":["import type { Data, DefaultDocumentIDType, FormState, Operation } from 'payload'\nimport type React from 'react'\nimport type { HTMLAttributes } from 'react'\n\nimport type { Props as DrawerProps } from '../Drawer/types.js'\nimport type { DocumentDrawerContextProps } from './Provider.js'\n\nexport type DocumentDrawerProps = {\n readonly AfterFields?: React.ReactNode\n /**\n * The slug of the collection to which the document belongs.\n */\n readonly collectionSlug: string\n readonly disableActions?: boolean\n readonly drawerSlug?: string\n /**\n * The ID of the document to be edited.\n * When provided, will be fetched and displayed in the drawer.\n * If omitted, will render the \"create new\" view for the given collection.\n */\n readonly id?: DefaultDocumentIDType | null\n readonly initialData?: Data\n /**\n * @deprecated\n */\n readonly initialState?: FormState\n readonly overrideEntityVisibility?: boolean\n readonly redirectAfterCreate?: boolean\n readonly redirectAfterDelete?: boolean\n readonly redirectAfterDuplicate?: boolean\n readonly redirectAfterRestore?: boolean\n} & Pick &\n Pick\n\nexport type DocumentTogglerProps = {\n readonly children?: React.ReactNode\n readonly className?: string\n readonly collectionSlug: string\n readonly disabled?: boolean\n readonly drawerSlug?: string\n readonly onClick?: () => void\n readonly operation: Operation\n} & Readonly>\n\nexport type UseDocumentDrawerContext = {\n closeDrawer: () => void\n drawerDepth: number\n drawerSlug: string\n isDrawerOpen: boolean\n openDrawer: () => void\n toggleDrawer: () => void\n}\n\nexport type UseDocumentDrawer = (\n args: Pick,\n) => [\n // drawer\n React.FC<\n {\n children?: React.ReactNode\n } & Omit\n >,\n // toggler\n React.FC<\n {\n children?: React.ReactNode\n } & Omit\n >,\n // context\n UseDocumentDrawerContext,\n]\n"],"mappings":"AAqDA","ignoreList":[]}