Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript compiler validation of lib/index.d.ts #784

Merged
merged 3 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

declare module "react-native-firebase" {

/** 3rd party provider Credentials */
type AuthCredential = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielw93 All types here should better be interfaces

providerId: string,
token: string,
secret: string
}

type FirebaseModuleAndStatics<M, S = {}> = {
(): M;
nativeModuleExists: boolean;
Expand Down Expand Up @@ -631,13 +638,6 @@ declare module "react-native-firebase" {
updateProfile(updates: UpdateProfile): Promise<void>
}

/** 3rd party provider Credentials */
type AuthCredential = {
providerId: string,
token: string,
secret: string
}

type ActionCodeSettings = {
android: {
installApp?: boolean,
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"build": "genversion lib/version.js && npm run build-lib && npm run build-flow",
"build-flow": "flow-copy-source -i */__tests__* lib dist",
"build-lib": "BABEL_ENV=publish babel lib -d dist --ignore __tests__ --copy-files",
"build-lib": "npm run validate-ts-declarations && BABEL_ENV=publish babel lib -d dist --ignore __tests__ --copy-files",
"clean": "rimraf dist/",
"flow": "flow",
"format": "eslint --fix ./lib ./tests/src ./tests/lib",
Expand All @@ -21,7 +21,8 @@
"tests-npm-install": "cd tests && npm install",
"tests-pod-install": "cd tests && npm run ios:pod:install",
"tests-watch-start": "npm run test-cli watch init start",
"tests-watch-stop": "npm run test-cli watch stop"
"tests-watch-stop": "npm run test-cli watch stop",
"validate-ts-declarations": "tsc --project ./"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -101,6 +102,7 @@
"react-native": "^0.52.0",
"rimraf": "^2.6.2",
"shelljs": "^0.7.8",
"typescript": "^2.6.2",
"wml": "0.0.82"
},
"dependencies": {
Expand Down
25 changes: 25 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"jsx": "react",
"sourceMap": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"lib": [
"es2015",
"es2016",
"esnext",
"dom"
]
},
"files": [
"./lib/index.d.ts"
]
}