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 = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance>
10 export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
11 export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
13 export type ListAcceptedFollowerUrlsForApi = (accountId: number[], start?: number, count?: number) => Promise< ResultList<string> >
14 export type ListAcceptedFollowingUrlsForApi = (accountId: number[], start?: number, count?: number) => Promise< ResultList<string> >
15 export type ListAcceptedFollowerSharedInboxUrls = (accountId: number[]) => Promise< ResultList<string> >
16 export type ToFormattedJSON = (this: AccountFollowInstance) => AccountFollow
19 export interface AccountFollowClass {
20 loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget
21 listFollowersForApi: AccountFollowMethods.ListFollowersForApi
22 listFollowingForApi: AccountFollowMethods.ListFollowingForApi
24 listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi
25 listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi
26 listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls
29 export interface AccountFollowAttributes {
31 targetAccountId: number
35 export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> {
40 AccountFollower?: AccountInstance
41 AccountFollowing?: AccountInstance
43 toFormattedJSON: AccountFollowMethods.ToFormattedJSON
46 export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {}