Skip to content

Commit

Permalink
change plugin to generate d.ts files with correct type assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavoFreireS committed Aug 16, 2019
1 parent 7959251 commit 0b00b8d
Show file tree
Hide file tree
Showing 42 changed files with 53 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"import Tab from './tabs/tab';\r\nimport TabBar from './tabs/tab-bar';\r\nimport './tabs/tab.scss';\r\nexport { Tab, TabBar, };\r\n//# sourceMappingURL=index.js.map","references":["/Users/gustavofreiresantos/projetos/tabs-react-project/src/components/tabs/tab.tsx","/Users/gustavofreiresantos/projetos/tabs-react-project/src/components/tabs/tab-bar.tsx"],"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/components/index.tsx\"],\"names\":[],\"mappings\":\"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,iBAAiB,CAAC;AAEzB,OAAO,EACL,GAAG,EACH,MAAM,GACP,CAAC\"}","dts":{"name":"/Users/gustavofreiresantos/projetos/tabs-react-project/components/index.d.ts","writeByteOrderMark":false,"text":"import Tab from './tabs/tab';\r\nimport TabBar from './tabs/tab-bar';\r\nimport './tabs/tab.scss';\r\nexport { Tab, TabBar, };\r\n"}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"export function arrayMove(arr, oldIndex, newIndex) {\r\n arr.splice(newIndex, 0, arr.splice(oldIndex, 1)[0]);\r\n return arr;\r\n}\r\n//# sourceMappingURL=utils.js.map","references":[],"map":"{\"version\":3,\"file\":\"utils.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/components/tabs/utils.ts\"],\"names\":[],\"mappings\":\"AAAA,MAAM,UAAU,SAAS,CAAC,GAAU,EAAE,QAAgB,EAAE,QAAgB;IACtE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,OAAO,GAAG,CAAC;AACb,CAAC\"}","dts":{"name":"/Users/gustavofreiresantos/projetos/tabs-react-project/components/tabs/utils.d.ts","writeByteOrderMark":false,"text":"export declare function arrayMove(arr: any[], oldIndex: number, newIndex: number): any[];\r\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":"import React from 'react';\r\nimport uuid from 'uuid';\r\nconst Tab = (props) => {\r\n return (React.createElement(\"div\", { className: \"tab-wrapper\", key: uuid() },\r\n React.createElement(\"div\", null, props.children)));\r\n};\r\nexport default Tab;\r\n//# sourceMappingURL=tab.js.map","references":["/Users/gustavofreiresantos/projetos/tabs-react-project/node_modules/@types/react/index.d.ts","/Users/gustavofreiresantos/projetos/tabs-react-project/node_modules/@types/uuid/index.d.ts"],"map":"{\"version\":3,\"file\":\"tab.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/components/tabs/tab.tsx\"],\"names\":[],\"mappings\":\"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,MAAM,GAAG,GAAG,CAAC,KAAe,EAAE,EAAE;IAC9B,OAAO,CACL,6BACE,SAAS,EAAC,aAAa,EACvB,GAAG,EAAE,IAAI,EAAE;QAEX,iCACG,KAAK,CAAC,QAAQ,CACX,CACD,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,GAAG,CAAC\"}","dts":{"name":"/Users/gustavofreiresantos/projetos/tabs-react-project/components/tabs/tab.d.ts","writeByteOrderMark":false,"text":"import { ReactElement } from 'react';\r\nexport interface TabProps {\r\n resourceData?: object;\r\n children: any;\r\n active?: boolean;\r\n tabHeader?: ReactElement;\r\n text?: string;\r\n}\r\ndeclare const Tab: (props: TabProps) => JSX.Element;\r\nexport default Tab;\r\n"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
39 changes: 36 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-smart-tabs",
"version": "0.1.0",
"version": "0.2.1",
"description": "A tab component with drag and drop functionality, add and close",
"main": "dist/bundle.js",
"scripts": {
Expand Down Expand Up @@ -59,6 +59,7 @@
"react-dom": "^16.9.0",
"react-svg": "^10.0.17",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-typescript2": "^0.22.1",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"tslint": "^5.18.0",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import typescript from 'rollup-plugin-typescript';
import typescript from 'rollup-plugin-typescript2';
import scss from 'rollup-plugin-scss';
import {terser} from "rollup-plugin-terser";
import svg from 'rollup-plugin-svg'
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"sourceMap": true,
"skipLibCheck": true,
"noImplicitAny": true,
"module": "commonjs",
"module": "ESNext",
"declaration": true,
"target": "es6",
"jsx": "react",
"esModuleInterop": true
Expand Down

0 comments on commit 0b00b8d

Please sign in to comment.