mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
19 lines
922 B
TypeScript
19 lines
922 B
TypeScript
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
|
|
import type { GenericEventEmitter } from '../../util/GenericEventEmitter';
|
|
import { createGenericEventEmitterClass } from '../../util/GenericEventEmitter';
|
|
import type { AS, VocabularyTerm, VocabularyValue } from '../../util/Vocabularies';
|
|
|
|
/**
|
|
* An event emitter used to report changes made to resources.
|
|
* Both generic `change` events and ActivityStream-specific events are emitted.
|
|
*/
|
|
export type ActivityEmitter =
|
|
GenericEventEmitter<'changed', (target: ResourceIdentifier, activity: VocabularyTerm<typeof AS>) => void> &
|
|
GenericEventEmitter<VocabularyValue<typeof AS>, (target: ResourceIdentifier) => void>;
|
|
|
|
/**
|
|
* A class implementation of {@link ActivityEmitter}.
|
|
*/
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
export const BaseActivityEmitter = createGenericEventEmitterClass<ActivityEmitter>();
|