diff --git a/package.json b/package.json index 1c6c16e..df1d9ee 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "build": "tsc", - "start": "node dist/index.js", + "start": "tsc; node dist/index.js", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/src/types.ts b/src/types.ts index e69de29..1d1cfff 100644 --- a/src/types.ts +++ b/src/types.ts @@ -0,0 +1,34 @@ +namespace Carpool { + interface Group { + id: string; + member_ids: string[]; + } + + interface User { + id: string; + first_name: string; + last_name: string; + } + + interface Comment { + id: string; + body: string; + author_id: string; + } + + type Status = "pending" | "cancelled" | "completed" | "interrupted"; + + interface Post { + id: string; + title: string; + description: string; + participant_ids: string[]; + driver_id: string; + create_time: string; + update_time: string; + comments: Comment[]; + group_id: string; + status: Status; + capacity: number; + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 3e0d3c9..2e3b371 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { - "outDir": "dist/" + "outDir": "dist/", }, + "files": ["src/types.ts"], "include": ["src/"], "exclude": ["node_modules/"], } \ No newline at end of file