Skip to content

Commit d973d33

Browse files
committed
chore: add typescript definition
1 parent 88c6550 commit d973d33

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.6.0",
44
"description": "Run prettier formatter with rollup",
55
"main": "dist/index.js",
6+
"types": "types/index.d.ts",
67
"author": "Mickael Jeanroy <mickael.jeanroy@gmail.com>",
78
"license": "MIT",
89
"repository": {
@@ -42,6 +43,7 @@
4243
"@babel/core": "7.8.7",
4344
"@babel/parser": "7.8.8",
4445
"@babel/preset-env": "7.8.7",
46+
"@types/prettier": "1.19.0",
4547
"eslint": "6.8.0",
4648
"eslint-config-google": "0.14.0",
4749
"fancy-log": "1.3.3",

types/index.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2017-2020 Mickael Jeanroy
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
import {Plugin} from 'rollup';
26+
import {Options} from 'prettier';
27+
28+
export interface RollupPrettierOptions extends Options {
29+
sourcemap?: boolean;
30+
}
31+
32+
export default function prettier(options?: RollupPrettierOptions): Plugin;

0 commit comments

Comments
 (0)