PeerTube/server/models/video/author-interface.ts

33 lines
758 B
TypeScript
Raw Normal View History

2017-05-22 13:58:25 -05:00
import * as Sequelize from 'sequelize'
import * as Promise from 'bluebird'
2017-05-22 13:58:25 -05:00
2017-06-16 02:45:46 -05:00
import { PodInstance } from '../pod'
2017-06-10 15:15:25 -05:00
2017-05-22 13:58:25 -05:00
export namespace AuthorMethods {
export type FindOrCreateAuthor = (
name: string,
podId: number,
userId: number,
transaction: Sequelize.Transaction
) => Promise<AuthorInstance>
2017-05-22 13:58:25 -05: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 15:15:25 -05:00
podId: number
Pod: PodInstance
2017-05-22 13:58:25 -05:00
}
export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {}