kopia lustrzana https://github.com/activitypub-js/activitypub-models
Add Audio, Image, Page and Video types
rodzic
568b049136
commit
a7ff21a4ef
|
@ -12,6 +12,10 @@ export enum ASModelType {
|
||||||
Organization = 'Organization',
|
Organization = 'Organization',
|
||||||
Person = 'Person',
|
Person = 'Person',
|
||||||
Service = 'Service',
|
Service = 'Service',
|
||||||
|
Audio = 'Audio',
|
||||||
|
Image = 'Image',
|
||||||
|
Page = 'Page',
|
||||||
|
Video = 'Video',
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
|
|
|
@ -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<AudioFields>{
|
||||||
|
constructor(fields: AudioFields) {
|
||||||
|
super({
|
||||||
|
type: ASModelType.Audio,
|
||||||
|
...fields
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { DocumentFields } from "../document/Document.types";
|
||||||
|
|
||||||
|
export interface AudioFields extends DocumentFields {}
|
|
@ -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<ImageFields>{
|
||||||
|
constructor(fields: ImageFields) {
|
||||||
|
super({
|
||||||
|
type: ASModelType.Image,
|
||||||
|
...fields
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { DocumentFields } from "../document/Document.types";
|
||||||
|
|
||||||
|
export interface ImageFields extends DocumentFields {}
|
|
@ -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<PageFields>{
|
||||||
|
constructor(fields: PageFields) {
|
||||||
|
super({
|
||||||
|
type: ASModelType.Page,
|
||||||
|
...fields
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { DocumentFields } from "../document/Document.types";
|
||||||
|
|
||||||
|
export interface PageFields extends DocumentFields {}
|
|
@ -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<VideoFields>{
|
||||||
|
constructor(fields: VideoFields) {
|
||||||
|
super({
|
||||||
|
type: ASModelType.Video,
|
||||||
|
...fields
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { DocumentFields } from "../document/Document.types";
|
||||||
|
|
||||||
|
export interface VideoFields extends DocumentFields {}
|
Ładowanie…
Reference in New Issue