flowtyped everything, some functional, safety, and structural changes

This commit is contained in:
41666 2019-03-10 03:18:11 -05:00
parent 6f3eca7a64
commit d2aecb38ca
92 changed files with 17554 additions and 1440 deletions

View file

@ -1,4 +1,22 @@
module.exports = (sql, DataTypes) => {
// @flow
import type Sequelize, { DataTypes as DT } from 'sequelize'
export type Category = {
hidden: boolean,
name: string,
roles: string[],
type: 'single' | 'multi' | string
}
export type ServerModel = {
id: string,
categories: {
[uuid: string]: Category
},
message: string
}
export default (sql: Sequelize, DataTypes: DT) => {
return sql.define('server', {
id: { // discord snowflake
type: DataTypes.TEXT,