@tinywork/glass 0.0.9 → 0.0.11

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 (2) hide show
  1. package/dist/index.d.ts +9 -6
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import path from 'node:path';
4
4
  import http from 'node:http';
5
5
  import https from 'node:https';
6
6
  import axios from 'axios';
7
- import { BrowserWindow } from 'electron';
7
+ import { BrowserWindow, type MenuItemConstructorOptions, type Session } from 'electron';
8
8
  export type DocSchema = {
9
9
  apiId: string;
10
10
  groupId: string;
@@ -41,20 +41,23 @@ export type NetLog = {
41
41
  query: string;
42
42
  };
43
43
  export interface IGlassContext {
44
- getItem?: <T>(key: string) => Promise<T>;
45
- setItem?: <T>(key: string, value: T) => Promise<void>;
44
+ getItem: <T>(key: string) => Promise<T>;
45
+ setItem: <T>(key: string, value: T) => Promise<void>;
46
46
  onItemChange?: <T>(key: string, cb: (params: {
47
47
  key: string;
48
48
  value: T;
49
49
  }) => void) => void;
50
- saveGroup?: (group: GroupSchema) => Promise<{
50
+ saveGroup: (group: GroupSchema) => Promise<{
51
51
  success: boolean;
52
52
  message?: string;
53
53
  }>;
54
- saveDoc?: (doc: DocSchema) => Promise<{
54
+ saveDoc: (doc: DocSchema) => Promise<{
55
55
  success: boolean;
56
56
  message?: string;
57
57
  }>;
58
+ registerMenu: (id: string, options: MenuItemConstructorOptions) => void;
59
+ unregisterMenu: (id: string) => void;
60
+ getSession: (id: string, isPersist?: boolean) => Session;
58
61
  }
59
62
  export interface IGlassExtension {
60
63
  install?(context: IGlassContext): Promise<void>;
@@ -88,4 +91,4 @@ export interface IGlassExtension {
88
91
  apiId: string;
89
92
  }>): Promise<void>;
90
93
  }
91
- export { fs, path, http, https, axios, BrowserWindow };
94
+ export { fs, path, http, https, axios, BrowserWindow, type Session };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinywork/glass",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [