@tinywork/glass 0.0.23 → 0.0.25

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 +22 -8
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -7,12 +7,22 @@ import querystring from 'node:querystring';
7
7
  import axios from 'axios';
8
8
  import { BrowserWindow, type MenuItemConstructorOptions, type Session } from 'electron';
9
9
  type ResourceType = 'Fetch/XHR' | 'JS' | 'CSS' | 'Img' | 'Media' | 'Font' | 'Doc' | 'WS' | 'Wasm' | 'Other';
10
- declare function registerPageHooks(name: 'doc-edit', cb: (params: Partial<DocSchema>) => Operation[]): void;
11
- export type Operation = {
12
- key: string | number;
13
- type: 'button';
14
- text: string;
15
- onClick: () => Promise<void>;
10
+ export type JSONPropertySchema = {
11
+ type: string;
12
+ description?: string;
13
+ items?: JSONPropertySchema;
14
+ properties?: {
15
+ [key: string]: JSONPropertySchema;
16
+ };
17
+ required?: string[];
18
+ };
19
+ export type JSONSchema = {
20
+ $schema?: string;
21
+ $id?: string;
22
+ title?: string;
23
+ properties?: {
24
+ [key: string]: JSONPropertySchema;
25
+ };
16
26
  };
17
27
  export type DocSchema = {
18
28
  apiId: string;
@@ -27,6 +37,11 @@ export type DocSchema = {
27
37
  status: boolean;
28
38
  prefix?: string;
29
39
  };
40
+ export type DocFullSchema = DocSchema & {
41
+ external: {
42
+ group: string;
43
+ };
44
+ };
30
45
  export type GroupSchema = {
31
46
  id: string;
32
47
  parentId: string | null;
@@ -90,9 +105,8 @@ export interface IGlassContext {
90
105
  type?: 'success' | 'info' | 'error';
91
106
  }) => Promise<void>;
92
107
  showProgress: () => IProgress;
108
+ transformDocToJsonSchema: (doc: DocFullSchema) => JSONSchema;
93
109
  postMessage: (message: Partial<NetLog>) => Promise<void>;
94
- registerPageHooks: typeof registerPageHooks;
95
- unRegisterPageHooks: typeof registerPageHooks;
96
110
  }
97
111
  export interface IGlassExtension {
98
112
  install?(context: IGlassContext): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinywork/glass",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [