dochub-sdk 0.1.76 → 0.1.78

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.
@@ -108,11 +108,11 @@ export interface IDocHubDataLake {
108
108
  resolveURI(...uri: string[]): string;
109
109
  /**
110
110
  * Регистрирует редактор ресурсов
111
- * @param pattern - RegExp contentType ресурса
111
+ * @param pattern - RegExp contentType ресурса. Например: ^.*\/markdown($|;.*$)
112
112
  * @param component - VUE компонент для редактирования ресурса
113
113
  * @param title - Название редактора ресурса
114
114
  */
115
- registerEditor(pattern: string, component: IDocHubResourceEditorItem, title?: string);
115
+ registerEditor(pattern: string, component: IDocHubResourceEditorComponent, title?: string);
116
116
  /**
117
117
  * Возвращает массив зарегистрированных редакторов ресурсов
118
118
  * @returns - Массив зарегистрированных редакторов объектов
@@ -120,8 +120,23 @@ export interface IDocHubDataLake {
120
120
  fetchEditors(): Promise<IDocHubResourceEditorItem[]>;
121
121
  /**
122
122
  * Возвращает актуальный редактор для ресурса по contentType
123
- * @param contentType - Тип ресурса
123
+ * @param contentType - Тип контента. Например: text/markdown
124
124
  */
125
- getEditor(contentType: string): Promise<IDocHubResourceEditorItem>;
125
+ getEditor(contentType: string): Promise<IDocHubResourceEditorItem>;
126
+
127
+ /**
128
+ * Регистрирует соответствие шаблона файла типу контента.
129
+ * Зарегистрированная связь является приоритетной по отношению к возвращаемому заголовку content-type сервера.
130
+ * @param pathPattern - RegEx полного пути к файлу. Например: \.md$
131
+ * @param contentType - Тип контента, который соответствует шаблону файла. Например: text/markdown
132
+ */
133
+ registerFileContentType(pattern: string, contentType: string);
134
+
135
+ /**
136
+ * Возвращает тип контента по названию файла
137
+ * @param file - Полный путь к файлу. Например: README.md
138
+ * @returns - Тип контента. Например: text/markdown
139
+ */
140
+ getContentTypeForFile(file: string): string | null;
126
141
  }
127
142
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dochub-sdk",
3
- "version": "0.1.76",
3
+ "version": "0.1.78",
4
4
  "description": "The DocHub System Development Kit.",
5
5
  "private": false,
6
6
  "main": "index.ts",