diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-24 13:16:55 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-24 13:28:33 +0100 |
commit | b969539c838ae3012d7a7040c5e310bb9c834e95 (patch) | |
tree | 821495c8457b19f5595c73e5778e30f6bc6a6cc7 /types/tests | |
parent | 499be42ca2e03d73fef2f9501d121d830137bd6b (diff) | |
download | PeerTube-b969539c838ae3012d7a7040c5e310bb9c834e95.tar.gz PeerTube-b969539c838ae3012d7a7040c5e310bb9c834e95.tar.zst PeerTube-b969539c838ae3012d7a7040c5e310bb9c834e95.zip |
Fix types dist paths
Diffstat (limited to 'types/tests')
-rw-r--r-- | types/tests/test.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/types/tests/test.ts b/types/tests/test.ts new file mode 100644 index 000000000..8c53320a1 --- /dev/null +++ b/types/tests/test.ts | |||
@@ -0,0 +1,32 @@ | |||
1 | import { RegisterServerOptions, Video } from '../dist' | ||
2 | import { RegisterClientOptions } from '../dist/client' | ||
3 | |||
4 | function register1 ({ registerHook }: RegisterServerOptions) { | ||
5 | registerHook({ | ||
6 | target: 'action:application.listening', | ||
7 | handler: () => console.log('hello') | ||
8 | }) | ||
9 | } | ||
10 | |||
11 | function register2 ({ registerHook, peertubeHelpers }: RegisterClientOptions) { | ||
12 | registerHook({ | ||
13 | target: 'action:admin-plugin-settings.init', | ||
14 | handler: ({ npmName }: { npmName: string }) => { | ||
15 | if ('peertube-plugin-transcription' !== npmName) { | ||
16 | return | ||
17 | } | ||
18 | }, | ||
19 | }) | ||
20 | |||
21 | registerHook({ | ||
22 | target: 'action:video-watch.video.loaded', | ||
23 | handler: ({ video }: { video: Video }) => { | ||
24 | fetch(`${peertubeHelpers.getBaseRouterRoute()}/videos/${video.uuid}/captions`, { | ||
25 | method: 'PUT', | ||
26 | headers: peertubeHelpers.getAuthHeader(), | ||
27 | }) | ||
28 | .then((res) => res.json()) | ||
29 | .then((data) => console.log('Hi %s.', data)) | ||
30 | }, | ||
31 | }) | ||
32 | } | ||