diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-18 16:43:41 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 32fe00138990627749da58ff9f845584013aa219 (patch) | |
tree | 3b9cc791614e87cf07bb62c8ef7a40690580ac39 /server/typings | |
parent | 60cfd4cb54138e7da76054aa163b33b3223b17ef (diff) | |
download | PeerTube-32fe00138990627749da58ff9f845584013aa219.tar.gz PeerTube-32fe00138990627749da58ff9f845584013aa219.tar.zst PeerTube-32fe00138990627749da58ff9f845584013aa219.zip |
Provide logger to plugins
Diffstat (limited to 'server/typings')
-rw-r--r-- | server/typings/plugins/index.d.ts | 2 | ||||
-rw-r--r-- | server/typings/plugins/plugin-library.model.ts | 7 | ||||
-rw-r--r-- | server/typings/plugins/register-options.model.ts | 19 |
3 files changed, 28 insertions, 0 deletions
diff --git a/server/typings/plugins/index.d.ts b/server/typings/plugins/index.d.ts new file mode 100644 index 000000000..bddb3089e --- /dev/null +++ b/server/typings/plugins/index.d.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './register-options.model' | ||
2 | export * from './plugin-library.model' | ||
diff --git a/server/typings/plugins/plugin-library.model.ts b/server/typings/plugins/plugin-library.model.ts new file mode 100644 index 000000000..fd90a3b46 --- /dev/null +++ b/server/typings/plugins/plugin-library.model.ts | |||
@@ -0,0 +1,7 @@ | |||
1 | import { RegisterOptions } from './register-options.model' | ||
2 | |||
3 | export interface PluginLibrary { | ||
4 | register: (options: RegisterOptions) => Promise<any> | ||
5 | |||
6 | unregister: () => Promise<any> | ||
7 | } | ||
diff --git a/server/typings/plugins/register-options.model.ts b/server/typings/plugins/register-options.model.ts new file mode 100644 index 000000000..007ef5e1b --- /dev/null +++ b/server/typings/plugins/register-options.model.ts | |||
@@ -0,0 +1,19 @@ | |||
1 | import { logger } from '../../helpers/logger' | ||
2 | import { RegisterHookOptions } from '../../../shared/models/plugins/register-hook.model' | ||
3 | import { RegisterSettingOptions } from '../../../shared/models/plugins/register-setting.model' | ||
4 | import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' | ||
5 | import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' | ||
6 | |||
7 | export type RegisterOptions = { | ||
8 | registerHook: (options: RegisterHookOptions) => void | ||
9 | |||
10 | registerSetting: (options: RegisterSettingOptions) => void | ||
11 | |||
12 | settingsManager: PluginSettingsManager | ||
13 | |||
14 | storageManager: PluginStorageManager | ||
15 | |||
16 | peertubeHelpers: { | ||
17 | logger: typeof logger | ||
18 | } | ||
19 | } | ||