diff --git a/src/common/common.types.ts b/src/common/common.types.ts index fa40477..c43b453 100644 --- a/src/common/common.types.ts +++ b/src/common/common.types.ts @@ -12,6 +12,10 @@ export enum ASModelType { Organization = 'Organization', Person = 'Person', Service = 'Service', + Audio = 'Audio', + Image = 'Image', + Page = 'Page', + Video = 'Video', } // TODO: implement diff --git a/src/models/audio/Audio.model.ts b/src/models/audio/Audio.model.ts new file mode 100644 index 0000000..3f49506 --- /dev/null +++ b/src/models/audio/Audio.model.ts @@ -0,0 +1,17 @@ +import {ASBase} from "../ASBase.model"; +import {ASModelType} from "../../common/common.types"; +import {AudioFields} from "./Audio.types"; + +/** + * Represents an audio document of any kind + * + * {@link https://www.w3.org/ns/activitystreams#Audio Docs} + */ +export class Audio extends ASBase{ + constructor(fields: AudioFields) { + super({ + type: ASModelType.Audio, + ...fields + }) + } +} \ No newline at end of file diff --git a/src/models/audio/Audio.types.ts b/src/models/audio/Audio.types.ts new file mode 100644 index 0000000..f3c52b4 --- /dev/null +++ b/src/models/audio/Audio.types.ts @@ -0,0 +1,3 @@ +import { DocumentFields } from "../document/Document.types"; + +export interface AudioFields extends DocumentFields {} \ No newline at end of file diff --git a/src/models/image/Image.model.ts b/src/models/image/Image.model.ts new file mode 100644 index 0000000..249a0b1 --- /dev/null +++ b/src/models/image/Image.model.ts @@ -0,0 +1,17 @@ +import {ASBase} from "../ASBase.model"; +import {ASModelType} from "../../common/common.types"; +import {ImageFields} from "./Image.types"; + +/** + * An image document of any kind + * + * {@link https://www.w3.org/ns/activitystreams#Image Docs} + */ +export class Image extends ASBase{ + constructor(fields: ImageFields) { + super({ + type: ASModelType.Image, + ...fields + }) + } +} \ No newline at end of file diff --git a/src/models/image/Image.types.ts b/src/models/image/Image.types.ts new file mode 100644 index 0000000..9ae8777 --- /dev/null +++ b/src/models/image/Image.types.ts @@ -0,0 +1,3 @@ +import { DocumentFields } from "../document/Document.types"; + +export interface ImageFields extends DocumentFields {} \ No newline at end of file diff --git a/src/models/page/Page.model.ts b/src/models/page/Page.model.ts new file mode 100644 index 0000000..8926f30 --- /dev/null +++ b/src/models/page/Page.model.ts @@ -0,0 +1,17 @@ +import {ASBase} from "../ASBase.model"; +import {ASModelType} from "../../common/common.types"; +import {PageFields} from "./Page.types"; + +/** + * Represents a Web Page + * + * {@link https://www.w3.org/ns/activitystreams#Page Docs} + */ +export class Page extends ASBase{ + constructor(fields: PageFields) { + super({ + type: ASModelType.Page, + ...fields + }) + } +} \ No newline at end of file diff --git a/src/models/page/Page.types.ts b/src/models/page/Page.types.ts new file mode 100644 index 0000000..fe9258d --- /dev/null +++ b/src/models/page/Page.types.ts @@ -0,0 +1,3 @@ +import { DocumentFields } from "../document/Document.types"; + +export interface PageFields extends DocumentFields {} \ No newline at end of file diff --git a/src/models/video/Video.model.ts b/src/models/video/Video.model.ts new file mode 100644 index 0000000..528e103 --- /dev/null +++ b/src/models/video/Video.model.ts @@ -0,0 +1,17 @@ +import {ASBase} from "../ASBase.model"; +import {ASModelType} from "../../common/common.types"; +import {VideoFields} from "./Video.types"; + +/** + * Represents a video document of any kind + * + * {@link https://www.w3.org/ns/activitystreams#Video Docs} + */ +export class Video extends ASBase{ + constructor(fields: VideoFields) { + super({ + type: ASModelType.Video, + ...fields + }) + } +} \ No newline at end of file diff --git a/src/models/video/Video.types.ts b/src/models/video/Video.types.ts new file mode 100644 index 0000000..d498881 --- /dev/null +++ b/src/models/video/Video.types.ts @@ -0,0 +1,3 @@ +import { DocumentFields } from "../document/Document.types"; + +export interface VideoFields extends DocumentFields {} \ No newline at end of file