Skip to content

Commit

Permalink
feat: add ambient type declarations for Netlify.env (#428)
Browse files Browse the repository at this point in the history
🎉 Thanks for sending this pull request! 🎉

Please make sure the title is clear and descriptive.

If you are fixing a typo or documentation, please skip these
instructions.

Otherwise please fill in the sections below.

**Which problem is this pull request solving?**

Example: I'm always frustrated when [...]

**List other issues or pull requests related to this problem**

Example: This fixes #5012

**Describe the solution you've chosen**

Example: I've fixed this by [...]

**Describe alternatives you've considered**

Example: Another solution would be [...]

**Checklist**

Please add a `x` inside each checkbox:

- [ ] I have read the [contribution
guidelines](../blob/master/CONTRIBUTING.md).
- [ ] The status checks are successful (continuous integration). Those
can be seen below.
  • Loading branch information
lukasholzer authored Oct 5, 2023
1 parent 3270f5f commit 88e3e7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"description": "JavaScript utilities for Netlify Functions",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"types/**/*.d.ts"
],
"scripts": {
"build": "tsc",
Expand Down
6 changes: 6 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { getNetlifyGlobal } from '@netlify/serverless-functions-api'

// Ambient type declarations
declare global {
const Netlify: ReturnType<typeof getNetlifyGlobal>
}

0 comments on commit 88e3e7b

Please sign in to comment.