PeerTube/server/models/author-interface.ts

28 lines
827 B
TypeScript
Raw Normal View History

2017-05-22 18:58:25 +00:00
import * as Sequelize from 'sequelize'
2017-06-10 20:15:25 +00:00
import { PodInstance } from './pod-interface'
2017-05-22 18:58:25 +00:00
export namespace AuthorMethods {
2017-06-10 20:15:25 +00:00
export type FindOrCreateAuthorCallback = (err: Error, authorInstance?: AuthorInstance) => void
export type FindOrCreateAuthor = (name: string, podId: number, userId: number, transaction: Sequelize.Transaction, callback: FindOrCreateAuthorCallback) => void
2017-05-22 18:58:25 +00:00
}
export interface AuthorClass {
findOrCreateAuthor: AuthorMethods.FindOrCreateAuthor
}
export interface AuthorAttributes {
name: string
}
export interface AuthorInstance extends AuthorClass, AuthorAttributes, Sequelize.Instance<AuthorAttributes> {
id: number
createdAt: Date
updatedAt: Date
2017-06-10 20:15:25 +00:00
podId: number
Pod: PodInstance
2017-05-22 18:58:25 +00:00
}
export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {}