Reorganize client shared modules
[oweals/peertube.git] / client / src / app / core / core.module.ts
1 import { HotkeyModule } from 'angular2-hotkeys'
2 import { MessageService } from 'primeng/api'
3 import { ToastModule } from 'primeng/toast'
4 import { CommonModule } from '@angular/common'
5 import { NgModule, Optional, SkipSelf } from '@angular/core'
6 import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
7 import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service'
8 import { HooksService } from '@app/core/plugins/hooks.service'
9 import { PluginService } from '@app/core/plugins/plugin.service'
10 import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service'
11 import { LoadingBarModule } from '@ngx-loading-bar/core'
12 import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'
13 import { LoadingBarRouterModule } from '@ngx-loading-bar/router'
14 import { AuthService } from './auth'
15 import { ConfirmService } from './confirm'
16 import { CheatSheetComponent } from './hotkeys'
17 import { MenuService } from './menu'
18 import { throwIfAlreadyLoaded } from './module-import-guard'
19 import { Notifier } from './notification'
20 import { HtmlRendererService, LinkifierService, MarkdownService } from './renderer'
21 import { RestExtractor, RestService } from './rest'
22 import { LoginGuard, RedirectService, UserRightGuard } from './routing'
23 import { CanDeactivateGuard } from './routing/can-deactivate-guard.service'
24 import { ServerConfigResolver } from './routing/server-config-resolver.service'
25 import { ServerService } from './server'
26 import { ThemeService } from './theme'
27 import { UserService } from './users'
28 import { LocalStorageService, ScreenService, SessionStorageService } from './wrappers'
29
30 @NgModule({
31   imports: [
32     CommonModule,
33     BrowserAnimationsModule,
34
35     LoadingBarHttpClientModule,
36     LoadingBarRouterModule,
37     LoadingBarModule,
38     ToastModule,
39
40     HotkeyModule.forRoot({
41       cheatSheetCloseEsc: true
42     })
43   ],
44
45   declarations: [
46     CheatSheetComponent
47   ],
48
49   exports: [
50     LoadingBarHttpClientModule,
51     LoadingBarModule,
52
53     ToastModule,
54
55     CheatSheetComponent
56   ],
57
58   providers: [
59     AuthService,
60     ConfirmService,
61     ServerService,
62     ThemeService,
63     MenuService,
64     LoginGuard,
65     UserRightGuard,
66     UnloggedGuard,
67
68     PluginService,
69     HooksService,
70
71     HtmlRendererService,
72     LinkifierService,
73     MarkdownService,
74
75     RestExtractor,
76     RestService,
77
78     UserService,
79
80     ScreenService,
81     LocalStorageService,
82     SessionStorageService,
83
84     RedirectService,
85     Notifier,
86     MessageService,
87     UserNotificationSocket,
88     ServerConfigResolver,
89     CanDeactivateGuard
90   ]
91 })
92 export class CoreModule {
93   constructor (@Optional() @SkipSelf() parentModule: CoreModule) {
94     throwIfAlreadyLoaded(parentModule, 'CoreModule')
95   }
96 }