From e030d2140c5216ca5824fec7aa78ecf9656c7f7c Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Thu, 26 Oct 2017 13:38:50 -0400 Subject: [PATCH] react-autosuggest change theme to allow inline styles --- types/react-autosuggest/index.d.ts | 22 +++++-------------- .../react-autosuggest-tests.tsx | 3 ++- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/types/react-autosuggest/index.d.ts b/types/react-autosuggest/index.d.ts index 9205f63d4c..2d0034fd46 100644 --- a/types/react-autosuggest/index.d.ts +++ b/types/react-autosuggest/index.d.ts @@ -9,6 +9,7 @@ // TypeScript Version: 2.3 import * as React from 'react'; + declare class Autosuggest extends React.Component {} export = Autosuggest; @@ -57,22 +58,11 @@ declare namespace Autosuggest { method: 'click' | 'enter'; } - interface Theme { - container?: string; - containerOpen?: string; - input?: string; - inputOpen?: string; - inputFocused?: string; - suggestionsContainer?: string; - suggestionsContainerOpen?: string; - suggestionsList?: string; - suggestion?: string; - suggestionFirst?: string; - suggestionHighlighted?: string; - sectionContainer?: string; - sectionContainerFirst?: string; - sectionTitle?: string; - } + type ThemeKey = 'container' | 'containerOpen' | 'input' | 'inputOpen' | 'inputFocused' | 'suggestionsContainer' | + 'suggestionsContainerOpen' | 'suggestionsList' | 'suggestion' | 'suggestionFirst' | 'suggestionHighlighted' | + 'sectionContainer' | 'sectionContainerFirst' | 'sectionTitle'; + + type Theme = Partial>; interface AutosuggestProps extends React.Props { suggestions: any[]; diff --git a/types/react-autosuggest/react-autosuggest-tests.tsx b/types/react-autosuggest/react-autosuggest-tests.tsx index c67a5c72ad..23841519e4 100644 --- a/types/react-autosuggest/react-autosuggest-tests.tsx +++ b/types/react-autosuggest/react-autosuggest-tests.tsx @@ -85,7 +85,8 @@ export class ReactAutosuggestBasicTest extends React.Component { const theme = { input: 'themed-input-class', container: 'themed-container-class', - suggestionFocused: 'active' + suggestionFocused: 'active', + sectionTitle: { color: 'blue' } }; return