Add Mention types and fix Link

pull/1/head
SiRanWeb 2022-10-30 18:22:44 +03:00
rodzic ab23e4d17a
commit 84a8dc7396
4 zmienionych plików z 30 dodań i 0 usunięć

Wyświetl plik

@ -22,6 +22,7 @@ export enum ASModelType {
Tombstone = 'Tombstone',
Profile = 'Profile',
Link = 'Link',
Mention = 'Mention',
}
// TODO: implement

Wyświetl plik

@ -2,6 +2,16 @@ import {ASBase} from "../asBase/ASBase.model";
import { LinkFields } from "./Link.types";
import {ASModelType} from "../../common/common.types";
/**
* A Link is an indirect, qualified reference to a resource identified by a URL.
* The fundamental model for links is established by [RFC5988]. Many of the properties
* defined by the Activity Vocabulary allow values that are either instances of Object
* or Link. When a Link is used, it establishes a qualified relation connecting the
* subject (the containing object) to the resource identified by the href. Properties
* of the Link are properties of the reference as opposed to properties of the resource.
*
* {@link https://www.w3.org/ns/activitystreams#Link Docs}
*/
export class Link extends ASBase<LinkFields>{
constructor(fields: LinkFields) {
super({

Wyświetl plik

@ -0,0 +1,16 @@
import {ASBase} from "../asBase/ASBase.model";
import {MentionFields} from "./Mention.types";
import {ASModelType} from "../../common/common.types";
/**
* A specialized Link that represents an @mention.
*
* {@link https://www.w3.org/ns/activitystreams#Mention Docs}
*/
export class Mention extends ASBase<MentionFields>{
constructor(fields: MentionFields) {
super({
type: ASModelType.Mention,
...fields
})
}
}

Wyświetl plik

@ -0,0 +1,3 @@
import {LinkFields} from "../link/Link.types";
export interface MentionFields extends LinkFields {}