mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
absolutely massive typescript porting time
This commit is contained in:
parent
01f238f515
commit
30d08a630f
159 changed files with 2563 additions and 3861 deletions
14
packages/roleypoly-types/.lintstagedrc.yml
Normal file
14
packages/roleypoly-types/.lintstagedrc.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
linters:
|
||||
lib/*.{js,jsx}:
|
||||
- standard --fix
|
||||
- git add
|
||||
lib/*.d.ts:
|
||||
- tslint --fix
|
||||
- git add
|
||||
src/*.{ts,tsx}:
|
||||
- tslint --fix
|
||||
- stylelint --fix
|
||||
- jest --bail --findRelatedTests
|
||||
- git add
|
||||
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
// @flow
|
||||
export type Category = {
|
||||
export declare type Category = {
|
||||
hidden: boolean,
|
||||
name: string,
|
||||
roles: string[],
|
|
@ -1,21 +1,21 @@
|
|||
// @flow
|
||||
export type {
|
||||
declare module "@roleypoly/types"
|
||||
export {
|
||||
PresentableRole,
|
||||
CachedRole,
|
||||
Permissions
|
||||
} from './role'
|
||||
|
||||
export type {
|
||||
export {
|
||||
PresentableServer,
|
||||
ServerModel,
|
||||
ServerSlug
|
||||
} from './server'
|
||||
|
||||
export type {
|
||||
export {
|
||||
Category
|
||||
} from './category'
|
||||
|
||||
export type {
|
||||
export {
|
||||
UserPartial,
|
||||
Member
|
||||
} from './user'
|
|
@ -1,5 +1,13 @@
|
|||
{
|
||||
"name": "@roleypoly/types",
|
||||
"version": "2.0.0",
|
||||
"private": true
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"precommit": "lint-staged"
|
||||
},
|
||||
"devDependencies": {
|
||||
"lint-staged": "^8.1.7",
|
||||
"tslint": "^5.17.0",
|
||||
"typescript": "^3.5.1"
|
||||
}
|
||||
}
|
||||
|
|
2
packages/roleypoly-types/packages/moniker.d.ts
vendored
Normal file
2
packages/roleypoly-types/packages/moniker.d.ts
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
export declare module 'moniker';
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
// @flow
|
||||
|
||||
export type PresentableRole = {
|
||||
export declare type PresentableRole = {
|
||||
id: string,
|
||||
color: number,
|
||||
name: string,
|
||||
|
@ -8,14 +7,14 @@ export type PresentableRole = {
|
|||
safe: boolean
|
||||
}
|
||||
|
||||
export type Permissions = {
|
||||
export declare type Permissions = {
|
||||
canManageRoles: boolean,
|
||||
isAdmin: boolean,
|
||||
faked?: boolean,
|
||||
__faked?: Permissions
|
||||
}
|
||||
|
||||
export type CachedRole = {
|
||||
export declare type CachedRole = {
|
||||
id: string,
|
||||
position: number,
|
||||
color?: number
|
|
@ -1,15 +1,14 @@
|
|||
// @flow
|
||||
import type { Category } from './category'
|
||||
import type { PresentableRole, Permissions } from './role'
|
||||
import { Category } from './category'
|
||||
import { PresentableRole, Permissions } from './role'
|
||||
|
||||
export type ServerSlug = {
|
||||
export declare type ServerSlug = {
|
||||
id: string,
|
||||
name: string,
|
||||
ownerID: string,
|
||||
icon: string
|
||||
}
|
||||
|
||||
export type ServerModel = {
|
||||
export declare type ServerModel = {
|
||||
id: string,
|
||||
categories: {
|
||||
[uuid: string]: Category
|
||||
|
@ -17,7 +16,7 @@ export type ServerModel = {
|
|||
message: string
|
||||
}
|
||||
|
||||
export type PresentableServer = ServerModel & {
|
||||
export declare type PresentableServer = ServerModel & {
|
||||
id: string,
|
||||
gm?: {
|
||||
color?: number | string,
|
||||
|
@ -25,6 +24,6 @@ export type PresentableServer = ServerModel & {
|
|||
roles: string[]
|
||||
},
|
||||
server: ServerSlug,
|
||||
roles: ?PresentableRole[],
|
||||
roles?: PresentableRole[],
|
||||
perms: Permissions
|
||||
}
|
21
packages/roleypoly-types/sessions.d.ts
vendored
Normal file
21
packages/roleypoly-types/sessions.d.ts
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
export declare type BaseSession = {
|
||||
userId: string,
|
||||
expiresAt: number
|
||||
}
|
||||
|
||||
export declare type OAuthSession = BaseSession & {
|
||||
authType: 'oauth',
|
||||
accessToken: string,
|
||||
refreshToken: string
|
||||
}
|
||||
|
||||
export declare type DMSession = BaseSession & {
|
||||
authType: 'dm'
|
||||
}
|
||||
|
||||
export declare type AuthSession = OAuthSession | DMSession
|
||||
|
||||
export declare type Session = AuthSession & Partial<{
|
||||
|
||||
}>
|
3
packages/roleypoly-types/tslint.json
Normal file
3
packages/roleypoly-types/tslint.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "tslint-config-standard"
|
||||
}
|
13
packages/roleypoly-types/user.d.ts
vendored
Normal file
13
packages/roleypoly-types/user.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { Member as ErisMember } from 'eris'
|
||||
|
||||
export declare type UserPartial = {
|
||||
id: string,
|
||||
username: string,
|
||||
discriminator: string,
|
||||
avatar: string
|
||||
}
|
||||
|
||||
export declare type Member = ErisMember & {
|
||||
color?: number,
|
||||
__faked?: true
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
// @flow
|
||||
import type { Member as ErisMember } from 'eris'
|
||||
|
||||
export type UserPartial = {
|
||||
id: string,
|
||||
username: string,
|
||||
discriminator: string,
|
||||
avatar: string
|
||||
}
|
||||
|
||||
export type Member = ErisMember & {
|
||||
color?: number,
|
||||
__faked?: true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue