aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/plugins/server/plugin-constant-manager.model.ts
diff options
context:
space:
mode:
authorlutangar <johan.dufour@gmail.com>2021-06-29 16:02:05 +0200
committerlutangar <johan.dufour@gmail.com>2021-07-16 17:49:40 +0200
commitdc3d902234bb73fbc8cf9787e3036f2012526e6c (patch)
tree58ab2812fa5b38f4e19376f1a7cf3d718f3003fb /shared/models/plugins/server/plugin-constant-manager.model.ts
parentde15b052c59cbd4b99bca835b124485ca1af399e (diff)
downloadPeerTube-dc3d902234bb73fbc8cf9787e3036f2012526e6c.tar.gz
PeerTube-dc3d902234bb73fbc8cf9787e3036f2012526e6c.tar.zst
PeerTube-dc3d902234bb73fbc8cf9787e3036f2012526e6c.zip
Introduce generic video constant manager for plugins
Allow a plugin developer to get back constants values, and reset constants deletions or additions.
Diffstat (limited to 'shared/models/plugins/server/plugin-constant-manager.model.ts')
-rw-r--r--shared/models/plugins/server/plugin-constant-manager.model.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/shared/models/plugins/server/plugin-constant-manager.model.ts b/shared/models/plugins/server/plugin-constant-manager.model.ts
new file mode 100644
index 000000000..4de3ce38f
--- /dev/null
+++ b/shared/models/plugins/server/plugin-constant-manager.model.ts
@@ -0,0 +1,7 @@
1export interface ConstantManager <K extends string | number> {
2 addConstant: (key: K, label: string) => boolean
3 deleteConstant: (key: K) => boolean
4 getConstantValue: (key: K) => string
5 getConstants: () => Record<K, string>
6 resetConstants: () => void
7}