Skip to content

Commit 077a60d

Browse files
feat(typegen): Export type, not interface (#689)
* change(typegen: TS): Export type, not interface * change(typegen: TS): update tests
1 parent ea6d1c8 commit 077a60d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/server/templates/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const apply = ({
4444
let output = `
4545
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]
4646
47-
export interface Database {
47+
export type Database = {
4848
${schemas
4949
.sort(({ name: a }, { name: b }) => a.localeCompare(b))
5050
.map((schema) => {

test/server/typegen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('typegen', async () => {
1111
| { [key: string]: Json | undefined }
1212
| Json[]
1313
14-
export interface Database {
14+
export type Database = {
1515
public: {
1616
Tables: {
1717
category: {
@@ -462,7 +462,7 @@ test('typegen w/ one-to-one relationships', async () => {
462462
| { [key: string]: Json | undefined }
463463
| Json[]
464464
465-
export interface Database {
465+
export type Database = {
466466
public: {
467467
Tables: {
468468
category: {

0 commit comments

Comments
 (0)