From 51cf055b29d1b5790a5ca41804d5857d4e821a5d Mon Sep 17 00:00:00 2001 From: Naor Torgeman Date: Tue, 12 Jun 2018 18:47:48 +0300 Subject: [PATCH 1/5] Add files via upload --- types/react-show-more/index.d.ts | 18 +++++++++++++ .../react-show-more/react-show-more-tests.tsx | 13 ++++++++++ types/react-show-more/tsconfig.json | 25 +++++++++++++++++++ types/react-show-more/tslint.json | 3 +++ 4 files changed, 59 insertions(+) create mode 100644 types/react-show-more/index.d.ts create mode 100644 types/react-show-more/react-show-more-tests.tsx create mode 100644 types/react-show-more/tsconfig.json create mode 100644 types/react-show-more/tslint.json diff --git a/types/react-show-more/index.d.ts b/types/react-show-more/index.d.ts new file mode 100644 index 0000000000..e5a467839d --- /dev/null +++ b/types/react-show-more/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for react-show-more +// Project: https://github.com/One-com/react-show-more +// Definitions by: Naor Torgeman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export interface ReactShowMoreProps { + lines?: number, + more?: string, + less?: string, + children?: string + anchorClass?: string +} + +declare const ShowMore: React.ClassicComponentClass; +export default ShowMore; \ No newline at end of file diff --git a/types/react-show-more/react-show-more-tests.tsx b/types/react-show-more/react-show-more-tests.tsx new file mode 100644 index 0000000000..f284f58bef --- /dev/null +++ b/types/react-show-more/react-show-more-tests.tsx @@ -0,0 +1,13 @@ +import ShowMore from 'react-show-more'; +import * as React from 'react'; + +let longText = "scenester Banksy single-origin coffee squid flannel XOXO chillwave Helvetica plaid slow-carb drinking vinegar Wes Anderson gastropub gluten-free Tonx you probably haven't heard of them sriracha Tumblr skateboard crucifix tousled pop-up tote bag asymmetrical Pitchfork DIY sartorial Thundercats mumblecore occupy Portland hella synth butcher Godard 8-bit fanny pack salvia organic stumptown High Life biodiesel letterpress aesthetic semiotics Shoreditch flexitarian irony fashion axe typewriter ethical sustainable Blue Bottle pork belly wayfarers heirloom Pinterest Vice raw denim cornhole kogi dreamcatcher church-key four loko cred selfies Etsy beard hashtag quinoa actually next level farm-to-table PBR&B cardigan blog leggings deep v cray locavore McSweeney's vinyl selvage photo booth Kickstarter freegan viral tofu hoodie jean shorts American Apparel ugh Schlitz PBR wolf Odd Future YOLO put a bird on it before they sold out pickled pour-over trust fund distillery Echo Park Cosby sweater seitan literally art party Williamsburg banh mi tattooed Intelligentsia ennui Brooklyn fap narwhal paleo mustache 3 wolf moon banjo yr pug forage mixtape keffiyeh direct trade Bushwick cliche small batch twee Neutra Marfa Carles kale chips VHS craft beer bespoke messenger bag roof party artisan mlkshk shabby chic chambray kitsch disrupt try-hard readymade post-ironic bicycle rights whatever meh street art fingerstache brunch lomo fixie master cleanse meggings keytar authentic gentrify chia 90's Truffaut iPhone umami food truck Austin +1 vegan swag bitters polaroid normcore retro lo-fi"; + + + {longText} + \ No newline at end of file diff --git a/types/react-show-more/tsconfig.json b/types/react-show-more/tsconfig.json new file mode 100644 index 0000000000..faea22ea33 --- /dev/null +++ b/types/react-show-more/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-show-more-tests.tsx" + ] +} diff --git a/types/react-show-more/tslint.json b/types/react-show-more/tslint.json new file mode 100644 index 0000000000..233d143cc0 --- /dev/null +++ b/types/react-show-more/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 2cbd2d0425450df0bcb8275c490ee4919983c814 Mon Sep 17 00:00:00 2001 From: Naor Torgeman Date: Tue, 12 Jun 2018 18:53:42 +0300 Subject: [PATCH 2/5] properties to be separated by ; --- types/react-show-more/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/react-show-more/index.d.ts b/types/react-show-more/index.d.ts index e5a467839d..d92ea22358 100644 --- a/types/react-show-more/index.d.ts +++ b/types/react-show-more/index.d.ts @@ -7,12 +7,12 @@ import * as React from 'react'; export interface ReactShowMoreProps { - lines?: number, - more?: string, - less?: string, - children?: string - anchorClass?: string + lines?: number; + more?: string; + less?: string; + children?: string; + anchorClass?: string; } declare const ShowMore: React.ClassicComponentClass; -export default ShowMore; \ No newline at end of file +export default ShowMore; From dbec62a9be80e00a49bbffe1a8161318d3483d7e Mon Sep 17 00:00:00 2001 From: Naor Torgeman Date: Tue, 12 Jun 2018 18:56:27 +0300 Subject: [PATCH 3/5] use const, and reduce longText length --- types/react-show-more/react-show-more-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-show-more/react-show-more-tests.tsx b/types/react-show-more/react-show-more-tests.tsx index f284f58bef..3bf6a583f7 100644 --- a/types/react-show-more/react-show-more-tests.tsx +++ b/types/react-show-more/react-show-more-tests.tsx @@ -1,7 +1,7 @@ import ShowMore from 'react-show-more'; import * as React from 'react'; -let longText = "scenester Banksy single-origin coffee squid flannel XOXO chillwave Helvetica plaid slow-carb drinking vinegar Wes Anderson gastropub gluten-free Tonx you probably haven't heard of them sriracha Tumblr skateboard crucifix tousled pop-up tote bag asymmetrical Pitchfork DIY sartorial Thundercats mumblecore occupy Portland hella synth butcher Godard 8-bit fanny pack salvia organic stumptown High Life biodiesel letterpress aesthetic semiotics Shoreditch flexitarian irony fashion axe typewriter ethical sustainable Blue Bottle pork belly wayfarers heirloom Pinterest Vice raw denim cornhole kogi dreamcatcher church-key four loko cred selfies Etsy beard hashtag quinoa actually next level farm-to-table PBR&B cardigan blog leggings deep v cray locavore McSweeney's vinyl selvage photo booth Kickstarter freegan viral tofu hoodie jean shorts American Apparel ugh Schlitz PBR wolf Odd Future YOLO put a bird on it before they sold out pickled pour-over trust fund distillery Echo Park Cosby sweater seitan literally art party Williamsburg banh mi tattooed Intelligentsia ennui Brooklyn fap narwhal paleo mustache 3 wolf moon banjo yr pug forage mixtape keffiyeh direct trade Bushwick cliche small batch twee Neutra Marfa Carles kale chips VHS craft beer bespoke messenger bag roof party artisan mlkshk shabby chic chambray kitsch disrupt try-hard readymade post-ironic bicycle rights whatever meh street art fingerstache brunch lomo fixie master cleanse meggings keytar authentic gentrify chia 90's Truffaut iPhone umami food truck Austin +1 vegan swag bitters polaroid normcore retro lo-fi"; +const longText = "scenester Banksy single-origin coffee squid flannel XOXO chillwave Helvetica plaid slow-carb drinking vinegar Wes Anderson gastropub"; {longText} - +;