|
1 | 1 | import $ from 'jquery'; |
2 | | -import { JSONSchema4Type } from 'json-schema'; |
3 | 2 | import _ from 'underscore'; |
4 | 3 | import { browser } from 'webextension-polyfill-ts'; |
5 | 4 |
|
6 | 5 | import defaultGeneral from 'conf/general'; |
7 | 6 | import Steward from 'main/Steward'; |
8 | 7 | import { getPlugins } from 'plugins'; |
9 | | -import { Plugin } from 'plugins/type'; |
10 | 8 |
|
11 | | -import util, { SimpleCommand } from './util'; |
12 | | - |
13 | | -export type PartialPlugin = Pick< |
14 | | - Plugin, |
15 | | - 'name' | 'version' | 'canDisabled' | 'icon' | 'disabled' | 'optionsSchema' | 'defaultOptions' |
16 | | -> & { |
17 | | - commands: SimpleCommand[]; |
18 | | - options: JSONSchema4Type |
19 | | -}; |
| 9 | +import util from './util'; |
| 10 | +import { AppConfig, PartialPlugin, PluginsData, SimpleCommand } from './type'; |
20 | 11 |
|
21 | 12 | const manifest = chrome.runtime.getManifest(); |
22 | 13 | const version = manifest.version; |
@@ -59,10 +50,6 @@ function getPluginData() { |
59 | 50 | return plugins; |
60 | 51 | } |
61 | 52 |
|
62 | | -export interface PluginsData { |
63 | | - [prop: string]: PartialPlugin; |
64 | | -} |
65 | | - |
66 | 53 | function mergePluginData(plugin: PartialPlugin, cachePlugins: PluginsData) { |
67 | 54 | const name = plugin.name; |
68 | 55 | let cachePlugin = cachePlugins[name]; |
@@ -103,12 +90,6 @@ function mergePluginData(plugin: PartialPlugin, cachePlugins: PluginsData) { |
103 | 90 | } |
104 | 91 | } |
105 | 92 |
|
106 | | -export interface AppConfig { |
107 | | - general: typeof defaultGeneral; |
108 | | - plugins: PluginsData; |
109 | | - version: string; |
110 | | -} |
111 | | - |
112 | 93 | function getDefaultConfig() { |
113 | 94 | return { |
114 | 95 | general: defaultGeneral, |
|
0 commit comments