Skip to content

Commit 6fcd571

Browse files
New: Add typescript as dev dependency and update types
We now having the tpe definitions as extra types folder instead of the single index.d.ts file. re #74
1 parent 8bc4bb8 commit 6fcd571

File tree

8 files changed

+55
-76
lines changed

8 files changed

+55
-76
lines changed

index.d.ts

-39
This file was deleted.

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@
5656
"rimraf": "^3.0.0",
5757
"semantic-release": "^17.1.1",
5858
"sinon": "^7.5.0",
59-
"travis-deploy-once": "^5.0.11"
59+
"travis-deploy-once": "^5.0.11",
60+
"typescript": "^3.9.7"
6061
},
6162
"files": [
62-
"index.d.ts",
63+
"types",
6364
"lib",
6465
"src"
6566
],
@@ -78,7 +79,7 @@
7879
"peerDependencies": {
7980
"react": "^15.0.0-0 || ^16.0.0"
8081
},
81-
"typings": "./index.d.ts",
82+
"types": "./types/index.d.ts",
8283
"directories": {
8384
"lib": "lib",
8485
"test": "test"

tsconfig.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"include": ["src/**/*"],
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"declaration": true,
6+
"emitDeclarationOnly": true,
7+
"outDir": "lib",
8+
},
9+
}

types/components/ThemeProvider.d.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default class ThemeProvider extends Component<any, any, any> {
2+
static propTypes: {
3+
children: any;
4+
theme: any;
5+
};
6+
static defaultProps: {
7+
theme: {};
8+
};
9+
static childContextTypes: {
10+
themr: any;
11+
};
12+
constructor(props: Readonly<any>);
13+
constructor(props: any, context?: any);
14+
getChildContext(): {
15+
themr: {
16+
theme: any;
17+
};
18+
};
19+
}
20+
import { Component } from "react";

types/components/themr.d.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Merges passed themes by concatenating string keys and processing nested themes
3+
*
4+
* @param {...TReactCSSThemrTheme} themes - Themes
5+
* @returns {TReactCSSThemrTheme} - Resulting theme
6+
*/
7+
export function themeable(...themes: TReactCSSThemrTheme[]): any;
8+
declare function _default(componentName: string | number | Symbol, localTheme?: any, options?: {}): (arg0: any, arg1: Function) => Function;
9+
export default _default;
10+
export type TReactCSSThemrTheme = any;
11+
export type TReactCSSThemrOptions = {};

types/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as ThemeProvider } from "./components/ThemeProvider";
2+
export { default as themr, themeable } from "./components/themr";

types/utils/themr-shape.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare var _default: any;
2+
export default _default;

yarn.lock

+7-34
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,7 @@ debug@^3.1.0:
27732773
dependencies:
27742774
ms "^2.1.1"
27752775

2776-
debuglog@*, debuglog@^1.0.1:
2776+
debuglog@^1.0.1:
27772777
version "1.0.1"
27782778
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
27792779
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
@@ -4201,7 +4201,7 @@ import-local@^2.0.0:
42014201
pkg-dir "^3.0.0"
42024202
resolve-cwd "^2.0.0"
42034203

4204-
imurmurhash@*, imurmurhash@^0.1.4:
4204+
imurmurhash@^0.1.4:
42054205
version "0.1.4"
42064206
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
42074207
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
@@ -5510,11 +5510,6 @@ lockfile@^1.0.4:
55105510
dependencies:
55115511
signal-exit "^3.0.2"
55125512

5513-
lodash._baseindexof@*:
5514-
version "3.1.0"
5515-
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
5516-
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=
5517-
55185513
lodash._baseuniq@~4.6.0:
55195514
version "4.6.0"
55205515
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
@@ -5523,33 +5518,11 @@ lodash._baseuniq@~4.6.0:
55235518
lodash._createset "~4.0.0"
55245519
lodash._root "~3.0.0"
55255520

5526-
lodash._bindcallback@*:
5527-
version "3.0.1"
5528-
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
5529-
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=
5530-
5531-
lodash._cacheindexof@*:
5532-
version "3.0.2"
5533-
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
5534-
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=
5535-
5536-
lodash._createcache@*:
5537-
version "3.1.2"
5538-
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
5539-
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
5540-
dependencies:
5541-
lodash._getnative "^3.0.0"
5542-
55435521
lodash._createset@~4.0.0:
55445522
version "4.0.3"
55455523
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
55465524
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
55475525

5548-
lodash._getnative@*, lodash._getnative@^3.0.0:
5549-
version "3.9.1"
5550-
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
5551-
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
5552-
55535526
lodash._root@~3.0.0:
55545527
version "3.0.1"
55555528
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
@@ -5590,11 +5563,6 @@ lodash.map@^4.5.1, lodash.map@^4.6.0:
55905563
resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
55915564
integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=
55925565

5593-
lodash.restparam@*:
5594-
version "3.6.1"
5595-
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
5596-
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
5597-
55985566
lodash.sortby@^4.7.0:
55995567
version "4.7.0"
56005568
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
@@ -8618,6 +8586,11 @@ typedarray@^0.0.6:
86188586
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
86198587
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
86208588

8589+
typescript@^3.9.7:
8590+
version "3.9.7"
8591+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
8592+
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
8593+
86218594
ua-parser-js@^0.7.18:
86228595
version "0.7.21"
86238596
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"

0 commit comments

Comments
 (0)