forked from emartech/react-native-emarsys-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set up TypeScript declaration files generation
This process was based on a TypeScript official guide: https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html.
- Loading branch information
1 parent
f2951de
commit faad631
Showing
3 changed files
with
41 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
{ | ||
"name": "react-native-emarsys-wrapper", | ||
"version": "1.17.0", | ||
"description": "React Native wrapper for Emarsys SDK", | ||
"main": "index.js", | ||
"type": "module", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"react-native", | ||
"Emarsys" | ||
], | ||
"author": "emarsys", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"react": ">=17.0.2", | ||
"react-native": ">=0.67.3" | ||
} | ||
"name": "react-native-emarsys-wrapper", | ||
"version": "1.17.0", | ||
"description": "React Native wrapper for Emarsys SDK", | ||
"main": "index.js", | ||
"types": "typescript/index.d.ts", | ||
"type": "module", | ||
"scripts": { | ||
"prepare": "tsc", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"react-native", | ||
"Emarsys" | ||
], | ||
"author": "emarsys", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typescript": ">=3.7.2" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=17.0.2", | ||
"react-native": ">=0.67.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Tells TypeScript where to look for files to work with. | ||
"include": ["index.js", "src/**/*"], | ||
"compilerOptions": { | ||
// Tells TypeScript to read JS files, as normally they are ignored as source files. | ||
"allowJs": true, | ||
// Generate .d.ts files. | ||
"declaration": true, | ||
// This compiler run should only output .d.ts files. | ||
"emitDeclarationOnly": true, | ||
// Types should go into this directory. | ||
// Removing this option will place the .d.ts files next to their .js source files. | ||
"outDir": "typescript", | ||
// Generate declaration files to go to js file when using IDE functions like "Go to Definition". | ||
"declarationMap": true | ||
} | ||
} |