@septkit/shell-lib 0.0.41 → 0.0.43

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.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export type * from './types';
2
2
  export { SHELL_DB_PREFIX, LIBRARY_DB_PREFIX, TEMP_DOCUMENT_PREFIX, TEMP_PROJECT_PREFIX, RESERVED_DB_PREFIXES, isReservedDatabaseName, } from './constants';
3
- export { setShellContext, clearShellContext, getProject, getActiveDocumentId, getCommands, getStorageSources, getPwa, getProjectStorage, } from './shell-context';
3
+ export { setShellContext, clearShellContext, getProject, getActiveDocumentId, getCommands, getStorageSources, getPwa, getProjectStorage, getTasks, } from './shell-context';
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ function a(e) {
9
9
  return i.some((t) => e.startsWith(t));
10
10
  }
11
11
  //#endregion
12
- //#region node_modules/.pnpm/@dialecte+core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js
12
+ //#region node_modules/.pnpm/@dialecte+core@0.14.0/node_modules/@dialecte/core/dist/utils-9L5_yIvs.js
13
13
  var o = "https://dialecte.github.io/core", s = /* @__PURE__ */ new Set([
14
14
  "throwDialecteError",
15
15
  "createDialecteError",
@@ -1335,5 +1335,19 @@ function Q() {
1335
1335
  function $() {
1336
1336
  return G?.projectStorage ?? { type: "local" };
1337
1337
  }
1338
+ function ee() {
1339
+ return G?.tasks ?? te;
1340
+ }
1341
+ var te = { begin: function() {
1342
+ return {
1343
+ id: "unshown",
1344
+ signal: new AbortController().signal,
1345
+ report: function() {},
1346
+ endFile: function() {},
1347
+ finish: function() {},
1348
+ cancel: function() {},
1349
+ fail: function() {}
1350
+ };
1351
+ } };
1338
1352
  //#endregion
1339
- export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX, q as clearShellContext, Y as getActiveDocumentId, X as getCommands, J as getProject, $ as getProjectStorage, Q as getPwa, Z as getStorageSources, a as isReservedDatabaseName, K as setShellContext };
1353
+ export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX, q as clearShellContext, Y as getActiveDocumentId, X as getCommands, J as getProject, $ as getProjectStorage, Q as getPwa, Z as getStorageSources, ee as getTasks, a as isReservedDatabaseName, K as setShellContext };
@@ -1,5 +1,6 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
2
  import { Observable, ShellCommands } from './types/api';
3
+ import { BackgroundTasks } from './types/background-tasks';
3
4
  import { ProjectStorage } from './types/project-storage';
4
5
  import { PwaInstall } from './types/pwa-install';
5
6
  import { StorageSources } from './types/storage-source';
@@ -10,6 +11,7 @@ interface ShellContext {
10
11
  storageSources?: StorageSources;
11
12
  pwa?: PwaInstall;
12
13
  projectStorage?: ProjectStorage;
14
+ tasks?: BackgroundTasks;
13
15
  }
14
16
  export declare function setShellContext(ctx: ShellContext): void;
15
17
  export declare function clearShellContext(): void;
@@ -19,4 +21,5 @@ export declare function getCommands(): ShellCommands;
19
21
  export declare function getStorageSources(): StorageSources;
20
22
  export declare function getPwa(): PwaInstall;
21
23
  export declare function getProjectStorage(): ProjectStorage;
24
+ export declare function getTasks(): BackgroundTasks;
22
25
  export {};
@@ -1,4 +1,5 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
+ import { BackgroundTasks } from './background-tasks';
2
3
  import { ProjectStorage } from './project-storage';
3
4
  import { PwaInstall } from './pwa-install';
4
5
  import { StorageSources } from './storage-source';
@@ -19,4 +20,5 @@ export interface ExtensionAPI {
19
20
  storageSources?: StorageSources;
20
21
  pwa?: PwaInstall;
21
22
  projectStorage?: ProjectStorage;
23
+ tasks?: BackgroundTasks;
22
24
  }
@@ -0,0 +1,34 @@
1
+ export type TaskDiagnostic = {
2
+ key?: string;
3
+ message: string;
4
+ };
5
+ export type TaskReport = {
6
+ step: string;
7
+ done?: number;
8
+ total?: number;
9
+ fileIndex?: number;
10
+ fileCount?: number;
11
+ fileName?: string;
12
+ };
13
+ export type TaskFileEnd = {
14
+ fileIndex: number;
15
+ state: 'done' | 'failed' | 'cancelled';
16
+ diagnostics?: TaskDiagnostic[];
17
+ };
18
+ export type BeginTaskParams = {
19
+ kind: string;
20
+ title: string;
21
+ files?: string[];
22
+ };
23
+ export type TaskHandle = {
24
+ id: string;
25
+ signal: AbortSignal;
26
+ report: (report: TaskReport) => void;
27
+ endFile: (end: TaskFileEnd) => void;
28
+ finish: () => void;
29
+ cancel: () => void;
30
+ fail: (error: unknown) => void;
31
+ };
32
+ export type BackgroundTasks = {
33
+ begin: (params: BeginTaskParams) => TaskHandle;
34
+ };
@@ -2,3 +2,4 @@ export type * from './api';
2
2
  export type * from './storage-source';
3
3
  export type * from './pwa-install';
4
4
  export type * from './project-storage';
5
+ export type * from './background-tasks';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@septkit/shell-lib",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@dialecte/core": "0.12.1",
17
- "@dialecte/scl": "0.24.0"
16
+ "@dialecte/core": "0.14.0",
17
+ "@dialecte/scl": "0.27.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "oxlint": "~1.6.0",