Skip to content

Commit 8389496

Browse files
author
Vadim Demedes
committed
Remove import type statements
1 parent e8f2b34 commit 8389496

25 files changed

+48
-69
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"code-excerpt": "^3.0.0",
4848
"indent-string": "^4.0.0",
4949
"is-ci": "^2.0.0",
50-
"lodash.throttle": "^4.1.1",
50+
"lodash": "^4.17.20",
5151
"patch-console": "^1.0.0",
5252
"react-devtools-core": "^4.6.0",
5353
"react-reconciler": "^0.24.0",
@@ -65,7 +65,7 @@
6565
"devDependencies": {
6666
"@sindresorhus/tsconfig": "0.7.0",
6767
"@types/is-ci": "^2.0.0",
68-
"@types/lodash.throttle": "^4.1.6",
68+
"@types/lodash": "^4.14.161",
6969
"@types/node": "*",
7070
"@types/react": "^16.9.41",
7171
"@types/react-reconciler": "^0.18.0",

src/components/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
2-
import React, {PureComponent} from 'react';
3-
import type {ReactNode} from 'react';
2+
import React, {PureComponent, ReactNode} from 'react';
43
import cliCursor from 'cli-cursor';
54
import AppContext from './AppContext';
65
import StdinContext from './StdinContext';

src/components/Box.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
2-
import React, {forwardRef} from 'react';
3-
import type {PropsWithChildren} from 'react';
4-
import type {Except} from 'type-fest';
5-
import type {Styles} from '../styles';
6-
import type {DOMElement} from '../dom';
2+
import React, {forwardRef, PropsWithChildren} from 'react';
3+
import {Except} from 'type-fest';
4+
import {Styles} from '../styles';
5+
import {DOMElement} from '../dom';
76

87
export type Props = Except<Styles, 'textWrap'> & {
98
/**

src/components/ErrorOverview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as fs from 'fs';
2-
import React from 'react';
3-
import type {FC} from 'react';
2+
import React, {FC} from 'react';
43
import StackUtils from 'stack-utils';
54
import codeExcerpt, {ExcerptLine} from 'code-excerpt';
65
import Box from './Box';

src/components/Newline.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React from 'react';
2-
import type {FC} from 'react';
1+
import React, {FC} from 'react';
32

43
export interface Props {
54
/**

src/components/Spacer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React from 'react';
2-
import type {FC} from 'react';
1+
import React, {FC} from 'react';
32
import Box from './Box';
43

54
/**

src/components/Static.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React, {useMemo, useState, useLayoutEffect} from 'react';
2-
import type {ReactNode} from 'react';
3-
import type {Styles} from '../styles';
1+
import React, {useMemo, useState, useLayoutEffect, ReactNode} from 'react';
2+
import {Styles} from '../styles';
43

54
export interface Props<T> extends Styles {
65
/**

src/components/Text.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import React from 'react';
2-
import type {FC, ReactNode} from 'react';
3-
import chalk from 'chalk';
1+
import React, {FC, ReactNode} from 'react';
2+
import chalk, {ForegroundColor, BackgroundColor} from 'chalk';
43
import colorize from '../colorize';
5-
import type {Styles} from '../styles';
6-
import type {LiteralUnion} from 'type-fest';
7-
import type {ForegroundColor, BackgroundColor} from 'chalk';
4+
import {Styles} from '../styles';
5+
import {LiteralUnion} from 'type-fest';
86

97
export interface Props {
108
/**

src/components/Transform.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import React from 'react';
2-
import type {FC, ReactNode} from 'react';
1+
import React, {FC, ReactNode} from 'react';
32

43
export interface Props {
54
/**

src/dom.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import Yoga from 'yoga-layout-prebuilt';
2-
import type {YogaNode} from 'yoga-layout-prebuilt';
1+
import Yoga, {YogaNode} from 'yoga-layout-prebuilt';
32
import measureText from './measure-text';
4-
import applyStyles from './styles';
3+
import applyStyles, {Styles} from './styles';
54
import wrapText from './wrap-text';
65
import squashTextNodes from './squash-text-nodes';
7-
import type {OutputTransformer} from './render-node-to-output';
8-
import type {Styles} from './styles';
6+
import {OutputTransformer} from './render-node-to-output';
97

108
interface InkNode {
119
parentNode: DOMElement | null;

src/global.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type {ReactNode, Key, LegacyRef} from 'react';
2-
import type {Except} from 'type-fest';
3-
import type {DOMElement} from './dom';
4-
import type {Styles} from './styles';
1+
import {ReactNode, Key, LegacyRef} from 'react';
2+
import {Except} from 'type-fest';
3+
import {DOMElement} from './dom';
4+
import {Styles} from './styles';
55

66
declare global {
77
namespace JSX {

src/hooks/use-focus-manager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {useContext} from 'react';
2-
import FocusContext from '../components/FocusContext';
3-
import type {Props} from '../components/FocusContext';
2+
import FocusContext, {Props} from '../components/FocusContext';
43

54
interface Output {
65
/**

src/ink.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import React from 'react';
2-
import type {ReactNode} from 'react';
3-
import throttle from 'lodash.throttle';
4-
import type {DebouncedFunc} from 'lodash';
5-
import logUpdate from './log-update';
6-
import type {LogUpdate} from './log-update';
1+
import React, {ReactNode} from 'react';
2+
import {throttle, DebouncedFunc} from 'lodash';
3+
import logUpdate, {LogUpdate} from './log-update';
74
import ansiEscapes from 'ansi-escapes';
85
import originalIsCI from 'is-ci';
96
import autoBind from 'auto-bind';
@@ -12,7 +9,7 @@ import render from './renderer';
129
import signalExit from 'signal-exit';
1310
import patchConsole from 'patch-console';
1411
import * as dom from './dom';
15-
import type {FiberRoot} from 'react-reconciler';
12+
import {FiberRoot} from 'react-reconciler';
1613
import instances from './instances';
1714
import App from './components/App';
1815

src/log-update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Writable} from 'stream';
1+
import {Writable} from 'stream';
22
import ansiEscapes from 'ansi-escapes';
33
import cliCursor from 'cli-cursor';
44

src/measure-element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {DOMElement} from './dom';
1+
import {DOMElement} from './dom';
22

33
interface Output {
44
/**

src/output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sliceAnsi from 'slice-ansi';
22
import stringLength from 'string-length';
3-
import type {OutputTransformer} from './render-node-to-output';
3+
import {OutputTransformer} from './render-node-to-output';
44

55
/**
66
* "Virtual" output class

src/reconciler.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ import {
1212
setStyle,
1313
setTextNodeValue,
1414
createNode,
15-
setAttribute
16-
} from './dom';
17-
import type {
15+
setAttribute,
1816
DOMNode,
1917
DOMNodeAttribute,
2018
TextNode,
2119
ElementNames,
2220
DOMElement
2321
} from './dom';
24-
import type {Styles} from './styles';
25-
import type {OutputTransformer} from './render-node-to-output';
22+
import {Styles} from './styles';
23+
import {OutputTransformer} from './render-node-to-output';
2624

2725
// We need to conditionally perform devtools connection to avoid
2826
// accidentally breaking other third-party code.

src/render-border.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import cliBoxes from 'cli-boxes';
22
import colorize from './colorize';
3-
import type {DOMNode} from './dom';
4-
import type Output from './output';
3+
import {DOMNode} from './dom';
4+
import Output from './output';
55

66
export default (x: number, y: number, node: DOMNode, output: Output): void => {
77
if (typeof node.style.borderStyle === 'string') {

src/render-node-to-output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import wrapText from './wrap-text';
55
import getMaxWidth from './get-max-width';
66
import squashTextNodes from './squash-text-nodes';
77
import renderBorder from './render-border';
8-
import type {DOMElement} from './dom';
8+
import {DOMElement} from './dom';
99
import Output from './output';
1010

1111
// If parent container is `<Box>`, text nodes will be treated as separate nodes in

src/render.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type {ReactElement} from 'react';
2-
import Ink from './ink';
3-
import type {Options as InkOptions} from './ink';
1+
import {ReactElement} from 'react';
2+
import Ink, {Options as InkOptions} from './ink';
43
import instances from './instances';
54
import {Stream} from 'stream';
65

src/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Yoga from 'yoga-layout-prebuilt';
22
import renderNodeToOutput from './render-node-to-output';
33
import Output from './output';
4-
import type {DOMElement} from './dom';
4+
import {DOMElement} from './dom';
55

66
interface Result {
77
output: string;

src/squash-text-nodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {DOMElement} from './dom';
1+
import {DOMElement} from './dom';
22

33
// Squashing text nodes allows to combine multiple text nodes into one and write
44
// to `Output` instance only once. For example, <Text>hello{' '}world</Text>

src/styles.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
2-
import Yoga from 'yoga-layout-prebuilt';
3-
import type {YogaNode} from 'yoga-layout-prebuilt';
4-
import type {Boxes} from 'cli-boxes';
5-
import type {LiteralUnion} from 'type-fest';
6-
import type {ForegroundColor} from 'chalk';
2+
import Yoga, {YogaNode} from 'yoga-layout-prebuilt';
3+
import {Boxes} from 'cli-boxes';
4+
import {LiteralUnion} from 'type-fest';
5+
import {ForegroundColor} from 'chalk';
76

87
export interface Styles {
98
readonly textWrap?:

test/borders.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, {useState, useEffect} from 'react';
22
import test from 'ava';
3-
import boxen from 'boxen';
4-
import type {Options} from 'boxen';
3+
import boxen, {Options} from 'boxen';
54
import indentString from 'indent-string';
65
import delay from 'delay';
76
import {renderToString} from './helpers/render-to-string';

test/focus.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import EventEmitter from 'events';
2-
import React, {useEffect} from 'react';
3-
import type {FC} from 'react';
2+
import React, {useEffect, FC} from 'react';
43
import delay from 'delay';
54
import test from 'ava';
65
import {spy} from 'sinon';

0 commit comments

Comments
 (0)