dochub-sdk 0.1.89 → 0.1.91

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.
@@ -10,7 +10,7 @@ import { IDocHubEventBus } from './eventbus';
10
10
  import { IDocHubRouter } from './router';
11
11
  import { IDocHubSettings } from './settings';
12
12
  import { IDocHubProblems } from './problems';
13
- import { DocHubEditMode } from './editors';
13
+ import { DocHubEditMode, IDocHubEditors } from './editors';
14
14
 
15
15
  /**
16
16
  * Интерфейс ядра
@@ -64,6 +64,10 @@ export interface IDocHubCore {
64
64
  * Внутренняя шина событий
65
65
  */
66
66
  eventBus: IDocHubEventBus;
67
+ /**
68
+ * Интерфейс взаимодействия с подсистемой редактирования
69
+ */
70
+ editors: IDocHubEditors;
67
71
  /**
68
72
  * Версия ядра
69
73
  * @returns - Версия ядра в формате *.*.*
@@ -141,7 +141,7 @@ export interface IDocHubDataLake {
141
141
  getFileEditor(contentType: string): Promise<IDocHubFileEditorItem | null>;
142
142
 
143
143
  /**
144
- * Запрос на открытие файла на пользовательское редактирование. Не обязательно будет выполнен.
144
+ * Запрос на открытие файла на пользовательское редактирование. Необязательно будет выполнен.
145
145
  * Если редактор уже открыт, активирует его.
146
146
  * @param uri - URI файла
147
147
  * @param context - Контекст редактирования файла. Необходим для связных редакторов и конструкторов.
@@ -42,10 +42,13 @@ export enum DocHubEditorType {
42
42
  object = 'object'
43
43
  }
44
44
 
45
+ export type DocHubContextUID = string;
46
+
45
47
  /**
46
48
  * Контекст редактора
47
49
  */
48
50
  export type DocHubEditorFileContext = {
51
+ uid: DocHubContextUID;
49
52
  type: DocHubEditorType.file,
50
53
  title?: string;
51
54
  meta: IDocHubFileEditorContext
@@ -55,6 +58,7 @@ export type DocHubEditorFileContext = {
55
58
  * Контекст редактора объекта
56
59
  */
57
60
  export type DocHubEditorObjectContext = {
61
+ uid: DocHubContextUID;
58
62
  type: DocHubEditorType.object,
59
63
  title?: string;
60
64
  meta: IDocHubObjectEditorContext
@@ -64,3 +68,15 @@ export type DocHubEditorObjectContext = {
64
68
  * Универсальный контекст редактора
65
69
  */
66
70
  export type DocHubEditorContext = DocHubEditorFileContext | DocHubEditorObjectContext;
71
+
72
+
73
+ /**
74
+ * Интерфейс взаимодействия с редакторами
75
+ */
76
+ export interface IDocHubEditors {
77
+ /**
78
+ * Возвращает текущий контекст редактирования
79
+ * @returns - Текущий контекст редактирования или null
80
+ */
81
+ getCurrentContext(): Promise<DocHubEditorContext | null>;
82
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dochub-sdk",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "description": "The DocHub System Development Kit.",
5
5
  "private": false,
6
6
  "main": "index.ts",