Skip to content

Commit

Permalink
Attempt to make a types package
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Feb 26, 2024
1 parent 662ac55 commit 08d11e7
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
19 changes: 19 additions & 0 deletions types/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@oengusio/types",
"version": "1.0.0",
"description": "Javascript API typings for the oengus API",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/esamarathon/oengus-webapp.git"
},
"author": "duncte123",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/esamarathon/oengus-webapp/issues"
},
"homepage": "https://github.com/esamarathon/oengus-webapp#readme"
}
12 changes: 12 additions & 0 deletions types/src/Profile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import SocialAccount from './SocialAccount';

export default interface Profile {
id: number;
username: string;
displayName: string;
enabled: boolean;
pronouns: string[];
languagesSpoken: string[];
connections: SocialAccount[];
country: string;
}
19 changes: 19 additions & 0 deletions types/src/SocialAccount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export type ConnectionPlatform =
'DISCORD' |
'EMAIL' |
'FACEBOOK' |
'INSTAGRAM' |
'PHONE' |
'NICO' |
'MASTODON' |
'SNAPCHAT' |
'SPEEDRUNCOM' |
'TWITCH' |
'TWITTER' |
'YOUTUBE';

export default interface SocialAccount {
id?: number;
platform: ConnectionPlatform | string;
username: string;
}
Empty file added types/src/index.ts
Empty file.
22 changes: 22 additions & 0 deletions types/src/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import SocialAccount from './SocialAccount';

/**
* @deprecated should be replaced with profile instead
*/
export default interface User {
id: number;
username: string;
displayName: string;
mail: string;
// stored as comma seperated list in db
pronouns: string;
languagesSpoken: string;
country: string;
roles: string[];
connections: SocialAccount[];
enabled: boolean;
discordId: number;
twitterId: string;
twitchId: string;
patreonId: string;
}

0 comments on commit 08d11e7

Please sign in to comment.