blob: 6f228c790a7d1f1e00ee735894e0d9e2a3f1434e (
plain) (
tree)
|
|
import * as Bluebird from 'bluebird'
import * as Sequelize from 'sequelize'
import { AccountFollow, FollowState } from '../../../shared/models/accounts/follow.model'
import { ResultList } from '../../../shared/models/result-list.model'
import { AccountInstance } from './account-interface'
export namespace AccountFollowMethods {
export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance>
export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
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> >
export type ToFormattedJSON = (this: AccountFollowInstance) => AccountFollow
}
export interface AccountFollowClass {
loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget
listFollowersForApi: AccountFollowMethods.ListFollowersForApi
listFollowingForApi: AccountFollowMethods.ListFollowingForApi
listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi
listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi
listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls
}
export interface AccountFollowAttributes {
accountId: number
targetAccountId: number
state: FollowState
}
export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> {
id: number
createdAt: Date
updatedAt: Date
AccountFollower?: AccountInstance
AccountFollowing?: AccountInstance
toFormattedJSON: AccountFollowMethods.ToFormattedJSON
}
export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {}
|