-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathplugins.api.feeds.ts
More file actions
37 lines (33 loc) · 1.44 KB
/
plugins.api.feeds.ts
File metadata and controls
37 lines (33 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { InjectionToken } from '.'
import { FeedRepository, FeedServiceRepository, FeedServiceType, FeedServiceTypeRepository } from '../entities/feeds/entities.feeds'
import { CreateFeed, DeleteFeed, UpdateFeed } from '../app.api/feeds/app.api.feeds'
interface LoadFeedServiceTypes {
(): Promise<FeedServiceType[]>
}
/**
* A plugin package that wishes to provide one or more [FeedServiceType]
* implementations must implement this interface in the top-level export of
* the package. For example,
* ```
* export = {
* // ... other plugin hooks
* feeds: {
* loadServiceTypes: () => Promise<FeedServiceType[]> {
* // resolve the service types
* }
* }
* }
*/
export interface FeedsPluginHooks {
feeds: {
readonly loadServiceTypes: LoadFeedServiceTypes
}
}
export const FeedServiceTypeRepositoryToken: InjectionToken<FeedServiceTypeRepository> = Symbol('InjectFeedServiceTypeRepository')
export const FeedServiceRepositoryToken: InjectionToken<FeedServiceRepository> = Symbol('InjectFeedServiceRepository')
export const FeedRepositoryToken: InjectionToken<FeedRepository> = Symbol('InjectFeedRepository')
export const FeedsAppServiceTokens = Object.freeze({
CreateFeed: Symbol('InjectFeedsAppServices.CreateFeed') as InjectionToken<CreateFeed>,
UpdateFeed: Symbol('InjectFeedsAppServices.UpdateFeed') as InjectionToken<UpdateFeed>,
DeleteFeed: Symbol('InjectFeedsAppServices.DeleteFeed') as InjectionToken<DeleteFeed>,
})