0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fix: move db ambient types to separate module (#10340)

* fix: move ambient types to separate modue

* chore: changeset
This commit is contained in:
Ben Holmes 2024-03-06 08:30:45 -05:00 committed by GitHub
parent 038201fbae
commit a60861c960
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 5 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/db": patch
---
Ensure `astro:db` types exist in your `db/config.ts` before running type generation.

View file

@ -1,5 +1,3 @@
export { default, cli } from './dist/index.js'; import './virtual.js';
declare module 'astro:db' { export { default, cli } from './dist/index.js';
export { defineTable, defineDB, column, sql, NOW, TRUE, FALSE } from './dist/index.js';
}

View file

@ -1,4 +1,3 @@
export type { ResolvedCollectionConfig, TableConfig } from './core/types.js'; export type { ResolvedCollectionConfig, TableConfig } from './core/types.js';
export { cli } from './core/cli/index.js'; export { cli } from './core/cli/index.js';
export { integration as default } from './core/integration/index.js'; export { integration as default } from './core/integration/index.js';
export { sql, NOW, TRUE, FALSE, defineDB, defineTable, column } from './runtime/config.js';

9
packages/db/virtual.d.ts vendored Normal file
View file

@ -0,0 +1,9 @@
declare module 'astro:db' {
export const sql: typeof import('./dist/runtime/config.js').sql;
export const NOW: typeof import('./dist/runtime/config.js').NOW;
export const TRUE: typeof import('./dist/runtime/config.js').TRUE;
export const FALSE: typeof import('./dist/runtime/config.js').FALSE;
export const column: typeof import('./dist/runtime/config.js').column;
export const defineDB: typeof import('./dist/runtime/config.js').defineDB;
export const defineTable: typeof import('./dist/runtime/config.js').defineTable;
}