webext-schema 7.0.0 → 7.1.0

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.
@@ -9,7 +9,6 @@ import sinon from 'sinon';
9
9
  import { browser } from './mocha/setup.js';
10
10
 
11
11
  /* test */
12
- // eslint-disable-next-line import-x/order
13
12
  import * as mjs from '../modules/browser.js';
14
13
 
15
14
  describe('browser', () => {
@@ -1,6 +1,8 @@
1
1
  /* api */
2
2
  import { strict as assert } from 'node:assert';
3
- import { describe, it } from 'mocha';
3
+ import process from 'node:process';
4
+ import { describe, it, beforeEach, afterEach } from 'mocha';
5
+ import sinon from 'sinon';
4
6
 
5
7
  /* test */
6
8
  import { Schema } from '../index.js';
@@ -11,3 +13,47 @@ describe('Schema', () => {
11
13
  assert.strictEqual(schema instanceof Schema, true);
12
14
  });
13
15
  });
16
+
17
+ describe('Process Error Handlers', () => {
18
+ let sandbox;
19
+ beforeEach(() => {
20
+ sandbox = sinon.createSandbox();
21
+ sandbox.stub(console, 'error');
22
+ sandbox.stub(process, 'exit');
23
+ });
24
+ afterEach(() => {
25
+ sandbox.restore();
26
+ });
27
+
28
+ it('should handle uncaughtException', () => {
29
+ const listeners = process.listeners('uncaughtException');
30
+ const targetListener = listeners.find(fn =>
31
+ fn.toString().includes('Fatal Error (Uncaught Exception)')
32
+ );
33
+ assert.ok(targetListener,
34
+ 'Target listener for uncaughtException should be found');
35
+ const testError = new Error('Test Uncaught Exception');
36
+ targetListener(testError);
37
+ assert.strictEqual(console.error.calledOnce, true);
38
+ assert.strictEqual(console.error.firstCall.args[0],
39
+ 'Fatal Error (Uncaught Exception):');
40
+ assert.strictEqual(console.error.firstCall.args[1], testError);
41
+ assert.strictEqual(process.exit.calledOnceWithExactly(1), true);
42
+ });
43
+
44
+ it('should handle unhandledRejection', () => {
45
+ const listeners = process.listeners('unhandledRejection');
46
+ const targetListener = listeners.find(fn =>
47
+ fn.toString().includes('Fatal Error (Unhandled Rejection)')
48
+ );
49
+ assert.ok(targetListener,
50
+ 'Target listener for unhandledRejection should be found');
51
+ const testReason = 'Test Unhandled Rejection';
52
+ targetListener(testReason);
53
+ assert.strictEqual(console.error.calledOnce, true);
54
+ assert.strictEqual(console.error.firstCall.args[0],
55
+ 'Fatal Error (Unhandled Rejection):');
56
+ assert.strictEqual(console.error.firstCall.args[1], testReason);
57
+ assert.strictEqual(process.exit.calledOnceWithExactly(1), true);
58
+ });
59
+ });
@@ -5,7 +5,12 @@ import path from 'node:path';
5
5
  import process from 'node:process';
6
6
  import sinon from 'sinon';
7
7
  import { afterEach, beforeEach, describe, it } from 'mocha';
8
- import { MockAgent, getGlobalDispatcher, setGlobalDispatcher } from 'undici';
8
+ import {
9
+ fetch as undiciFetch,
10
+ getGlobalDispatcher,
11
+ MockAgent,
12
+ setGlobalDispatcher
13
+ } from 'undici';
9
14
 
10
15
  /* test */
11
16
  import {
@@ -15,15 +20,18 @@ import {
15
20
  } from '../modules/update.js';
16
21
 
17
22
  describe('fetch text', () => {
23
+ const originalFetch = globalThis.fetch;
18
24
  const globalDispatcher = getGlobalDispatcher();
19
25
  const mockAgent = new MockAgent();
20
26
  beforeEach(() => {
21
27
  setGlobalDispatcher(mockAgent);
22
28
  mockAgent.disableNetConnect();
29
+ globalThis.fetch = undiciFetch;
23
30
  });
24
31
  afterEach(() => {
25
32
  mockAgent.enableNetConnect();
26
33
  setGlobalDispatcher(globalDispatcher);
34
+ globalThis.fetch = originalFetch;
27
35
  });
28
36
 
29
37
  it('should throw', async () => {
@@ -90,15 +98,18 @@ describe('get channel url', () => {
90
98
  });
91
99
 
92
100
  describe('get schema data', () => {
101
+ const originalFetch = globalThis.fetch;
93
102
  const globalDispatcher = getGlobalDispatcher();
94
103
  const mockAgent = new MockAgent();
95
104
  beforeEach(() => {
96
105
  setGlobalDispatcher(mockAgent);
97
106
  mockAgent.disableNetConnect();
107
+ globalThis.fetch = undiciFetch;
98
108
  });
99
109
  afterEach(() => {
100
110
  mockAgent.enableNetConnect();
101
111
  setGlobalDispatcher(globalDispatcher);
112
+ globalThis.fetch = originalFetch;
102
113
  });
103
114
 
104
115
  it('should throw', async () => {
@@ -130,15 +141,18 @@ describe('get schema data', () => {
130
141
  });
131
142
 
132
143
  describe('get schema file list from jar manifest', () => {
144
+ const originalFetch = globalThis.fetch;
133
145
  const globalDispatcher = getGlobalDispatcher();
134
146
  const mockAgent = new MockAgent();
135
147
  beforeEach(() => {
136
148
  setGlobalDispatcher(mockAgent);
137
149
  mockAgent.disableNetConnect();
150
+ globalThis.fetch = undiciFetch;
138
151
  });
139
152
  afterEach(() => {
140
153
  mockAgent.enableNetConnect();
141
154
  setGlobalDispatcher(globalDispatcher);
155
+ globalThis.fetch = originalFetch;
142
156
  });
143
157
 
144
158
  it('should throw', async () => {
@@ -163,15 +177,18 @@ describe('get schema file list from jar manifest', () => {
163
177
  });
164
178
 
165
179
  describe('get all schema data', () => {
180
+ const originalFetch = globalThis.fetch;
166
181
  const globalDispatcher = getGlobalDispatcher();
167
182
  const mockAgent = new MockAgent();
168
183
  beforeEach(() => {
169
184
  setGlobalDispatcher(mockAgent);
170
185
  mockAgent.disableNetConnect();
186
+ globalThis.fetch = undiciFetch;
171
187
  });
172
188
  afterEach(() => {
173
189
  mockAgent.enableNetConnect();
174
190
  setGlobalDispatcher(globalDispatcher);
191
+ globalThis.fetch = originalFetch;
175
192
  });
176
193
 
177
194
  it('should throw', async () => {
@@ -241,15 +258,18 @@ describe('get all schema data', () => {
241
258
  });
242
259
 
243
260
  describe('get listed schema data', () => {
261
+ const originalFetch = globalThis.fetch;
244
262
  const globalDispatcher = getGlobalDispatcher();
245
263
  const mockAgent = new MockAgent();
246
264
  beforeEach(() => {
247
265
  setGlobalDispatcher(mockAgent);
248
266
  mockAgent.disableNetConnect();
267
+ globalThis.fetch = undiciFetch;
249
268
  });
250
269
  afterEach(() => {
251
270
  mockAgent.enableNetConnect();
252
271
  setGlobalDispatcher(globalDispatcher);
272
+ globalThis.fetch = originalFetch;
253
273
  });
254
274
 
255
275
  it('should throw', async () => {
@@ -324,15 +344,18 @@ describe('get listed schema data', () => {
324
344
  });
325
345
 
326
346
  describe('get MailExtensions schema data', () => {
347
+ const originalFetch = globalThis.fetch;
327
348
  const globalDispatcher = getGlobalDispatcher();
328
349
  const mockAgent = new MockAgent();
329
350
  beforeEach(() => {
330
351
  setGlobalDispatcher(mockAgent);
331
352
  mockAgent.disableNetConnect();
353
+ globalThis.fetch = undiciFetch;
332
354
  });
333
355
  afterEach(() => {
334
356
  mockAgent.enableNetConnect();
335
357
  setGlobalDispatcher(globalDispatcher);
358
+ globalThis.fetch = originalFetch;
336
359
  });
337
360
 
338
361
  it('should throw', async () => {
@@ -402,15 +425,18 @@ describe('get MailExtensions schema data', () => {
402
425
  });
403
426
 
404
427
  describe('create unified schema', () => {
428
+ const originalFetch = globalThis.fetch;
405
429
  const globalDispatcher = getGlobalDispatcher();
406
430
  const mockAgent = new MockAgent();
407
431
  beforeEach(() => {
408
432
  setGlobalDispatcher(mockAgent);
409
433
  mockAgent.disableNetConnect();
434
+ globalThis.fetch = undiciFetch;
410
435
  });
411
436
  afterEach(() => {
412
437
  mockAgent.enableNetConnect();
413
438
  setGlobalDispatcher(globalDispatcher);
439
+ globalThis.fetch = originalFetch;
414
440
  });
415
441
 
416
442
  it('should get object', async () => {
@@ -579,15 +605,18 @@ describe('create unified schema', () => {
579
605
  });
580
606
 
581
607
  describe('save schema file', () => {
608
+ const originalFetch = globalThis.fetch;
582
609
  const globalDispatcher = getGlobalDispatcher();
583
610
  const mockAgent = new MockAgent();
584
611
  beforeEach(() => {
585
612
  setGlobalDispatcher(mockAgent);
586
613
  mockAgent.disableNetConnect();
614
+ globalThis.fetch = undiciFetch;
587
615
  });
588
616
  afterEach(() => {
589
617
  mockAgent.enableNetConnect();
590
618
  setGlobalDispatcher(globalDispatcher);
619
+ globalThis.fetch = originalFetch;
591
620
  });
592
621
 
593
622
  it('should throw', async () => {
@@ -781,15 +810,18 @@ describe('save schema file', () => {
781
810
  });
782
811
 
783
812
  describe('update schemas files', () => {
813
+ const originalFetch = globalThis.fetch;
784
814
  const globalDispatcher = getGlobalDispatcher();
785
815
  const mockAgent = new MockAgent();
786
816
  beforeEach(() => {
787
817
  setGlobalDispatcher(mockAgent);
788
818
  mockAgent.disableNetConnect();
819
+ globalThis.fetch = undiciFetch;
789
820
  });
790
821
  afterEach(() => {
791
822
  mockAgent.enableNetConnect();
792
823
  setGlobalDispatcher(globalDispatcher);
824
+ globalThis.fetch = originalFetch;
793
825
  });
794
826
 
795
827
  it('should not call function', async () => {
package/types/index.d.ts CHANGED
@@ -1 +1,8 @@
1
- export { Schema } from "./modules/schema.js";
1
+ /*!
2
+ * webext-schema
3
+ *
4
+ * @license MPL-2.0
5
+ * @copyright asamuzaK (Kazz)
6
+ * @see {@link https://github.com/asamuzaK/webext-schema/blob/master/LICENSE}
7
+ */
8
+ export { Schema } from './modules/schema.js';
@@ -1,61 +1,61 @@
1
- export function isPermissionGranted(perm: object): Promise<boolean>;
2
- export function createBookmark(opt: object): Promise<object>;
3
- export function getBookmarkTreeNode(id?: string | any[]): Promise<Array<object> | null>;
4
- export function getCloseTabsByDoubleClickValue(): Promise<object>;
5
- export function setContextMenuOnMouseup(): Promise<boolean>;
6
- export function clearContextMenuOnMouseup(): Promise<boolean>;
7
- export function getNewTabPositionValue(): Promise<object>;
8
- export function isCommandCustomizable(): Promise<boolean>;
9
- export function updateCommand(id: string, value?: string): Promise<void | null>;
10
- export function getAllContextualIdentities(): Promise<Array<object> | null>;
11
- export function getContextualId(cookieStoreId: string): Promise<object>;
12
- export function getEnabledTheme(): Promise<Array<object> | null>;
13
- export function getExtensionInfo(id: string): Promise<object>;
14
- export function getExternalExtensions(): Promise<Array<object> | null>;
15
- export function clearNotification(id: string): Promise<boolean | null>;
16
- export function createNotification(id: string, opt: object): Promise<string | null>;
17
- export function removePermission(perm: string | any[]): Promise<boolean>;
18
- export function requestPermission(perm: string | any[]): Promise<boolean>;
19
- export function getManifestIcons(): object | string;
20
- export function getManifestVersion(): number;
21
- export function getOs(): Promise<string>;
22
- export function makeConnection(id?: number | string, info?: object | boolean): Promise<object>;
23
- export function sendMessage(id: number | string, msg: string | any[] | object, opt: object): Promise<object>;
24
- export function isScriptingAvailable(): Promise<boolean>;
25
- export function executeScriptToTab(opt?: object): Promise<Array<object> | null>;
26
- export function searchInNewTab(text: string, opt: object): Promise<object>;
27
- export function searchWithSearchEngine(query: string, opt?: object): Promise<void>;
28
- export function getRecentlyClosedTab(windowId?: number): Promise<object>;
29
- export function getSessionWindowValue(key: string, windowId?: number): Promise<string | null>;
30
- export function restoreSession(sessionId: string): Promise<object>;
31
- export function setSessionWindowValue(key: string, value: string | object, windowId?: number): Promise<void>;
32
- export function clearStorage(area?: string): Promise<void>;
33
- export function getAllStorage(area?: string): Promise<object>;
34
- export function getStorage(key: string | any[] | object, area?: string): Promise<object>;
35
- export function removeStorage(key: string | any[] | object, area?: string): Promise<void>;
36
- export function setStorage(obj: object, area?: string): Promise<void>;
37
- export function createTab(opt?: object): Promise<object>;
38
- export function duplicateTab(tabId: number, opt: object): Promise<object>;
39
- export function queryTabs(opt: object): Promise<Array<object>>;
40
- export function execScriptToTab(tabId: number | object, opt?: object): Promise<(any[] | boolean) | null>;
41
- export function execScriptToTabs(opt?: object): Promise<any[]>;
42
- export function execScriptsToTabInOrder(tabId: number | any[], opts?: any[]): Promise<(any[] | boolean) | null>;
43
- export function getActiveTab(windowId?: number): Promise<object>;
44
- export function getActiveTabId(windowId?: number): Promise<number | null>;
45
- export function getAllTabsInWindow(windowId?: number): Promise<Array<object>>;
46
- export function getHighlightedTab(windowId?: number): Promise<Array<object>>;
47
- export function getTab(tabId: number): Promise<object>;
48
- export function highlightTab(index: number | any[], windowId?: number): Promise<object>;
49
- export function moveTab(tabId: number | any[], opt?: object): Promise<Array<object> | null>;
50
- export function reloadTab(tabId: number, opt: object): Promise<void>;
51
- export function removeTab(arg: number | any[]): Promise<void>;
52
- export function updateTab(tabId: number, opt: object): Promise<object>;
53
- export function warmupTab(tabId: number): Promise<void>;
54
- export function captureVisibleTab(windowId: number, opt: object): Promise<string | null>;
55
- export function isTab(tabId: number): Promise<boolean>;
56
- export function getCurrentTheme(windowId?: number): Promise<object>;
57
- export function createNewWindow(opt: object): Promise<object>;
58
- export function getAllNormalWindows(populate?: boolean): Promise<Array<object>>;
59
- export function getCurrentWindow(opt: object): Promise<object>;
60
- export function getWindow(windowId: number, opt: object): Promise<object>;
61
- export function checkIncognitoWindowExists(): Promise<boolean>;
1
+ export declare const isPermissionGranted: (perm: object) => Promise<boolean>;
2
+ export declare const createBookmark: (opt: object) => Promise<object>;
3
+ export declare const getBookmarkTreeNode: (id?: string | any[]) => Promise<Array<object> | null>;
4
+ export declare const getCloseTabsByDoubleClickValue: () => Promise<object>;
5
+ export declare const setContextMenuOnMouseup: () => Promise<boolean>;
6
+ export declare const clearContextMenuOnMouseup: () => Promise<boolean>;
7
+ export declare const getNewTabPositionValue: () => Promise<object>;
8
+ export declare const isCommandCustomizable: () => Promise<boolean>;
9
+ export declare const updateCommand: (id: string, value?: string) => Promise<void | null>;
10
+ export declare const getAllContextualIdentities: () => Promise<Array<object> | null>;
11
+ export declare const getContextualId: (cookieStoreId: string) => Promise<object>;
12
+ export declare const getEnabledTheme: () => Promise<Array<object> | null>;
13
+ export declare const getExtensionInfo: (id: string) => Promise<object>;
14
+ export declare const getExternalExtensions: () => Promise<Array<object> | null>;
15
+ export declare const clearNotification: (id: string) => Promise<boolean | null>;
16
+ export declare const createNotification: (id: string, opt: object) => Promise<string | null>;
17
+ export declare const removePermission: (perm: string | any[]) => Promise<boolean>;
18
+ export declare const requestPermission: (perm: string | any[]) => Promise<boolean>;
19
+ export declare const getManifestIcons: () => object | string;
20
+ export declare const getManifestVersion: () => number;
21
+ export declare const getOs: () => Promise<string>;
22
+ export declare const makeConnection: (id?: number | string, info?: object | boolean) => Promise<object>;
23
+ export declare const sendMessage: (id: number | string, msg: string | any[] | object, opt: object) => Promise<object>;
24
+ export declare const isScriptingAvailable: () => Promise<boolean>;
25
+ export declare const executeScriptToTab: (opt?: object) => Promise<Array<object> | null>;
26
+ export declare const searchInNewTab: (text: string, opt: object) => Promise<object>;
27
+ export declare const searchWithSearchEngine: (query: string, opt?: object) => Promise<void>;
28
+ export declare const getRecentlyClosedTab: (windowId?: number) => Promise<object>;
29
+ export declare const getSessionWindowValue: (key: string, windowId?: number) => Promise<string | null>;
30
+ export declare const restoreSession: (sessionId: string) => Promise<object>;
31
+ export declare const setSessionWindowValue: (key: string, value: string | object, windowId?: number) => Promise<void>;
32
+ export declare const clearStorage: (area?: string) => Promise<void>;
33
+ export declare const getAllStorage: (area?: string) => Promise<object>;
34
+ export declare const getStorage: (key: string | any[] | object, area?: string) => Promise<object>;
35
+ export declare const removeStorage: (key: string | any[] | object, area?: string) => Promise<void>;
36
+ export declare const setStorage: (obj: object, area?: string) => Promise<void>;
37
+ export declare const createTab: (opt?: object) => Promise<object>;
38
+ export declare const duplicateTab: (tabId: number, opt: object) => Promise<object>;
39
+ export declare const queryTabs: (opt: object) => Promise<Array<object>>;
40
+ export declare const execScriptToTab: (tabId: number | object, opt?: object) => Promise<(any[] | null) | boolean>;
41
+ export declare const execScriptToTabs: (opt?: object) => Promise<any[]>;
42
+ export declare const execScriptsToTabInOrder: (tabId: number | any[], opts?: any[]) => Promise<(any[] | null) | boolean>;
43
+ export declare const getActiveTab: (windowId?: number) => Promise<object>;
44
+ export declare const getActiveTabId: (windowId?: number) => Promise<number | null>;
45
+ export declare const getAllTabsInWindow: (windowId?: number) => Promise<Array<object>>;
46
+ export declare const getHighlightedTab: (windowId?: number) => Promise<Array<object>>;
47
+ export declare const getTab: (tabId: number) => Promise<object>;
48
+ export declare const highlightTab: (index: number | any[], windowId?: number) => Promise<object>;
49
+ export declare const moveTab: (tabId: number | any[], opt?: object) => Promise<Array<object> | null>;
50
+ export declare const reloadTab: (tabId: number, opt: object) => Promise<void>;
51
+ export declare const removeTab: (arg: number | any[]) => Promise<void>;
52
+ export declare const updateTab: (tabId: number, opt: object) => Promise<object>;
53
+ export declare const warmupTab: (tabId: number) => Promise<void>;
54
+ export declare const captureVisibleTab: (windowId: number, opt: object) => Promise<string | null>;
55
+ export declare const isTab: (tabId: number) => Promise<boolean>;
56
+ export declare const getCurrentTheme: (windowId?: number) => Promise<object>;
57
+ export declare const createNewWindow: (opt: object) => Promise<object>;
58
+ export declare const getAllNormalWindows: (populate?: boolean) => Promise<Array<object>>;
59
+ export declare const getCurrentWindow: (opt: object) => Promise<object>;
60
+ export declare const getWindow: (windowId: number, opt: object) => Promise<object>;
61
+ export declare const checkIncognitoWindowExists: () => Promise<boolean>;
@@ -1,4 +1,4 @@
1
- export function cleanDirectory(cmdOpts?: object): void;
2
- export function parseCommand(args: any[]): void;
3
- export { commander };
4
1
  import { program as commander } from 'commander';
2
+ export declare const cleanDirectory: (cmdOpts?: object) => void;
3
+ export declare const parseCommand: (args: any[]) => void;
4
+ export { commander };
@@ -1,7 +1,7 @@
1
- export function throwErr(e: object): never;
2
- export function logErr(e: object): boolean;
3
- export function logWarn(msg: string | object): boolean;
4
- export function logMsg(msg: string | object): string | object;
5
- export function getType(o: object): string;
6
- export function isObjectNotEmpty(o: object): boolean;
7
- export function isString(o: object): boolean;
1
+ export declare const throwErr: (e: object) => never;
2
+ export declare const logErr: (e: object) => boolean;
3
+ export declare const logWarn: (msg: string | object) => boolean;
4
+ export declare const logMsg: (msg: string | object) => string | object;
5
+ export declare const getType: (o: object) => string;
6
+ export declare const isObjectNotEmpty: (o: object) => boolean;
7
+ export declare const isString: (o: object) => boolean;
@@ -1,3 +1,3 @@
1
- export const CHAR: "utf8";
2
- export const INDENT: 2;
3
- export const IS_WIN: boolean;
1
+ export declare const CHAR = "utf8";
2
+ export declare const INDENT = 2;
3
+ export declare const IS_WIN: boolean;
@@ -1,21 +1,21 @@
1
- export function convertUriToFilePath(uri: string): string | null;
2
- export function getAbsPath(file: string): string | null;
3
- export function getStat(file: string): object;
4
- export function isDir(dir: string): boolean;
5
- export function isSubDir(dir: string, baseDir: string): boolean;
6
- export function isFile(file: string): boolean;
7
- export function isExecutable(file: string, mask?: number): boolean;
8
- export function getFileTimestamp(file: string): number;
9
- export function getFileNameFromFilePath(file: string, subst?: string): string;
10
- export function removeDir(dir: string, baseDir: string): void;
11
- export function removeDirectory(dir: string, baseDir: string): Promise<void>;
12
- export function createDirectory(dir: string, mode?: number): Promise<string>;
13
- export function createFile(file: string, value: string | Buffer | Uint8Array, opt?: {
1
+ export declare const convertUriToFilePath: (uri: string) => string | null;
2
+ export declare const getAbsPath: (file: string) => string | null;
3
+ export declare const getStat: (file: string) => object;
4
+ export declare const isDir: (dir: string) => boolean;
5
+ export declare const isSubDir: (dir: string, baseDir: string) => boolean;
6
+ export declare const isFile: (file: string) => boolean;
7
+ export declare const isExecutable: (file: string, mask?: number) => boolean;
8
+ export declare const getFileTimestamp: (file: string) => number;
9
+ export declare const getFileNameFromFilePath: (file: string, subst?: string) => string;
10
+ export declare const removeDir: (dir: string, baseDir: string) => void;
11
+ export declare const removeDirectory: (dir: string, baseDir: string) => Promise<void>;
12
+ export declare const createDirectory: (dir: string, mode?: number) => Promise<string>;
13
+ export declare const createFile: (file: string, value: string | Buffer | Uint8Array, opt?: {
14
14
  encoding?: string;
15
15
  flag?: string;
16
16
  mode?: number | string;
17
- }): Promise<string>;
18
- export function readFile(file: string, opt?: {
17
+ }) => Promise<string>;
18
+ export declare const readFile: (file: string, opt?: {
19
19
  encoding?: string;
20
20
  flag?: string;
21
- }): Promise<string | Buffer>;
21
+ }) => Promise<string | Buffer>;
@@ -1,14 +1,16 @@
1
- export class Schema {
2
- constructor(...args?: (string | object)[]);
1
+ import sinon from 'sinon';
2
+ export declare class Schema {
3
+ #private;
3
4
  _sandbox: sinon.SinonSandbox;
4
5
  _importMap: Map<any, any>;
5
6
  _refMap: Map<any, any>;
6
7
  _browser: {
7
8
  _sandbox: sinon.SinonSandbox;
8
- };
9
+ } | null;
9
10
  _schema: any;
10
- set channel(ch: any);
11
+ constructor(...args?: (string | object)[]);
11
12
  get channel(): any;
13
+ set channel(ch: any);
12
14
  private _getTargetFromNamespace;
13
15
  private _assignImportMap;
14
16
  private _assignRefMap;
@@ -21,6 +23,4 @@ export class Schema {
21
23
  getAll(): object;
22
24
  list(): Array<string>;
23
25
  mock(): object;
24
- #private;
25
26
  }
26
- import sinon from 'sinon';
@@ -1,10 +1,10 @@
1
- export function fetchText(url: string): Promise<string>;
2
- export function getChannelUrl(channel: string): string;
3
- export function getSchemaData(file: string, baseUrl: string): Promise<object>;
4
- export function getFileList(baseUrl: string): Promise<Array<string>>;
5
- export function getAllSchemaData(baseUrl: string, info: boolean): Promise<Array<object>>;
6
- export function getListedSchemaData(baseUrl: string, arr: any[], info: boolean): Promise<Array<object>>;
7
- export function getMailExtSchemaData(baseUrl: string, info: boolean): Promise<Array<object>>;
8
- export function createUnifiedSchema(channel: string, info: boolean): Promise<object>;
9
- export function saveSchemaFile(channel: string, info: boolean): Promise<string>;
10
- export function updateSchemas(cmdOpts?: object): Promise<void>;
1
+ export declare const fetchText: (url: string) => Promise<string>;
2
+ export declare const getChannelUrl: (channel: string) => string;
3
+ export declare const getSchemaData: (file: string, baseUrl: string) => Promise<object>;
4
+ export declare const getFileList: (baseUrl: string) => Promise<Array<string>>;
5
+ export declare const getAllSchemaData: (baseUrl: string, info: boolean) => Promise<Array<object>>;
6
+ export declare const getListedSchemaData: (baseUrl: string, arr: any[], info: boolean) => Promise<Array<object>>;
7
+ export declare const getMailExtSchemaData: (baseUrl: string, info: boolean) => Promise<Array<object>>;
8
+ export declare const createUnifiedSchema: (channel: string, info: boolean) => Promise<object>;
9
+ export declare const saveSchemaFile: (channel: string, info: boolean) => Promise<string>;
10
+ export declare const updateSchemas: (cmdOpts?: object) => Promise<void>;