0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Add .d.ts file to astro package for language-tools consumption (#2711)

* Add .d.ts file for user and language-server consumption

* Update according to feedback
This commit is contained in:
Erika 2022-03-03 12:34:04 -05:00 committed by GitHub
parent 5b1d700134
commit 519a5d84d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

12
packages/astro/env.d.ts vendored Normal file
View file

@ -0,0 +1,12 @@
/// <reference types="vite/client" />
type Astro = import('./dist/types/@types/astro').AstroGlobal;
// We duplicate the description here because editors won't show the JSDoc comment from the imported type (but will for its properties, ex: Astro.request will show the AstroGlobal.request description)
/**
* Astro.* available in all components
* Docs: https://docs.astro.build/reference/api-reference/#astro-global
*/
declare const Astro: Readonly<Astro>;
declare const Fragment: any;

View file

@ -15,6 +15,7 @@
"types": "./dist/types/@types/astro.d.ts",
"exports": {
".": "./astro.js",
"./env": "./env.d.ts",
"./app/node": "./dist/core/app/node.js",
"./client/*": "./dist/runtime/client/*",
"./components": "./components/index.js",
@ -44,6 +45,7 @@
"components",
"dist",
"astro.js",
"env.d.ts",
"README.md",
"vendor"
],