aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-18 16:43:41 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit32fe00138990627749da58ff9f845584013aa219 (patch)
tree3b9cc791614e87cf07bb62c8ef7a40690580ac39 /server/typings
parent60cfd4cb54138e7da76054aa163b33b3223b17ef (diff)
downloadPeerTube-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.ts2
-rw-r--r--server/typings/plugins/plugin-library.model.ts7
-rw-r--r--server/typings/plugins/register-options.model.ts19
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 @@
1export * from './register-options.model'
2export * 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 @@
1import { RegisterOptions } from './register-options.model'
2
3export 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 @@
1import { logger } from '../../helpers/logger'
2import { RegisterHookOptions } from '../../../shared/models/plugins/register-hook.model'
3import { RegisterSettingOptions } from '../../../shared/models/plugins/register-setting.model'
4import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model'
5import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model'
6
7export 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}