Reorganize frontend and install Craco to alias modules (#190)
This commit is contained in:
26
front/src/modules/search/interfaces/interface.ts
Normal file
26
front/src/modules/search/interfaces/interface.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { DocumentNode } from 'graphql';
|
||||
|
||||
import {
|
||||
AnyEntity,
|
||||
BoolExpType,
|
||||
GqlType,
|
||||
UnknownType,
|
||||
} from '@/utils/interfaces/generic.interface';
|
||||
|
||||
export type SearchConfigType<
|
||||
SearchType extends AnyEntity | UnknownType = UnknownType,
|
||||
> = SearchType extends UnknownType
|
||||
? {
|
||||
query: DocumentNode;
|
||||
template: (searchInput: string) => any;
|
||||
resultMapper: (data: any) => any;
|
||||
}
|
||||
: {
|
||||
query: DocumentNode;
|
||||
template: (searchInput: string) => BoolExpType<SearchType>;
|
||||
resultMapper: (data: GqlType<SearchType>) => {
|
||||
value: SearchType;
|
||||
render: (value: SearchType) => ReactNode;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user