1 | 'use strict'
|
2 |
|
3 | const BaseTelegramDataSource = require('./BaseTelegramDataSource')
|
4 |
|
5 | class TelegramDataSource extends BaseTelegramDataSource {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | constructor(api, router, logger, sessionStorage, localization, ipc) {
|
16 | super()
|
17 |
|
18 | this._api = api
|
19 | this._router = router
|
20 | this._logger = logger
|
21 | this._scopeExtensions = []
|
22 | this._sessionStorage = sessionStorage
|
23 | this._localization = localization
|
24 | this._ipc = ipc
|
25 | }
|
26 |
|
27 | |
28 |
|
29 |
|
30 |
|
31 | get api() {
|
32 | return this._api
|
33 | }
|
34 |
|
35 | |
36 |
|
37 |
|
38 |
|
39 | get router() {
|
40 | return this._router
|
41 | }
|
42 |
|
43 | |
44 |
|
45 |
|
46 |
|
47 | get logger() {
|
48 | return this._logger
|
49 | }
|
50 |
|
51 | |
52 |
|
53 |
|
54 |
|
55 | get scopeExtensions() {
|
56 | return this._scopeExtensions
|
57 | }
|
58 |
|
59 | |
60 |
|
61 |
|
62 |
|
63 | get sessionStorage() {
|
64 | return this._sessionStorage
|
65 | }
|
66 |
|
67 | |
68 |
|
69 |
|
70 |
|
71 | get localization() {
|
72 | return this._localization
|
73 | }
|
74 |
|
75 | |
76 |
|
77 |
|
78 | get ipc() {
|
79 | return this._ipc
|
80 | }
|
81 |
|
82 | |
83 |
|
84 |
|
85 |
|
86 | addScopeExtension(extension) {
|
87 | if (Array.isArray(extension)) {
|
88 | extension.forEach(this._scopeExtensions.push)
|
89 |
|
90 | return
|
91 | }
|
92 |
|
93 | this._scopeExtensions.push(extension)
|
94 | }
|
95 | }
|
96 |
|
97 | module.exports = TelegramDataSource |
\ | No newline at end of file |