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

Squashed commit of the following:

commit acdddd728c56f25e42975db7f367ab8a998e8c41
Author: Princesseuh <3019731+Princesseuh@users.noreply.github.com>
Date:   Wed Jan 10 14:06:16 2024 -0500

    fix: proper type augment for the config

commit b41ca9aacf291d1e5f0a27b6d6339ce4fc608ec3
Author: Nate Moore <nate@astro.build>
Date:   Tue Jan 9 14:33:42 2024 -0600

    wip: type augmentation
This commit is contained in:
Nate Moore 2024-01-11 11:29:23 -06:00
parent 22c6d96514
commit 8d3ab37ac4
4 changed files with 18 additions and 4 deletions

View file

@ -1545,7 +1545,7 @@ export interface AstroUserConfig {
* @description
* TODO
*/
db?: object;
db?: Config.Database;
/**
* @docs
@ -2762,3 +2762,10 @@ declare global {
type Database = Record<string, any>;
}
}
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Config {
type Database = Record<string, any>;
}
}

4
packages/db/config-augment.d.ts vendored Normal file
View file

@ -0,0 +1,4 @@
declare namespace Config {
type DBUserConfig = import('./dist/config.js').DBUserConfig;
export interface Database extends DBUserConfig {}
}

2
packages/db/index.d.ts vendored Normal file
View file

@ -0,0 +1,2 @@
/// <reference types="./config-augment.d.ts" />
export type * from './dist/index.js';

View file

@ -4,11 +4,11 @@
"description": "",
"license": "MIT",
"type": "module",
"types": "./dist/index.d.ts",
"types": "./index.d.ts",
"author": "withastro",
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./index.d.ts",
"import": "./dist/index.js"
},
"./components": "./components/index.ts",
@ -24,7 +24,7 @@
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
"./index.d.ts"
],
"internal": [
"./dist/internal.d.ts"
@ -32,6 +32,7 @@
}
},
"files": [
"index.d.ts",
"dist",
"components"
],