]>
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 | ||
efc32059 C |
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> > | |
e4f97bab C |
16 | } |
17 | ||
18 | export interface AccountFollowClass { | |
7a7724e6 | 19 | loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget |
51548b31 C |
20 | listFollowersForApi: AccountFollowMethods.ListFollowersForApi |
21 | listFollowingForApi: AccountFollowMethods.ListFollowingForApi | |
22 | ||
23 | listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi | |
24 | listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi | |
efc32059 | 25 | listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls |
e4f97bab C |
26 | } |
27 | ||
28 | export interface AccountFollowAttributes { | |
29 | accountId: number | |
30 | targetAccountId: number | |
7a7724e6 | 31 | state: FollowState |
e4f97bab C |
32 | } |
33 | ||
34 | export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> { | |
35 | id: number | |
36 | createdAt: Date | |
37 | updatedAt: Date | |
51548b31 C |
38 | |
39 | AccountFollower?: AccountInstance | |
40 | AccountFollowing?: AccountInstance | |
e4f97bab C |
41 | } |
42 | ||
43 | export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {} |