UNPKG

@chayns-components/person-finder

Version:

A set of beautiful React components for developing your own applications with chayns.

35 lines (34 loc) 1.59 kB
import React, { Dispatch, FC, ReactNode, SetStateAction } from 'react'; import { DefaultEntry, LoadingState, LoadingStateMap, PersonEntry, PersonFinderData, PersonFinderEntry, PersonFinderFilterTypes, Priority, UACFilter } from '../types/personFinder'; import { Tag } from '@chayns-components/core/lib/types/types/tagInput'; interface IPersonFinderContext { data?: { [key: string]: PersonFinderData; }; updateData?: (key: PersonFinderFilterTypes, personFinderData: PersonFinderData) => void; tags?: Tag[]; setTags?: Dispatch<SetStateAction<Tag[]>>; friends?: PersonEntry[]; addFriend?: (personId: string) => void; removeFriend?: (personId: string) => void; activeFilter?: PersonFinderFilterTypes[]; updateActiveFilter?: (filter: PersonFinderFilterTypes[]) => void; search?: string; updateSearch?: (value: string) => void; loadMore?: (key: PersonFinderFilterTypes) => void; loadingState?: LoadingStateMap; updateLoadingState?: (key: PersonFinderFilterTypes, state: LoadingState) => void; } export declare const PersonFinderContext: React.Context<IPersonFinderContext>; export declare const usePersonFinder: () => IPersonFinderContext; type PersonFinderProviderProps = { children: ReactNode; friendsPriority: Priority; filterTypes: PersonFinderFilterTypes[]; defaultEntries?: DefaultEntry[]; excludedEntryIds?: PersonFinderEntry['id'][]; shouldShowOwnUser?: boolean; uacFilter?: UACFilter[]; }; declare const PersonFinderProvider: FC<PersonFinderProviderProps>; export default PersonFinderProvider;