diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..4f6e634 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,28 @@ +// Definitions Info: https://templecoding.com/blog/2016/03/31/creating-typescript-typings-for-existing-react-components + +// allow the use of the ZingChart default library and +// its global variable 'zingchart' +declare module 'zingchart/es6'; + +// define the zingchart-react wrapper definition +declare module 'zingchart-react' { + // import React for reference + import * as React from 'react'; + // import the component + import ZingChart from 'zingchart-react'; + + // define interface for props + interface ZingChartReactProps { + data?: Object; + id?: String; + series?: Array; + width?: String | Number; + height?: String | Number; + theme?: Object; + output?: String; + } + + class ZingChart extends React.Component {} + + export default ZingChart; +} diff --git a/package.json b/package.json index 06557d2..49727ba 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,8 @@ "files": [ "dist" ], + "typesUrl": "https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html", + "types": "No Definition here as .d.ts file lives inside of dist folder as defined by files config", "dependencies": { "zingchart": "latest", "zingchart-constants": "github:zingchart/zingchart-constants#master"