1 import * as Bluebird from 'bluebird'
2 import * as Sequelize from 'sequelize'
3 import { AccountFollow, FollowState } from '../../../shared/models/accounts/follow.model'
4 import { ResultList } from '../../../shared/models/result-list.model'
5 import { AccountInstance } from './account-interface'
7 export namespace AccountFollowMethods {
8 export type LoadByAccountAndTarget = (
10 targetAccountId: number,
11 t?: Sequelize.Transaction
12 ) => Bluebird<AccountFollowInstance>
14 export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
15 export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
17 export type ListAcceptedFollowerUrlsForApi = (
19 t: Sequelize.Transaction,
22 ) => Promise< ResultList<string> >
23 export type ListAcceptedFollowingUrlsForApi = (
25 t: Sequelize.Transaction,
28 ) => Promise< ResultList<string> >
29 export type ListAcceptedFollowerSharedInboxUrls = (accountId: number[], t: Sequelize.Transaction) => Promise< ResultList<string> >
30 export type ToFormattedJSON = (this: AccountFollowInstance) => AccountFollow
33 export interface AccountFollowClass {
34 loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget
35 listFollowersForApi: AccountFollowMethods.ListFollowersForApi
36 listFollowingForApi: AccountFollowMethods.ListFollowingForApi
38 listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi
39 listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi
40 listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls
43 export interface AccountFollowAttributes {
45 targetAccountId: number
49 export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> {
54 AccountFollower?: AccountInstance
55 AccountFollowing?: AccountInstance
57 toFormattedJSON: AccountFollowMethods.ToFormattedJSON
60 export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {}