From c7b3e4736630f90952642499ce6af81cd518d28c Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 16 Jul 2018 18:28:36 +0300 Subject: [PATCH] chore: remove unused imports after fix in TS@2.9.1 --- src/common-elements/dropdown.ts | 7 ++----- src/common-elements/fields-layout.ts | 8 ++------ src/common-elements/fields.ts | 2 +- src/common-elements/headers.ts | 8 +------- src/common-elements/linkify.ts | 3 +-- src/common-elements/mixins.ts | 4 +--- src/common-elements/panels.ts | 2 +- src/common-elements/samples.tsx | 2 +- src/common-elements/schema.ts | 6 +----- src/common-elements/shelfs.tsx | 6 +----- src/common-elements/tabs.ts | 2 +- src/components/ApiInfo/ApiInfo.tsx | 2 -- src/components/ApiInfo/styled.elements.ts | 8 ++------ src/components/ApiLogo/styled.elements.tsx | 2 +- src/components/Endpoint/styled.elements.ts | 8 ++------ src/components/JsonViewer/JsonViewer.tsx | 2 +- src/components/JsonViewer/style.ts | 3 +-- src/components/Loading/Spinner.svg.tsx | 6 +----- src/components/Markdown/Markdown.tsx | 1 - src/components/Markdown/styled.elements.ts | 9 +-------- src/components/Operation/Operation.tsx | 1 - src/components/OptionsProvider.ts | 1 - src/components/PayloadSamples/styled.elements.ts | 4 ++-- src/components/Redoc/styled.elements.tsx | 8 ++------ src/components/ResponseSamples/ResponseSamples.tsx | 2 +- src/components/Responses/styled.elements.ts | 6 +++--- src/components/SearchBox/styled.elements.tsx | 2 +- src/components/SideMenu/styled.elements.ts | 8 +------- src/components/StoreProvider.ts | 1 - src/services/HistoryService.ts | 2 -- src/services/SearchStore.ts | 2 +- src/services/SpecStore.ts | 3 +-- src/setupTests.ts | 2 +- src/styled-components.ts | 5 ++--- src/utils/test-utils.ts | 2 -- 35 files changed, 37 insertions(+), 103 deletions(-) diff --git a/src/common-elements/dropdown.ts b/src/common-elements/dropdown.ts index 9efce936..f48d8199 100644 --- a/src/common-elements/dropdown.ts +++ b/src/common-elements/dropdown.ts @@ -1,11 +1,8 @@ import * as React from 'react'; import Dropdown from 'react-dropdown'; -import styled, { - ResolvedThemeInterface, - StyledComponentClass, - withProps, -} from '../styled-components'; +import { StyledComponentClass } from 'styled-components'; +import styled, { withProps } from '../styled-components'; export interface DropdownOption { label: string; diff --git a/src/common-elements/fields-layout.ts b/src/common-elements/fields-layout.ts index a1a24cd2..9f6f1c6f 100644 --- a/src/common-elements/fields-layout.ts +++ b/src/common-elements/fields-layout.ts @@ -1,12 +1,8 @@ import { transparentize } from 'polished'; import * as React from 'react'; -import styled, { - extensionsHook, - ResolvedThemeInterface, - StyledComponentClass, - withProps, -} from '../styled-components'; +import styled, { extensionsHook, withProps } from '../styled-components'; + import { deprecatedCss } from './mixins'; export const PropertiesTableCaption = styled.caption` diff --git a/src/common-elements/fields.ts b/src/common-elements/fields.ts index bfcac028..54ed6197 100644 --- a/src/common-elements/fields.ts +++ b/src/common-elements/fields.ts @@ -1,7 +1,7 @@ import { transparentize } from 'polished'; import * as React from 'react'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../styled-components'; +import styled from '../styled-components'; import { PropertyNameCell } from './fields-layout'; export const ClickablePropertyNameCell = PropertyNameCell.extend` diff --git a/src/common-elements/headers.ts b/src/common-elements/headers.ts index 96a64aa0..abb36feb 100644 --- a/src/common-elements/headers.ts +++ b/src/common-elements/headers.ts @@ -1,12 +1,6 @@ import * as React from 'react'; -import { InterpolationFunction, Styles, ThemeProps } from 'styled-components'; -import styled, { - css, - extensionsHook, - ResolvedThemeInterface, - StyledComponentClass, -} from '../styled-components'; +import styled, { css, extensionsHook } from '../styled-components'; const headerFontSize = { 1: '1.85714em', diff --git a/src/common-elements/linkify.ts b/src/common-elements/linkify.ts index c1ff3b6a..f140637e 100644 --- a/src/common-elements/linkify.ts +++ b/src/common-elements/linkify.ts @@ -1,7 +1,6 @@ import * as React from 'react'; -import { InterpolationFunction, Styles, ThemeProps } from 'styled-components'; -import styled, { css, ResolvedThemeInterface, StyledComponentClass } from '../styled-components'; +import styled, { css } from '../styled-components'; // tslint:disable-next-line export const linkifyMixin = className => css` diff --git a/src/common-elements/mixins.ts b/src/common-elements/mixins.ts index 7722835e..176ee922 100644 --- a/src/common-elements/mixins.ts +++ b/src/common-elements/mixins.ts @@ -1,6 +1,4 @@ -import { InterpolationFunction, Styles, ThemeProps } from 'styled-components'; - -import { css, StyledComponentClass } from '../styled-components'; +import { css } from '../styled-components'; export const deprecatedCss = css` text-decoration: line-through; diff --git a/src/common-elements/panels.ts b/src/common-elements/panels.ts index 2a842dec..5412cb08 100644 --- a/src/common-elements/panels.ts +++ b/src/common-elements/panels.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import styled, { media, ResolvedThemeInterface, StyledComponentClass } from '../styled-components'; +import styled, { media } from '../styled-components'; export const MiddlePanel = styled.div` width: calc(100% - ${props => props.theme.rightPanel.width}); diff --git a/src/common-elements/samples.tsx b/src/common-elements/samples.tsx index 384cdaa6..1657ec2b 100644 --- a/src/common-elements/samples.tsx +++ b/src/common-elements/samples.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../styled-components'; +import styled from '../styled-components'; export const SampleControls = styled.div` opacity: 0.4; diff --git a/src/common-elements/schema.ts b/src/common-elements/schema.ts index eb09a739..8ec73941 100644 --- a/src/common-elements/schema.ts +++ b/src/common-elements/schema.ts @@ -1,9 +1,5 @@ import * as React from 'react'; -import styled, { - ResolvedThemeInterface, - StyledComponentClass, - withProps, -} from '../styled-components'; +import styled, { withProps } from '../styled-components'; export const OneOfList = styled.ul` margin: 0; diff --git a/src/common-elements/shelfs.tsx b/src/common-elements/shelfs.tsx index 16998376..9a5df8b4 100644 --- a/src/common-elements/shelfs.tsx +++ b/src/common-elements/shelfs.tsx @@ -1,9 +1,5 @@ import * as React from 'react'; -import styled, { - ResolvedThemeInterface, - StyledComponentClass, - withProps, -} from '../styled-components'; +import styled, { withProps } from '../styled-components'; const directionMap = { left: '90deg', diff --git a/src/common-elements/tabs.ts b/src/common-elements/tabs.ts index 6499c9ac..09bdbbe5 100644 --- a/src/common-elements/tabs.ts +++ b/src/common-elements/tabs.ts @@ -1,5 +1,5 @@ import { Tabs as ReactTabs, TabsProps } from 'react-tabs'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../styled-components'; +import styled from '../styled-components'; export { Tab, TabList, TabPanel } from 'react-tabs'; diff --git a/src/components/ApiInfo/ApiInfo.tsx b/src/components/ApiInfo/ApiInfo.tsx index e7058a8a..8b570846 100644 --- a/src/components/ApiInfo/ApiInfo.tsx +++ b/src/components/ApiInfo/ApiInfo.tsx @@ -4,8 +4,6 @@ import * as React from 'react'; import { AppStore } from '../../services/AppStore'; import { MiddlePanel, Row } from '../../common-elements/'; -import { Markdown } from '../Markdown/Markdown'; -import { SecurityDefs } from '../SecuritySchemes/SecuritySchemes'; import { StyledMarkdownBlock } from '../Markdown/styled.elements'; import { diff --git a/src/components/ApiInfo/styled.elements.ts b/src/components/ApiInfo/styled.elements.ts index 583ff9f5..75a6e8e6 100644 --- a/src/components/ApiInfo/styled.elements.ts +++ b/src/components/ApiInfo/styled.elements.ts @@ -1,11 +1,7 @@ -import { AnchorHTMLAttributes, ClassAttributes, HTMLAttributes } from 'react'; +import * as React from 'react'; import { H1, MiddlePanel } from '../../common-elements'; -import styled, { - extensionsHook, - ResolvedThemeInterface, - StyledComponentClass, -} from '../../styled-components'; +import styled, { extensionsHook } from '../../styled-components'; const delimiterWidth = 15; diff --git a/src/components/ApiLogo/styled.elements.tsx b/src/components/ApiLogo/styled.elements.tsx index ce67639b..321256de 100644 --- a/src/components/ApiLogo/styled.elements.tsx +++ b/src/components/ApiLogo/styled.elements.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components'; +import styled from '../../styled-components'; export const LogoImgEl = styled.img` max-height: ${props => props.theme.logo.maxHeight}; diff --git a/src/components/Endpoint/styled.elements.ts b/src/components/Endpoint/styled.elements.ts index 96b1ac8b..b6963574 100644 --- a/src/components/Endpoint/styled.elements.ts +++ b/src/components/Endpoint/styled.elements.ts @@ -1,10 +1,6 @@ -import { ClassAttributes, HTMLAttributes, HTMLProps } from 'react'; +import * as React from 'react'; -import styled, { - ResolvedThemeInterface, - StyledComponentClass, - withProps, -} from '../../styled-components'; +import styled, { withProps } from '../../styled-components'; export const OperationEndpointWrap = styled.div` cursor: pointer; diff --git a/src/components/JsonViewer/JsonViewer.tsx b/src/components/JsonViewer/JsonViewer.tsx index f45e7224..1905a1e9 100644 --- a/src/components/JsonViewer/JsonViewer.tsx +++ b/src/components/JsonViewer/JsonViewer.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components'; +import styled from '../../styled-components'; import { SampleControls } from '../../common-elements'; import { CopyButtonWrapper } from '../../common-elements/CopyButtonWrapper'; diff --git a/src/components/JsonViewer/style.ts b/src/components/JsonViewer/style.ts index 0c99e2b3..16b71c5e 100644 --- a/src/components/JsonViewer/style.ts +++ b/src/components/JsonViewer/style.ts @@ -1,5 +1,4 @@ -import { InterpolationFunction, Styles, ThemeProps } from 'styled-components'; -import { css, ResolvedThemeInterface, StyledComponentClass } from '../../styled-components'; +import { css } from '../../styled-components'; export const jsonStyles = css` .redoc-json > .collapser { diff --git a/src/components/Loading/Spinner.svg.tsx b/src/components/Loading/Spinner.svg.tsx index 850e3060..fd9d73d8 100644 --- a/src/components/Loading/Spinner.svg.tsx +++ b/src/components/Loading/Spinner.svg.tsx @@ -1,9 +1,5 @@ import * as React from 'react'; -import styled, { - keyframes, - ResolvedThemeInterface, - StyledComponentClass, -} from '../../styled-components'; +import styled, { keyframes } from '../../styled-components'; const _Spinner = (props: { className?: string; color: string }) => ( diff --git a/src/components/Markdown/Markdown.tsx b/src/components/Markdown/Markdown.tsx index 53091c97..d46563bb 100644 --- a/src/components/Markdown/Markdown.tsx +++ b/src/components/Markdown/Markdown.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components'; import * as DOMPurify from 'dompurify'; import { AppStore, MarkdownRenderer, MDXComponentMeta } from '../../services'; diff --git a/src/components/Markdown/styled.elements.ts b/src/components/Markdown/styled.elements.ts index dd5054ad..0fe17711 100644 --- a/src/components/Markdown/styled.elements.ts +++ b/src/components/Markdown/styled.elements.ts @@ -1,14 +1,7 @@ import * as React from 'react'; -import { InterpolationFunction, Styles, ThemeProps } from 'styled-components'; import { headerCommonMixin, linkifyMixin } from '../../common-elements'; -import styled, { - css, - extensionsHook, - ResolvedThemeInterface, - StyledComponentClass, - withProps, -} from '../../styled-components'; +import styled, { css, extensionsHook, withProps } from '../../styled-components'; export const linksCss = css` a { diff --git a/src/components/Operation/Operation.tsx b/src/components/Operation/Operation.tsx index 493c3df8..ec60e205 100644 --- a/src/components/Operation/Operation.tsx +++ b/src/components/Operation/Operation.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import styled from '../../styled-components'; import { SecurityRequirements } from '../SecurityRequirement/SecuirityRequirement'; import { observer } from 'mobx-react'; diff --git a/src/components/OptionsProvider.ts b/src/components/OptionsProvider.ts index 5353bd48..fdae1166 100644 --- a/src/components/OptionsProvider.ts +++ b/src/components/OptionsProvider.ts @@ -1,4 +1,3 @@ -import * as PropTypes from 'prop-types'; import * as React from 'react'; import { RedocNormalizedOptions } from '../services/RedocNormalizedOptions'; diff --git a/src/components/PayloadSamples/styled.elements.ts b/src/components/PayloadSamples/styled.elements.ts index 80a29a5b..e0733166 100644 --- a/src/components/PayloadSamples/styled.elements.ts +++ b/src/components/PayloadSamples/styled.elements.ts @@ -1,5 +1,5 @@ -import { ClassAttributes, HTMLAttributes } from 'react'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components'; +import * as React from 'react'; +import styled from '../../styled-components'; import { DropdownProps, StyledDropdown } from '../../common-elements'; diff --git a/src/components/Redoc/styled.elements.tsx b/src/components/Redoc/styled.elements.tsx index 1716cacb..9fa4b458 100644 --- a/src/components/Redoc/styled.elements.tsx +++ b/src/components/Redoc/styled.elements.tsx @@ -1,10 +1,6 @@ -import { ClassAttributes, HTMLAttributes } from 'react'; +import * as React from 'react'; -import styled, { - media, - ResolvedThemeInterface, - StyledComponentClass, -} from '../../styled-components'; +import styled, { media } from '../../styled-components'; export const RedocWrap = styled.div` font-family: ${props => props.theme.baseFont.family}; diff --git a/src/components/ResponseSamples/ResponseSamples.tsx b/src/components/ResponseSamples/ResponseSamples.tsx index 4d4c7a86..3f9eefa0 100644 --- a/src/components/ResponseSamples/ResponseSamples.tsx +++ b/src/components/ResponseSamples/ResponseSamples.tsx @@ -1,7 +1,7 @@ import { observer } from 'mobx-react'; import * as React from 'react'; -import { MediaContentModel, OperationModel } from '../../services/models'; +import { OperationModel } from '../../services/models'; import { RightPanelHeader, Tab, TabList, TabPanel, Tabs } from '../../common-elements'; import { PayloadSamples } from '../PayloadSamples/PayloadSamples'; diff --git a/src/components/Responses/styled.elements.ts b/src/components/Responses/styled.elements.ts index 84e134d8..986822ac 100644 --- a/src/components/Responses/styled.elements.ts +++ b/src/components/Responses/styled.elements.ts @@ -1,9 +1,9 @@ import { transparentize } from 'polished'; -import { ClassAttributes, HTMLAttributes } from 'react'; +import * as React from 'react'; import { UnderlinedHeader } from '../../common-elements'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components'; -import { ResponseTitle, ResponseTitleProps } from './ResponseTitle'; +import styled from '../../styled-components'; +import { ResponseTitle } from './ResponseTitle'; export const StyledResponseTitle = styled(ResponseTitle)` padding: 10px; diff --git a/src/components/SearchBox/styled.elements.tsx b/src/components/SearchBox/styled.elements.tsx index ca3bdb3b..82b33954 100644 --- a/src/components/SearchBox/styled.elements.tsx +++ b/src/components/SearchBox/styled.elements.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components'; +import styled from '../../styled-components'; import { MenuItemLabel } from '../SideMenu/styled.elements'; export const SearchWrap = styled.div` diff --git a/src/components/SideMenu/styled.elements.ts b/src/components/SideMenu/styled.elements.ts index e6f53d9a..f9a2af67 100644 --- a/src/components/SideMenu/styled.elements.ts +++ b/src/components/SideMenu/styled.elements.ts @@ -1,14 +1,8 @@ import * as classnames from 'classnames'; import * as React from 'react'; -import { InterpolationFunction, Styles, ThemeProps } from 'styled-components'; import { deprecatedCss } from '../../common-elements'; -import styled, { - css, - ResolvedThemeInterface, - StyledComponentClass, - withProps, -} from '../../styled-components'; +import styled, { css, withProps } from '../../styled-components'; export const OperationBadge = withProps<{ type: string }>(styled.span).attrs({ className: props => `operation-type ${props.type}`, diff --git a/src/components/StoreProvider.ts b/src/components/StoreProvider.ts index df926302..1dba8585 100644 --- a/src/components/StoreProvider.ts +++ b/src/components/StoreProvider.ts @@ -3,7 +3,6 @@ import { Component } from 'react'; import { AppStore } from '../services/'; import { RedocRawOptions } from '../services/RedocNormalizedOptions'; -import { OpenAPISpec } from '../types'; import { loadAndBundleSpec } from '../utils'; export interface StoreProviderProps { diff --git a/src/services/HistoryService.ts b/src/services/HistoryService.ts index 863840a5..2a9156f9 100644 --- a/src/services/HistoryService.ts +++ b/src/services/HistoryService.ts @@ -9,7 +9,6 @@ function isSameHash(a: string, b: string): boolean { } export class IntHistoryService { - private causedHashChange: boolean = false; private _emiter; constructor() { @@ -40,7 +39,6 @@ export class IntHistoryService { if (IS_BROWSER) { window.removeEventListener('hashchange', this.emit); } - this.causedHashChange = false; } @bind diff --git a/src/services/SearchStore.ts b/src/services/SearchStore.ts index ed8a616d..669d8d05 100644 --- a/src/services/SearchStore.ts +++ b/src/services/SearchStore.ts @@ -2,7 +2,7 @@ import { IS_BROWSER } from '../utils/'; import { IMenuItem } from './MenuStore'; import { OperationModel } from './models'; -import Worker, { SearchDocument, SearchResult } from './SearchWorker.worker'; +import Worker from './SearchWorker.worker'; let worker: new () => Worker; diff --git a/src/services/SpecStore.ts b/src/services/SpecStore.ts index 2e6d67e9..1f9bb1d3 100644 --- a/src/services/SpecStore.ts +++ b/src/services/SpecStore.ts @@ -1,8 +1,7 @@ import { computed, observable } from 'mobx'; -import { OpenAPIExternalDocumentation, OpenAPISpec } from '../types'; +import { OpenAPISpec } from '../types'; import { MenuBuilder } from './MenuBuilder'; -import { GroupModel, OperationModel } from './models/'; import { ApiInfoModel } from './models/ApiInfo'; import { SecuritySchemesModel } from './models/SecuritySchemes'; import { OpenAPIParser } from './OpenAPIParser'; diff --git a/src/setupTests.ts b/src/setupTests.ts index 77fb721e..5a599cc2 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -1,5 +1,5 @@ -import 'raf/polyfill'; import * as Enzyme from 'enzyme'; import * as Adapter from 'enzyme-adapter-react-16'; +import 'raf/polyfill'; Enzyme.configure({ adapter: new Adapter() }); diff --git a/src/styled-components.ts b/src/styled-components.ts index 74466f42..41badeb7 100644 --- a/src/styled-components.ts +++ b/src/styled-components.ts @@ -1,7 +1,7 @@ -import { ComponentClass, StatelessComponent } from 'react'; +import * as React from 'react'; import * as styledComponents from 'styled-components'; -import { ResolvedThemeInterface, ThemeInterface } from './theme'; +import { ResolvedThemeInterface } from './theme'; export { ResolvedThemeInterface }; @@ -54,7 +54,6 @@ export const media = { }; export { css, injectGlobal, keyframes, ThemeProvider, withProps }; -export { StyledComponentClass } from 'styled-components'; export default styled; export function extensionsHook(styledName: string) { diff --git a/src/utils/test-utils.ts b/src/utils/test-utils.ts index f150e141..d46468ef 100644 --- a/src/utils/test-utils.ts +++ b/src/utils/test-utils.ts @@ -1,8 +1,6 @@ /* tslint:disable:no-implicit-dependencies */ import { has, set } from 'lodash'; -import { instanceOf } from 'prop-types'; -import { RedocNormalizedOptions } from '../services/RedocNormalizedOptions'; function traverseComponent(root, fn) { if (!root) {