]>
Commit | Line | Data |
---|---|---|
e4f97bab | 1 | import * as Sequelize from 'sequelize' |
7a7724e6 C |
2 | import * as Bluebird from 'bluebird' |
3 | import { FollowState } from '../../../shared/models/accounts/follow.model' | |
51548b31 C |
4 | import { ResultList } from '../../../shared/models/result-list.model' |
5 | import { AccountInstance } from './account-interface' | |
e4f97bab C |
6 | |
7 | export namespace AccountFollowMethods { | |
7a7724e6 | 8 | export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance> |
51548b31 C |
9 | |
10 | export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> > | |
11 | export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> > | |
12 | ||
13 | export type ListAcceptedFollowerUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> > | |
14 | export type ListAcceptedFollowingUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> > | |
e4f97bab C |
15 | } |
16 | ||
17 | export interface AccountFollowClass { | |
7a7724e6 | 18 | loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget |
51548b31 C |
19 | listFollowersForApi: AccountFollowMethods.ListFollowersForApi |
20 | listFollowingForApi: AccountFollowMethods.ListFollowingForApi | |
21 | ||
22 | listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi | |
23 | listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi | |
e4f97bab C |
24 | } |
25 | ||
26 | export interface AccountFollowAttributes { | |
27 | accountId: number | |
28 | targetAccountId: number | |
7a7724e6 | 29 | state: FollowState |
e4f97bab C |
30 | } |
31 | ||
32 | export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> { | |
33 | id: number | |
34 | createdAt: Date | |
35 | updatedAt: Date | |
51548b31 C |
36 | |
37 | AccountFollower?: AccountInstance | |
38 | AccountFollowing?: AccountInstance | |
e4f97bab C |
39 | } |
40 | ||
41 | export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {} |