synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
54 lines • 2.81 kB
TypeScript
import { EntityType } from '@sage-bionetworks/synapse-client';
import { GetProjectsParameters, Reference, SearchQuery } from '@sage-bionetworks/synapse-types';
import { Dispatch, SetStateAction } from 'react';
import { EntityFinderHeader } from '../EntityFinderHeader';
import { EntityTreeContainer } from '../tree/EntityTree';
import { EntitySelectionMapType } from '../useEntitySelection';
import { VersionSelectionType } from '../VersionSelectionType';
import { DetailsViewColumn } from './view/DetailsView';
export declare enum EntityDetailsListDataConfigurationType {
REFERENCE_LIST = 0,// Provide references to show in the DetailsList. Incompatible with pagination
HEADER_LIST = 1,// simply displays one or more entity headers. incompatible with pagination
PARENT_CONTAINER = 2,// retrieve the children for a given entity ID
USER_PROJECTS = 3,// retrieve the user's projects (using the parameters)
USER_FAVORITES = 4,// retrieve the user's favorites (using the parameters)
ENTITY_SEARCH = 5,// Search for an entity
PROMPT = 6
}
export type EntityDetailsListDataConfiguration = {
type: EntityDetailsListDataConfigurationType;
/** Defined if type is REFERENCE_LIST */
referenceList?: Reference[];
/** Defined if type is HEADER_LIST */
headerList?: Pick<EntityFinderHeader, 'id' | 'name' | 'type'>[];
/** Defined if type is PARENT_CONTAINER */
parentContainerId?: string;
/** Defined if type is USER_PROJECTS */
getProjectParams?: GetProjectsParameters;
/** Defined if type is ENTITY_SEARCH */
query?: SearchQuery;
};
/**
* These props are set by a parent to this component, but they are not affected by the configuration.
* We collect them into this type to simplify passing them through to the view.
*/
export type EntityDetailsListSharedProps = {
versionSelection: VersionSelectionType;
selectColumnType: 'checkbox' | 'none';
enableSelectAll: boolean;
visibleTypes: EntityType[];
selected: EntitySelectionMapType;
selectableTypes: EntityType[];
isIdSelected: (header: EntityFinderHeader) => boolean;
isSelectable: (header: EntityFinderHeader) => boolean;
toggleSelection: (entity: Reference | Reference[]) => void;
setInitialVersion: (entityId: string, version: number) => void;
setCurrentContainer?: Dispatch<SetStateAction<EntityTreeContainer>>;
/** Chosen columns to hide. Defaults to just the DirectDownload column. */
hiddenColumns?: DetailsViewColumn[];
};
export type EntityDetailsListProps = EntityDetailsListSharedProps & {
configuration: EntityDetailsListDataConfiguration;
};
export declare function EntityDetailsList({ configuration, ...sharedProps }: EntityDetailsListProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=EntityDetailsList.d.ts.map