From 8923a6f900e248fd507693cb9429b18980415d63 Mon Sep 17 00:00:00 2001 From: Carbon Copy Date: Wed, 2 Oct 2019 02:56:31 +1000 Subject: [PATCH 1/2] Specify Partial --- index.d.ts | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/index.d.ts b/index.d.ts index c3a39a7..25d9877 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,24 +1,26 @@ -import * as React from 'react' -import { default as tippyCore, Instance, Props, Plugin } from 'tippy.js' +import * as React from 'react'; +import {default as tippyCore, Instance, Props, Plugin} from 'tippy.js'; -type Omit = Pick> +type Omit = Pick>; -export interface TippyProps extends Omit { - content: React.ReactChild | React.ReactChild[] - children: React.ReactElement - visible?: boolean - enabled?: boolean - className?: string - plugins?: Plugin[] +export interface TippyProps extends Omit, 'content'> { + content: React.ReactChild | React.ReactChild[]; + children: React.ReactElement; + visible?: boolean; + enabled?: boolean; + className?: string; + plugins?: Plugin[]; } -declare const Tippy: React.ForwardRefExoticComponent -export default Tippy +declare const Tippy: React.ForwardRefExoticComponent; +export default Tippy; -export const tippy: typeof tippyCore +export const tippy: typeof tippyCore; export interface TippySingletonProps extends Props { - children: Array> + children: Array>; } -export const TippySingleton: React.FunctionComponent +export const TippySingleton: React.FunctionComponent< + Partial +>; From e64a8b11ce83445f97cf48525982417db706561a Mon Sep 17 00:00:00 2001 From: Carbon Copy Date: Wed, 2 Oct 2019 03:05:59 +1000 Subject: [PATCH 2/2] Bump TS dep & fix Partial usage --- index.d.ts | 8 ++------ package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/index.d.ts b/index.d.ts index 25d9877..7c62399 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,8 +1,6 @@ import * as React from 'react'; import {default as tippyCore, Instance, Props, Plugin} from 'tippy.js'; -type Omit = Pick>; - export interface TippyProps extends Omit, 'content'> { content: React.ReactChild | React.ReactChild[]; children: React.ReactElement; @@ -17,10 +15,8 @@ export default Tippy; export const tippy: typeof tippyCore; -export interface TippySingletonProps extends Props { +export interface TippySingletonProps extends Partial { children: Array>; } -export const TippySingleton: React.FunctionComponent< - Partial ->; +export const TippySingleton: React.FunctionComponent; diff --git a/package-lock.json b/package-lock.json index 12061fd..e7e6806 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14389,9 +14389,9 @@ "dev": true }, "typescript": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", - "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz", + "integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index f674947..9d2c7f7 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "rollup-plugin-node-resolve": "^4.0.0", "rollup-plugin-replace": "^2.2.0", "rollup-plugin-terser": "^4.0.4", - "typescript": "^3.3.3" + "typescript": "^3.6.3" }, "directories": { "test": "test"