Skip to content

Commit

Permalink
feat(typegen): Export type, not interface (#689)
Browse files Browse the repository at this point in the history
* change(typegen: TS): Export type, not interface

* change(typegen: TS): update tests
  • Loading branch information
isaacharrisholt authored Jan 31, 2024
1 parent ea6d1c8 commit 077a60d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/server/templates/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const apply = ({
let output = `
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]
export interface Database {
export type Database = {
${schemas
.sort(({ name: a }, { name: b }) => a.localeCompare(b))
.map((schema) => {
Expand Down
4 changes: 2 additions & 2 deletions test/server/typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('typegen', async () => {
| { [key: string]: Json | undefined }
| Json[]
export interface Database {
export type Database = {
public: {
Tables: {
category: {
Expand Down Expand Up @@ -462,7 +462,7 @@ test('typegen w/ one-to-one relationships', async () => {
| { [key: string]: Json | undefined }
| Json[]
export interface Database {
export type Database = {
public: {
Tables: {
category: {
Expand Down

0 comments on commit 077a60d

Please sign in to comment.