0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

fix(config): expose correct types (#13388)

* fix(config): expose correct types

* feat: type tests

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
This commit is contained in:
Emanuele Stoppa 2025-03-10 16:41:02 +01:00 committed by GitHub
parent 249d52a3ff
commit afadc702d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes a bug where `astro:config/server` and `astro:config/client` had incorrect types.

View file

@ -193,14 +193,14 @@ declare module 'astro:config/server' {
// biome-ignore format: bug
type ServerConfigSerialized = import('./dist/types/public/manifest.js').ServerDeserializedManifest;
const manifest: ServerConfigSerialized;
export default manifest;
export = manifest;
}
declare module 'astro:config/client' {
// biome-ignore format: bug
type ClientConfigSerialized = import('./dist/types/public/manifest.js').ClientDeserializedManifest;
const manifest: ClientConfigSerialized;
export default manifest;
export = manifest;
}
declare module 'astro:components' {

View file

@ -0,0 +1,15 @@
import { expectTypeOf } from "expect-type";
import { describe, it } from "node:test";
import type { ServerDeserializedManifest, ClientDeserializedManifest } from "../../dist/types/public";
const server = null as typeof import("astro:config/server")
const client = null as typeof import("astro:config/client")
describe('astro:config', () => {
it('astro:config/server', () => {
expectTypeOf(server).toEqualTypeOf<ServerDeserializedManifest>();
})
it('astro:config/client', () => {
expectTypeOf(client).toEqualTypeOf<ClientDeserializedManifest>();
})
})