@septkit/shell-lib 0.0.26 → 0.0.28

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, } from './shell-context';
3
+ export { setShellContext, clearShellContext, getProject, getActiveDocumentId, getCommands, getStorageSources, getPwa, } from './shell-context';
package/dist/index.js CHANGED
@@ -195,5 +195,11 @@ function m() {
195
195
  function h() {
196
196
  return l(u, { detail: "getCommands: shell context not set. Call setShellContext(api) before app.mount()." }), u.commands;
197
197
  }
198
+ function g() {
199
+ return l(u, { detail: "getStorageSources: shell context not set. Call setShellContext(api) before app.mount()." }), l(u.storageSources, { detail: "getStorageSources: no storage sources provided by the shell." }), u.storageSources;
200
+ }
201
+ function _() {
202
+ return l(u, { detail: "getPwa: shell context not set. Call setShellContext(api) before app.mount()." }), l(u.pwa, { detail: "getPwa: no PWA surface provided by the shell." }), u.pwa;
203
+ }
198
204
  //#endregion
199
- 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, f as clearShellContext, m as getActiveDocumentId, h as getCommands, p as getProject, a as isReservedDatabaseName, d as setShellContext };
205
+ 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, f as clearShellContext, m as getActiveDocumentId, h as getCommands, p as getProject, _ as getPwa, g as getStorageSources, a as isReservedDatabaseName, d as setShellContext };
@@ -1,13 +1,19 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
2
  import { Observable, ShellCommands } from './types/api';
3
+ import { PwaInstall } from './types/pwa-install';
4
+ import { StorageSources } from './types/storage-source';
3
5
  interface ShellContext {
4
6
  project: Scl.Project;
5
7
  activeDocumentId: Observable<string>;
6
8
  commands: ShellCommands;
9
+ storageSources?: StorageSources;
10
+ pwa?: PwaInstall;
7
11
  }
8
12
  export declare function setShellContext(ctx: ShellContext): void;
9
13
  export declare function clearShellContext(): void;
10
14
  export declare function getProject(): Scl.Project;
11
15
  export declare function getActiveDocumentId(): Observable<string>;
12
16
  export declare function getCommands(): ShellCommands;
17
+ export declare function getStorageSources(): StorageSources;
18
+ export declare function getPwa(): PwaInstall;
13
19
  export {};
@@ -1,4 +1,6 @@
1
1
  import { Scl } from '@dialecte/scl/v2019C1';
2
+ import { PwaInstall } from './pwa-install';
3
+ import { StorageSources } from './storage-source';
2
4
  export interface ShellCommands {
3
5
  activateDocument: (documentId: string) => Promise<void>;
4
6
  switchProject: (projectName: string) => Promise<void>;
@@ -13,4 +15,6 @@ export interface ExtensionAPI {
13
15
  activeFileName: Observable<string>;
14
16
  activeDocumentId: Observable<string>;
15
17
  commands: ShellCommands;
18
+ storageSources?: StorageSources;
19
+ pwa?: PwaInstall;
16
20
  }
@@ -1,2 +1,3 @@
1
1
  export type * from './api';
2
2
  export type * from './storage-source';
3
+ export type * from './pwa-install';
@@ -0,0 +1,6 @@
1
+ export interface PwaInstall {
2
+ isInstalled(): boolean;
3
+ canInstall(): boolean;
4
+ promptInstall(): Promise<boolean>;
5
+ onChange(listener: () => void): () => void;
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@septkit/shell-lib",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@dialecte/core": "0.4.12",
17
- "@dialecte/scl": "0.3.14"
17
+ "@dialecte/scl": "0.3.15"
18
18
  },
19
19
  "devDependencies": {
20
20
  "oxlint": "~1.6.0",