@steroidsjs/core 3.0.0-beta.92 → 3.0.0-beta.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/components/ClientStorageComponent.d.ts +12 -18
  2. package/components/ClientStorageComponent.js +0 -16
  3. package/components/HtmlComponent.d.ts +26 -2
  4. package/components/HttpComponent.d.ts +98 -16
  5. package/components/HttpComponent.js +0 -9
  6. package/components/JwtHttpComponent.d.ts +20 -5
  7. package/components/JwtHttpComponent.js +4 -0
  8. package/components/LocaleComponent.d.ts +12 -12
  9. package/components/LocaleComponent.js +0 -2
  10. package/components/MetaComponent.d.ts +30 -93
  11. package/components/MetricsComponent.d.ts +20 -1
  12. package/components/MetricsComponent.js +4 -0
  13. package/components/ResourceComponent.d.ts +9 -15
  14. package/components/SocialComponent.d.ts +16 -1
  15. package/components/StoreComponent.d.ts +44 -1
  16. package/components/UiComponent.d.ts +8 -16
  17. package/components/WebSocketComponent.d.ts +66 -7
  18. package/components/WebSocketComponent.js +4 -0
  19. package/docs-autogen-result.json +13221 -10520
  20. package/en.json +81 -4
  21. package/hooks/useApplication.d.ts +22 -6
  22. package/hooks/useSaveCursorPosition.js +3 -0
  23. package/package.json +3 -3
  24. package/providers/ComponentsProvider.d.ts +10 -5
  25. package/ui/content/CalendarSystem/CalendarSystem.d.ts +16 -4
  26. package/ui/content/CalendarSystem/CalendarSystem.js +10 -15
  27. package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.d.ts +12 -0
  28. package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +85 -0
  29. package/ui/content/CalendarSystem/utils/utils.d.ts +3 -1
  30. package/ui/content/CalendarSystem/utils/utils.js +6 -1
  31. package/ui/form/EmailField/EmailField.d.ts +6 -0
  32. package/ui/form/EmailField/EmailField.js +44 -0
  33. package/ui/form/EmailField/hooks/useInputTypeEmail.d.ts +5 -0
  34. package/ui/form/EmailField/hooks/useInputTypeEmail.js +31 -0
  35. package/ui/form/EmailField/index.d.ts +2 -0
  36. package/ui/form/EmailField/index.js +7 -0
  37. package/ui/form/Field/Field.js +2 -1
  38. package/ui/form/InputField/InputField.d.ts +2 -2
  39. package/ui/form/InputField/InputField.js +7 -1
  40. package/ui/form/InputField/hooks/useInputFieldWarningByType.d.ts +3 -0
  41. package/ui/form/InputField/hooks/useInputFieldWarningByType.js +35 -0
  42. package/ui/form/NumberField/hooks/useInputTypeNumber.d.ts +1 -1
  43. package/ui/form/NumberField/hooks/useInputTypeNumber.js +9 -13
  44. package/ui/form/index.d.ts +3 -1
  45. package/ui/form/index.js +5 -2
@@ -1,7 +1,17 @@
1
+ export interface IClientStorageComponentConfig {
2
+ /**
3
+ * Кастомный домен
4
+ */
5
+ domain?: string;
6
+ /**
7
+ * Куки для режима ssr
8
+ */
9
+ ssrCookie?: any;
10
+ }
1
11
  /**
2
12
  * Интерфейс для ClientStorageComponent
3
13
  */
