PeerTube/server/models/account/account-follow-interface.ts

44 lines
2.1 KiB
TypeScript
Raw Normal View History

2017-11-09 10:51:58 -06:00
import * as Sequelize from 'sequelize'
2017-11-13 10:39:41 -06:00
import * as Bluebird from 'bluebird'
import { FollowState } from '../../../shared/models/accounts/follow.model'
import { ResultList } from '../../../shared/models/result-list.model'
import { AccountInstance } from './account-interface'
2017-11-09 10:51:58 -06:00
export namespace AccountFollowMethods {
2017-11-13 10:39:41 -06:00
export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance>
export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> >
export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> >
export type ListAcceptedFollowerUrlsForApi = (accountId: number[], start?: number, count?: number) => Promise< ResultList<string> >
export type ListAcceptedFollowingUrlsForApi = (accountId: number[], start?: number, count?: number) => Promise< ResultList<string> >
export type ListAcceptedFollowerSharedInboxUrls = (accountId: number[]) => Promise< ResultList<string> >
2017-11-09 10:51:58 -06:00
}
export interface AccountFollowClass {
2017-11-13 10:39:41 -06:00
loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget
listFollowersForApi: AccountFollowMethods.ListFollowersForApi
listFollowingForApi: AccountFollowMethods.ListFollowingForApi
listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi
listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi
listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls
2017-11-09 10:51:58 -06:00
}
export interface AccountFollowAttributes {
accountId: number
targetAccountId: number
2017-11-13 10:39:41 -06:00
state: FollowState
2017-11-09 10:51:58 -06:00
}
export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> {
id: number
createdAt: Date
updatedAt: Date
AccountFollower?: AccountInstance
AccountFollowing?: AccountInstance
2017-11-09 10:51:58 -06:00
}
export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {}