Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Search): type definition for layout renderer #4309

Merged
merged 4 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/modules/Search/Search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { InputProps } from '../../elements/Input'
import SearchCategory, { SearchCategoryProps } from './SearchCategory'
import SearchResult, { SearchResultProps } from './SearchResult'
import SearchResults from './SearchResults'
import { SearchCategoryLayoutProps } from './SearchCategoryLayout'

export interface SearchProps extends StrictSearchProps {
[key: string]: any
Expand Down Expand Up @@ -61,11 +62,10 @@ export interface StrictSearchProps {
/**
* Renders the SearchCategory layout.
*
* @param {object} categoryContent - The Renderable SearchCategory contents.
* @param {object} resultsContent - The Renderable SearchResult contents.
* @param {object} props - The SearchCategoryLayout props object.
* @returns {*} - Renderable SearchCategory layout.
*/
categoryLayoutRenderer?: (props: SearchCategoryProps) => React.ReactElement<any>
categoryLayoutRenderer?: (props: SearchCategoryLayoutProps) => React.ReactElement<any>
layershifter marked this conversation as resolved.
Show resolved Hide resolved

/**
* Renders the SearchCategory contents.
Expand Down
9 changes: 3 additions & 6 deletions src/modules/Search/SearchCategory.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'

import { SemanticShorthandContent } from '../../generic'
import { SearchCategoryLayoutProps } from './SearchCategoryLayout'
import SearchResult from './SearchResult'

export interface SearchCategoryProps extends StrictSearchCategoryProps {
Expand Down Expand Up @@ -29,14 +30,10 @@ export interface StrictSearchCategoryProps {
/**
* Renders the SearchCategory layout.
*
* @param {object} categoryContent - The Renderable SearchCategory contents.
* @param {object} resultsContent - The Renderable SearchResult contents.
* @param {object} props - The SearchCategoryLayout props object.
* @returns {*} - Renderable SearchCategory layout.
*/
layoutRenderer?: (
categoryContent: React.ReactElement<any>,
resultsContent: React.ReactElement<any>,
) => React.ReactElement<any>
layoutRenderer?: (props: SearchCategoryLayoutProps) => React.ReactElement<any>
layershifter marked this conversation as resolved.
Show resolved Hide resolved

/**
* Renders the category contents.
Expand Down