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:
parent
5b1d700134
commit
519a5d84d1
2 changed files with 14 additions and 0 deletions
12
packages/astro/env.d.ts
vendored
Normal file
12
packages/astro/env.d.ts
vendored
Normal 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;
|
|
@ -15,6 +15,7 @@
|
||||||
"types": "./dist/types/@types/astro.d.ts",
|
"types": "./dist/types/@types/astro.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./astro.js",
|
".": "./astro.js",
|
||||||
|
"./env": "./env.d.ts",
|
||||||
"./app/node": "./dist/core/app/node.js",
|
"./app/node": "./dist/core/app/node.js",
|
||||||
"./client/*": "./dist/runtime/client/*",
|
"./client/*": "./dist/runtime/client/*",
|
||||||
"./components": "./components/index.js",
|
"./components": "./components/index.js",
|
||||||
|
@ -44,6 +45,7 @@
|
||||||
"components",
|
"components",
|
||||||
"dist",
|
"dist",
|
||||||
"astro.js",
|
"astro.js",
|
||||||
|
"env.d.ts",
|
||||||
"README.md",
|
"README.md",
|
||||||
"vendor"
|
"vendor"
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue