webext-schema 6.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.
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,11 +1,10 @@
1
- export const ESR_VER: 115;
2
- export function fetchText(url: string): Promise<string>;
3
- export function getChannelUrl(channel: string): string;
4
- export function getSchemaData(file: string, baseUrl: string): Promise<object>;
5
- export function getFileList(baseUrl: string): Promise<Array<string>>;
6
- export function getAllSchemaData(baseUrl: string, info: boolean): Promise<Array<object>>;
7
- export function getListedSchemaData(baseUrl: string, arr: any[], info: boolean): Promise<Array<object>>;
8
- export function getMailExtSchemaData(baseUrl: string, info: boolean): Promise<Array<object>>;
9
- export function createUnifiedSchema(channel: string, info: boolean): Promise<object>;
10
- export function saveSchemaFile(channel: string, info: boolean): Promise<string>;
11
- 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>;