1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

server/server -> server/core

This commit is contained in:
Chocobozzz 2023-10-04 15:13:25 +02:00
parent 114327d4ce
commit 5a3d0650c9
No known key found for this signature in database
GPG key ID: 583A612D890159BE
838 changed files with 111 additions and 111 deletions

View file

@ -0,0 +1,37 @@
import { MChannel, MVideo, MVideoImmutable } from '@server/types/models/index.js'
import { EventEmitter } from 'events'
export interface PeerTubeInternalEvents {
'video-created': (options: { video: MVideo }) => void
'video-updated': (options: { video: MVideo }) => void
'video-deleted': (options: { video: MVideo }) => void
'channel-created': (options: { channel: MChannel }) => void
'channel-updated': (options: { channel: MChannel }) => void
'channel-deleted': (options: { channel: MChannel }) => void
'chapters-updated': (options: { video: MVideoImmutable }) => void
}
declare interface InternalEventEmitter {
on<U extends keyof PeerTubeInternalEvents>(
event: U, listener: PeerTubeInternalEvents[U]
): this
emit<U extends keyof PeerTubeInternalEvents>(
event: U, ...args: Parameters<PeerTubeInternalEvents[U]>
): boolean
}
class InternalEventEmitter extends EventEmitter {
private static instance: InternalEventEmitter
static get Instance () {
return this.instance || (this.instance = new this())
}
}
export {
InternalEventEmitter
}