4
- export interface IClientStorageComponent {
14
+ export interface IClientStorageComponent extends IClientStorageComponentConfig {
5
15
  /**
6
16
  * Получить значение из хранилища.
7
17
  * @param name Имя записи.
@@ -14,7 +24,7 @@ export interface IClientStorageComponent {
14
24
  * @param name Имя записи.
15
25
  * @param value Значение записи.
16
26
  * @param storageName (Необязательный) Имя хранилища (local, session, или cookie).
17
- * @param expires (Необязательный) Срок действия записи в миллисекундах.
27
+ * @param expires (Необязательный) Срок действия записи в днях.
18
28
  */
19
29
  set(name: string, value: string, storageName?: 'local' | 'session' | 'cookie', expires?: number | null): void;
20
30
  /**
@@ -37,24 +47,8 @@ export default class ClientStorageComponent implements IClientStorageComponent {
37
47
  domain?: string;
38
48
  private _ssrCookie;
39
49
  constructor(components: any, config: any);
40
- /**
41
- * @param {string} name
42
- * @param {string} [storageName]
43
- * @returns {*}
44
- */
45
50
  get(name: any, storageName: any): any;
46
- /**
47
- * @param {string} name
48
- * @param {*} value
49
- * @param {string} [storageName]
50
- * @param {number|null} [expires]
51
- */
52
51
  set(name: any, value: any, storageName: any, expires?: any): void;
53
- /**
54
- *
55
- * @param {string} name
56
- * @param {string} [storageName]
57
- */
58
52
  remove(name: any, storageName: any): void;
59
53
  _getDomain(): string;
60
54
  }
@@ -64,11 +64,6 @@ var ClientStorageComponent = /** @class */ (function () {
64
64
  this.domain = (config === null || config === void 0 ? void 0 : config.domain) || null;
65
65
  this._ssrCookie = config === null || config === void 0 ? void 0 : config.ssrCookie;
66
66
  }
67
- /**
68
- * @param {string} name
69
- * @param {string} [storageName]
70
- * @returns {*}
71
- */
72
67
  ClientStorageComponent.prototype.get = function (name, storageName) {
73
68
  storageName = storageName || this.STORAGE_LOCAL;
74
69
  if (this.localStorageAvailable && storageName === this.STORAGE_LOCAL) {
@@ -80,12 +75,6 @@ var ClientStorageComponent = /** @class */ (function () {
80
75
  }
81
76
  return process.env.IS_SSR ? this._ssrCookie.get(name) : cookie.get(name);
82
77
  };
83
- /**
84
- * @param {string} name
85
- * @param {*} value
86
- * @param {string} [storageName]
87
- * @param {number|null} [expires]
88
- */
89
78
  ClientStorageComponent.prototype.set = function (name, value, storageName, expires) {
90
79
  if (expires === void 0) { expires = null; }
91
80
  storageName = storageName || this.STORAGE_LOCAL;
@@ -107,11 +96,6 @@ var ClientStorageComponent = /** @class */ (function () {
107
96
  process.env.IS_SSR ? this._ssrCookie.set(name, value, options) : cookie.set(name, value, options);
108
97
  }
109
98
  };
110
- /**
111
- *
112
- * @param {string} name
113
- * @param {string} [storageName]
114
- */
115
99
  ClientStorageComponent.prototype.remove = function (name, storageName) {
116
100
  storageName = storageName || this.STORAGE_LOCAL;
117
101
  if (this.localStorageAvailable && storageName === this.STORAGE_LOCAL) {
@@ -1,8 +1,32 @@
1
+ /// <reference types="react" />
2
+ export interface IHtmlComponent {
3
+ /**
4
+ * Утилита для создания css-классов по БЭМ
5
+ */
6
+ bem(blockName: string): any;
7
+ /**
8
+ * Метод для соединения нескольких classNames
9
+ */
10
+ classNames(...names: string[]): string;
11
+ /**
12
+ * Метод для добавления css-класса к элементу
13
+ * @param node Элемент, к которому нужно добавить класс
14
+ * @param className Название класса
15
+ */
16
+ addClass(node: React.ReactNode, className: string): void;
17
+ /**
18
+ * Метод для удаления css-класса у элемента
19
+ * @param node Элемент, у которого нужно удалить класс
20
+ * @param className Название класса
21
+ */
22
+ removeClass(node: React.ReactNode, className: string): void;
23
+ closest(element: any, className: string): any;
24
+ }
1
25
  /**
2
26
  * Html Component
3
27
  * Хелпер для работы с БЭМ классами и DOM элементами
4
28
  */
5
- export default class HtmlComponent {
29
+ export default class HtmlComponent implements IHtmlComponent {
6
30
  _instances: any;
7
31
  namespace: string;
8
32
  constructor(components: any);
@@ -11,5 +35,5 @@ export default class HtmlComponent {
11
35
  addClass(node: any, className: any): void;
12
36
  removeClass(node: any, className: any): void;
13
37
  closest(element: any, className: any): any;
14
- _applyModifiers(entity: any, modifiers: any): string;
38
+ private _applyModifiers;
15
39
  }
@@ -4,11 +4,102 @@ interface IHttpRequestOptions {
4
4
  onTwoFactor?: (providerName: string) => Promise<any>;
5
5
  responseType?: string;
6
6
  }
7
+ export interface IHttpComponentConfig {
8
+ /**
9
+ * Url для http запросов
10
+ */
11
+ apiUrl?: string;
12
+ /**
13
+ * Ключ для хранения токена в куках
14
+ */
15
+ accessTokenKey?: string;
16
+ /**
17
+ * Имя хранилища для токена (local, session, или cookie)
18
+ */
19
+ clientStorageName?: string;
20
+ /**
21
+ * Срок хранения токена в хранилище в днях
22
+ */
23
+ clientStorageExpiresIn?: number;
24
+ }
25
+ export interface IHttpComponent extends IHttpComponentConfig {
26
+ /**
27
+ * Получение конфига для axios
28
+ * @returns Конфиг для axios
29
+ */
30
+ getAxiosConfig(): Promise<any>;
31
+ /**
32
+ * Изменение csrf токена
33
+ * @param {string} value
34
+ */
35
+ setCsrfToken(value: string): void;
36
+ /**
37
+ * Удаление токена
38
+ */
39
+ removeAccessToken(): void;
40
+ /**
41
+ * Изменение токена
42
+ * @param {string} value
43
+ */
44
+ setAccessToken(value: string): any;
45
+ /**
46
+ * Получение токена
47
+ * @returns {string}
48
+ */
49
+ getAccessToken(): Promise<any>;
50
+ /**
51
+ * Сбросить конфиг
52
+ */
53
+ resetConfig(): void;
54
+ /**
55
+ * Метод, который можно вызвать при logout
56
+ */
57
+ onLogout(): void;
58
+ /**
59
+ * Метод, который можно вызвать при login
60
+ * @param {{accessToken: string}} params
61
+ */
62
+ onLogin(params: {
63
+ accessToken: string;
64
+ }): void;
65
+ /**
66
+ * Получение url по методу
67
+ * @param {string} method
68
+ * @returns {string} url
69
+ */
70
+ getUrl(method: string): string;
71
+ /**
72
+ * Получение экземпляра axios
73
+ * @returns Экземпляр axios
74
+ */
75
+ getAxiosInstance(): Promise<any>;
76
+ /**
77
+ * Вызов метода get
78
+ */
79
+ get(url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
80
+ /**
81
+ * Вызов метода post
82
+ */
83
+ post(url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
84
+ /**
85
+ * Вызов метода delete
86
+ */
87
+ delete(url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
88
+ /**
89
+ * Вызов http-метода
90
+ */
91
+ send(method: string, url: string, params?: Record<string, any>, options?: IHttpRequestOptions): any;
92
+ /**
93
+ * Метод, который вызывается после запроса
94
+ */
95
+ afterRequest(response: any, config: Record<string, any>, options: IHttpRequestOptions): Promise<any>;
96
+ [key: string]: any;
97
+ }
7
98
  /**
8
99
  * Http Component
9
100
  * Обертка над Axios для запросов на бекенд. Поддерживает токен авторизации, CSRF и обработку ошибок.
10
101
  */
11
- export default class HttpComponent {
102
+ export default class HttpComponent implements IHttpComponent {
12
103
  accessTokenKey: string;
13
104
  apiUrl: string;
14
105
  clientStorageName: string;
@@ -25,18 +116,9 @@ export default class HttpComponent {
25
116
  withCredentials: boolean;
26
117
  headers: any;
27
118
  }>;
28
- /**
29
- * @param {string} value
30
- */
31
- setCsrfToken(value: any): void;
119
+ setCsrfToken(value: string): void;
32
120
  removeAccessToken(): void;
33
- /**
34
- * @param {string} value
35
- */
36
- setAccessToken(value: any): void;
37
- /**
38
- * @returns {string}
39
- */
121
+ setAccessToken(value: string): void;
40
122
  getAccessToken(): Promise<any>;
41
123
  resetConfig(): void;
42
124
  onLogout(): void;
@@ -44,14 +126,14 @@ export default class HttpComponent {
44
126
  accessToken: string;
45
127
  }): void;
46
128
  getAxiosInstance(): Promise<any>;
47
- getUrl(method: any): any;
129
+ getUrl(method: string): string;
48
130
  get(url: any, params?: {}, options?: IHttpRequestOptions): any;
49
131
  post(url: any, params?: {}, options?: IHttpRequestOptions): any;
50
132
  delete(url: any, params?: {}, options?: IHttpRequestOptions): any;
51
133
  send(method: any, url: any, params?: {}, options?: IHttpRequestOptions): any;
52
- _send(method: any, config: any, options: IHttpRequestOptions): any;
53
- _sendAxios(config: any, options: IHttpRequestOptions): any;
134
+ private _send;
135
+ private _sendAxios;
54
136
  afterRequest(response: any, config: any, options: IHttpRequestOptions): any;
55
- _onTwoFactor(providerName: any): Promise<unknown>;
137
+ private _onTwoFactor;
56
138
  }
57
139
  export {};
@@ -133,9 +133,6 @@ var HttpComponent = /** @class */ (function () {
133
133
  });
134
134
  });
135
135
  };
136
- /**
137
- * @param {string} value
138
- */
139
136
  HttpComponent.prototype.setCsrfToken = function (value) {
140
137
  this._csrfToken = value;
141
138
  this.resetConfig();
@@ -145,17 +142,11 @@ var HttpComponent = /** @class */ (function () {
145
142
  this.resetConfig();
146
143
  this._components.clientStorage.remove(this.accessTokenKey, this.clientStorageName);
147
144
  };
148
- /**
149
- * @param {string} value
150
- */
151
145
  HttpComponent.prototype.setAccessToken = function (value) {
152
146
  this._accessToken = value;
153
147
  this.resetConfig();
154
148
  this._components.clientStorage.set(this.accessTokenKey, value, this.clientStorageName, this.clientStorageExpiresIn);
155
149
  };
156
- /**
157
- * @returns {string}
158
- */
159
150
  HttpComponent.prototype.getAccessToken = function () {
160
151
  return __awaiter(this, void 0, void 0, function () {
161
152
  var _a;
@@ -1,9 +1,24 @@
1
1
  import BaseHttpComponent from '@steroidsjs/core/components/HttpComponent';
2
- export default class JwtHttpComponent extends BaseHttpComponent {
3
- refreshTokenRequest: {
4
- url: string;
5
- method: string;
6
- };
2
+ export interface IRefreshTokenRequest {
3
+ url: string;
4
+ method: string;
5
+ }
6
+ export interface IJwtHttpComponentConfig {
7
+ /**
8
+ * Запрос на обновление токена авторизации
9
+ */
10
+ refreshTokenRequest?: IRefreshTokenRequest;
11
+ /**
12
+ * Ключ токена авторизации для локального хранилища
13
+ */
14
+ refreshTokenKey?: string;
15
+ }
16
+ /**
17
+ * JwtHttpComponent
18
+ * Вариация HttpComponent с функционалом обновления токена авторизации
19
+ */
20
+ export default class JwtHttpComponent extends BaseHttpComponent implements IJwtHttpComponentConfig {
21
+ refreshTokenRequest: IRefreshTokenRequest;
7
22
  refreshTokenKey: string;
8
23
  _refreshToken: any;
9
24
  constructor(components: any, config?: any);
@@ -57,6 +57,10 @@ exports.__esModule = true;
57
57
  var axios_1 = __importDefault(require("axios"));
58
58
  var HttpComponent_1 = __importDefault(require("@steroidsjs/core/components/HttpComponent"));
59
59
  var auth_1 = require("@steroidsjs/core/actions/auth");
60
+ /**
61
+ * JwtHttpComponent
62
+ * Вариация HttpComponent с функционалом обновления токена авторизации
63
+ */
60
64
  var JwtHttpComponent = /** @class */ (function (_super) {
61
65
  __extends(JwtHttpComponent, _super);
62
66
  function JwtHttpComponent(components, config) {
@@ -1,31 +1,33 @@
1
1
  import dayjs from 'dayjs';
2
2
  import 'dayjs/locale/it';
3
3
  import 'dayjs/locale/ru';
4
- /**
5
- * Интерфейс для LocaleComponent
6
- */
7
- export interface ILocaleComponent {
4
+ export interface ILocaleComponentConfig {
8
5
  /**
9
6
  * Разница времени с бекендом (в микросекундах)
10
7
  */
11
- backendTimeDiff: null;
8
+ backendTimeDiff?: null;
12
9
  /**
13
10
  * Временная зона бекенда
14
11
  */
15
- backendTimeZone: any;
12
+ backendTimeZone?: any;
16
13
  /**
17
14
  * Язык приложения
18
15
  * @example ru
19
16
  */
20
- language: string;
17
+ language?: string;
21
18
  /**
22
19
  * Исходный язык
23
20
  */
24
- sourceLanguage: string;
21
+ sourceLanguage?: string;
25
22
  /**
26
23
  * Переводы сообщений
27
24
  */
28
- translations: any;
25
+ translations?: any;
26
+ }
27
+ /**
28
+ * Интерфейс для LocaleComponent
29
+ */
30
+ export interface ILocaleComponent extends ILocaleComponentConfig {
29
31
  /**
30
32
  * Получение экземпляра `dayjs` с учетом временной зоны бекенда
31
33
  * @param date Дата
@@ -51,8 +53,6 @@ export interface ILocaleComponent {
51
53
  /**
52
54
  * Locale Component
53
55
  * Компонент для локализации приложения. Поддерживает конфигурацию языка и временной зоны
54
- *
55
- * Пример строки: `{__('{count} {count, plural, one{день} few{дня} many{дней}}', {count: 2})}`
56
56
  */
57
57
  export default class LocaleComponent implements ILocaleComponent {
58
58
  backendTimeDiff: null;
@@ -73,5 +73,5 @@ export default class LocaleComponent implements ILocaleComponent {
73
73
  dayjs(date?: string, format?: string): dayjs.Dayjs;
74
74
  t(message: any, params?: {}): any;
75
75
  translate(message: any, params?: {}): any;
76
- _pasteComponents(message: any, components: any): any;
76
+ private _pasteComponents;
77
77
  }
@@ -36,8 +36,6 @@ require("dayjs/locale/ru");
36
36
  /**
37
37
  * Locale Component
38
38
  * Компонент для локализации приложения. Поддерживает конфигурацию языка и временной зоны
39
- *
40
- * Пример строки: `{__('{count} {count, plural, one{день} few{дня} many{дней}}', {count: 2})}`
41
39
  */
42
40
  var LocaleComponent = /** @class */ (function () {
43
41
  function LocaleComponent(components, config) {
@@ -23,11 +23,37 @@ export interface ModelAttribute {
23
23
  fromStringConverter?: (value: string, type: string, item: any) => any;
24
24
  toStringConverter?: (value: any, type: string, item: any) => string | null;
25
25
  }
26
+ export interface IMetaComponent {
27
+ /**
28
+ * Изменить модель
29
+ */
30
+ setModel(name: string, item: Model): void;
31
+ /**
32
+ * Получить модель
33
+ */
34
+ getModel(name: string): Model;
35
+ /**
36
+ * Изменить тип
37
+ */
38
+ setType(name: string, config: Record<string, any>): void;
39
+ /**
40
+ * Получить тип
41
+ */
42
+ getType(name: string): any;
43
+ /**
44
+ * Форматирование названия модели
45
+ */
46
+ normalizeName(name: string): string;
47
+ /**
48
+ * Форматирование модели модели
49
+ */
50
+ normalizeModel(inputModel: Model, defaultModel: Model | any): Model;
51
+ }
26
52
  /**
27
53
  * Meta Component
28
54
  * Компонент для работы с мета-данными моделей и типами приложения (appType)
29
55
  */
30
- export default class MetaComponent {
56
+ export default class MetaComponent implements IMetaComponent {
31
57
  defaultPrimaryKey: string;
32
58
  defaultAttributeType: string;
33
59
  models: any;
@@ -36,101 +62,12 @@ export default class MetaComponent {
36
62
  constructor(components: any);
37
63
  setModel(name: string, item: Model): void;
38
64
  getModel(name: string): any;
39
- setType(name: any, config: any): void;
65
+ setType(name: string, config: Record<string, any>): void;
40
66
  getType(name: string): any;
41
- normalizeName(name: any): any;
67
+ normalizeName(name: string): string;
42
68
  normalizeModel(inputModel: Model, defaultModel?: Model | any): {
43
69
  primaryKey: any;
44
70
  attributes: any[];
45
71
  };
46
- _defaultTypes(): {
47
- autoTime: {
48
- jsType: string;
49
- field: string;
50
- formatter: string;
51
- };
52
- boolean: {
53
- jsType: string;
54
- field: string;
55
- formatter: string;
56
- };
57
- dateTime: {
58
- jsType: string;
59
- field: string;
60
- formatter: string;
61
- };
62
- date: {
63
- jsType: string;
64
- field: string;
65
- formatter: string;
66
- };
67
- double: {
68
- jsType: string;
69
- field: string;
70
- };
71
- email: {
72
- jsType: string;
73
- field: string;
74
- fieldProps: {
75
- type: string;
76
- };
77
- };
78
- enum: {
79
- jsType: string;
80
- field: string;
81
- formatter: string;
82
- };
83
- file: {
84
- jsType: string;
85
- field: string;
86
- };
87
- files: {
88
- jsType: string;
89
- field: string;
90
- fieldProps: {
91
- multiple: boolean;
92
- };
93
- };
94
- html: {
95
- jsType: string;
96
- field: string;
97
- };
98
- integer: {
99
- jsType: string;
100
- field: string;
101
- };
102
- password: {
103
- jsType: string;
104
- field: string;
105
- };
106
- phone: {
107
- jsType: string;
108
- field: string;
109
- fieldProps: {
110
- type: string;
111
- };
112
- };
113
- primaryKey: {
114
- jsType: string;
115
- field: string;
116
- fieldProps: {
117
- type: string;
118
- };
119
- searchFieldProps: {
120
- type: string;
121
- };
122
- };
123
- string: {
124
- jsType: string;
125
- field: string;
126
- };
127
- text: {
128
- jsType: string;
129
- field: string;
130
- };
131
- time: {
132
- jsType: string;
133
- field: string;
134
- };
135
- };
72
+ private _defaultTypes;
136
73
  }
@@ -17,7 +17,26 @@ type ConfigType = {
17
17
  };
18
18
  enable?: boolean;
19
19
  };
20
- export default class MetricsComponent {
20
+ export interface IMetricsComponent {
21
+ /**
22
+ * Отписаться от метрик
23
+ */
24
+ unsubscribe: VoidFunction;
25
+ /**
26
+ * Отменить прослушивание метрик
27
+ */
28
+ unlisten: VoidFunction;
29
+ /**
30
+ * Поменять счетчики
31
+ * @param values Значения
32
+ */
33
+ setCounters(values: any): void;
34
+ }
35
+ /**
36
+ * Metrics Component
37
+ * Компонент для добавления метрик в приложение (например яндекс метрики)
38
+ */
39
+ export default class MetricsComponent implements IMetricsComponent {
21
40
  _components: any;
22
41
  _prevUrl: string;
23
42
  _isMetricsInitialized: boolean;
@@ -6,6 +6,10 @@ exports.__esModule = true;
6
6
  var upperFirst_1 = __importDefault(require("lodash-es/upperFirst"));
7
7
  var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
8
8
  var auth_1 = require("../reducers/auth");
9
+ /**
10
+ * Metrics Component
11
+ * Компонент для добавления метрик в приложение (например яндекс метрики)
12
+ */
9
13
  var MetricsComponent = /** @class */ (function () {
10
14
  function MetricsComponent(components, config) {
11
15
  if (config === void 0) { config = {}; }
@@ -6,27 +6,21 @@ declare global {
6
6
  };
7
7
  }
8
8
  }
9
- export interface IResourceComponent {
9
+ export interface IResourceComponentConfig {
10
10
  /**
11
- * Свойство для хранения обратных вызовов.
12
- */
13
- _callbacks: any;
14
- /**
15
- * Свойство для хранения компонентов.
11
+ * API-ключ Google для использования Google Maps и других сервисов.
16
12
  */
17
- _components: any;
13
+ googleApiKey?: string;
18
14
  /**
19
- * API-ключ Google для использования Google Maps и других сервисов.
15
+ * Языковой код, используемый для загрузки ресурсов.
20
16
  */
21
- googleApiKey: string;
17
+ language?: string;
18
+ }
19
+ export interface IResourceComponent extends IResourceComponentConfig {
22
20
  /**
23
21
  * Ключ сайта Google reCAPTCHA.
24
22
  */
25
23
  googleCaptchaSiteKey: string;
26
- /**
27
- * Языковой код, используемый для загрузки ресурсов.
28
- */
29
- language: string;
30
24
  /**
31
25
  * URL для загрузки Google Maps API.
32
26
  */
@@ -93,8 +87,8 @@ export interface IResourceComponent {
93
87
  * Компонент для подгрузки внешних API: Google Maps, Yandex Maps, Twitter, ...
94
88
  */
95
89
  export default class ResourceComponent implements IResourceComponent {
96
- _callbacks: any;
97
- _components: any;
90
+ private _callbacks;
91
+ private _components;
98
92
  googleApiKey: string;
99
93
  googleCaptchaSiteKey: string;
100
94
  language: string;
@@ -1,8 +1,23 @@
1
+ export interface ISocialComponent {
2
+ /**
3
+ * Провайдеры
4
+ */
5
+ providers: any;
6
+ /**
7
+ * Старт
8
+ * @param socialName Название social
9
+ */
10
+ start(socialName: string): void;
11
+ /**
12
+ * Инициализация компонента
13
+ */
14
+ init(): void;
15
+ }
1
16
  /**
2
17
  * Social Component
3
18
  * Провайдер для социальных сетей. Обеспечивает вызов окна соц сети для oauth авторизации
4
19
  */
5
- export default class SocialComponent {
20
+ export default class SocialComponent implements ISocialComponent {
6
21
  _components: any;
7
22
  _initializing: any;
8
23
  providers: any;