Skip to content

Commit

Permalink
Merge pull request crabbly#232 from samtsai/fix-es6-import
Browse files Browse the repository at this point in the history
Fix es6 import
  • Loading branch information
crabbly authored Sep 20, 2018
2 parents 8ba9e13 + cc4fa86 commit eda321f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ yarn add print-js
When installing via npm or yarn, import the library into your project:

```
import print from 'print-js'
import printJS from 'print-js'
```

## Documentation
Expand Down
54 changes: 27 additions & 27 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ import 'print-js/dist/print';
declare type PrintTypes = 'pdf' | 'html' | 'image' | 'json';

export interface Configuration {
printable: any;
fallbackPrintable?: string;
type?: string;
documentTitle?: string;
header?: any;
headerStyle?: string;
maxWidth?: number;
font?: string;
font_size?: string;
honorMarginPadding?: boolean;
honorColor?: boolean;
targetStyle?: string | string[];
targetStyles?: string | string[];
properties?: any;
gridHeaderStyle?: string;
gridStyle?: string;
showModal?: boolean;
onLoadingStart?: () => void;
onLoadingEnd?: () => void;
modalMessage?: string;
frameId?: string;
ignoreElements?: string | string[];
imageStyle?: string;
repeatTableHeader?: boolean;
css?: string | string[];
style?: string;
scanStyles?: boolean;
printable: any;
fallbackPrintable?: string;
type?: PrintTypes;
documentTitle?: string;
header?: any;
headerStyle?: string;
maxWidth?: number;
font?: string;
font_size?: string;
honorMarginPadding?: boolean;
honorColor?: boolean;
targetStyle?: string | string[];
targetStyles?: string | string[];
properties?: any;
gridHeaderStyle?: string;
gridStyle?: string;
showModal?: boolean;
onLoadingStart?: () => void;
onLoadingEnd?: () => void;
modalMessage?: string;
frameId?: string;
ignoreElements?: string | string[];
imageStyle?: string;
repeatTableHeader?: boolean;
css?: string | string[];
style?: string;
scanStyles?: boolean;
}

declare var printJS: (params: string | Configuration) => void;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "A tiny javascript library to help printing from the web.",
"version": "1.0.51",
"main": "dist/print.js",
"types": "./index.d.ts",
"repository": "https://github.com/crabbly/Print.js",
"license": "MIT",
"dependences": {},
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import './sass/index.scss'
import print from './js/init'

const printjs = print.init
const printJS = print.init

if (typeof window !== 'undefined') {
window.printJS = printjs
window.printJS = printJS
}

export default printjs
export default printJS
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'./src/index.js'
],
output: {
library: 'printJs',
library: 'printJS',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
filename: 'print.js',
Expand Down

0 comments on commit eda321f

Please sign in to comment.