Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Commit

Permalink
update(🚚): types
Browse files Browse the repository at this point in the history
  • Loading branch information
osamaqarem committed Jun 18, 2020
1 parent a458c14 commit 10c60ab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion template/.env.staging
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# You can generate types for this using generate-env-types npm script
ENV=STAGING
MOCK_EXAMPLE_API=NO
MOCK_EXAMPLE_API=YES
GITHUB_API_BASE_URL=https://api.github.com
SENTRY_DSN=
2 changes: 1 addition & 1 deletion template/scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const generate = () => {
export default Config
}`

fs.writeFileSync("env.d.ts", string, "utf8")
fs.writeFileSync("src\\common\\types\\env.d.ts", string, "utf8")
}

generate()
2 changes: 1 addition & 1 deletion template/env.d.ts → template/src/common/types/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare module "react-native-config" {
interface Env {
ENV: "DEVELOPMENT" | "STAGING" | "PRODUCTION"
MOCK_EXAMPLE_API: "YES" | "NO"
MOCK_EXAMPLE_API: "NO" | "YES"
GITHUB_API_BASE_URL: "https://api.github.com"
SENTRY_DSN: ""
}
Expand Down
2 changes: 2 additions & 0 deletions template/src/services/navigation/navigationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const navigationRef: any = React.createRef()
const ERROR_NOT_INIT =
"Navigation Service: attempting to navigate with an unintialized ref."

export type GetRouteParams<T extends keyof RootStackParamsList> = Pick<RootStackParamsList, T>[T]

/**
* Go to a screen using .navigate()
*/
Expand Down

0 comments on commit 10c60ab

Please sign in to comment.