Skip to content

Commit

Permalink
fix: type error (#153)
Browse files Browse the repository at this point in the history
Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com>
  • Loading branch information
nam-hle and Nam Hoang Le committed Apr 20, 2021
1 parent 803fe15 commit 9095a78
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -66,8 +66,7 @@
"main": "./dist/src/index.js",
"files": [
"dist/src/**/*.js",
"dist/src/types/api.d.ts",
"dist/src/index.d.ts"
"dist/src/**/*.d.ts"
],
"name": "table",
"nyc": {
Expand Down
2 changes: 1 addition & 1 deletion src/getBorderCharacters.ts
Expand Up @@ -2,7 +2,7 @@

import type {
BorderConfig,
} from './types/internal';
} from './types/api';

export default (name: string): BorderConfig => {
if (name === 'honeywell') {
Expand Down
4 changes: 2 additions & 2 deletions src/makeConfig.ts
Expand Up @@ -3,10 +3,10 @@ import calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex
import getBorderCharacters from './getBorderCharacters';
import type {
ColumnUserConfig, Indexable,
BorderUserConfig, TableUserConfig,
BorderUserConfig, BorderConfig, TableUserConfig,
} from './types/api';
import type {
BorderConfig, ColumnConfig, Row, TableConfig,
ColumnConfig, Row, TableConfig,
} from './types/internal';
import validateConfig from './validateConfig';

Expand Down
2 changes: 1 addition & 1 deletion src/makeStreamConfig.ts
Expand Up @@ -5,9 +5,9 @@ import type {
Indexable,
StreamUserConfig,
BorderUserConfig,
BorderConfig,
} from './types/api';
import type {
BorderConfig,
ColumnConfig,
StreamConfig,
} from './types/internal';
Expand Down
3 changes: 3 additions & 0 deletions src/types/api.ts
Expand Up @@ -23,6 +23,8 @@ export type BorderUserConfig = {
readonly joinJoin?: string,
};

export type BorderConfig = Required<BorderUserConfig>;

export type ColumnUserConfig = {

/**
Expand Down Expand Up @@ -122,3 +124,4 @@ export type WritableStream = {
export type Indexable<T> = {
readonly [index: number]: T,
};

5 changes: 1 addition & 4 deletions src/types/internal.ts
@@ -1,5 +1,5 @@
import type {
BorderUserConfig,
BorderConfig,
ColumnUserConfig, DrawVerticalLine, Indexable, StreamUserConfig, TableUserConfig,
} from './api';

Expand All @@ -9,9 +9,6 @@ export type Cell = string;
/** @internal */
export type Row = Cell[];

/** @internal */
export type BorderConfig = Required<BorderUserConfig>;

/** @internal */
export type TopBorderConfig = Pick<BorderConfig, 'topBody' | 'topJoin' | 'topLeft' | 'topRight'>;

Expand Down

0 comments on commit 9095a78

Please sign in to comment.