UNPKG

4.21 kBTypeScriptView Raw
1/** representation of <category> element */
2export interface AtomCategory {
3 /** identifies the category */
4 term: string;
5 /** identifies the categorization scheme via a URI. */
6 scheme?: string;
7 /** provides a human-readable label for display */
8 label?: string;
9}
10/**
11 * <content> either contains, or links to, the complete content of the entry.
12 * In the most common case, the `type` attribute is either `text`, `html`, `xhtml`, in which case the content element is defined identically to other text constructs, which are described here.
13 * Otherwise, if the `src` attribute is present, it represents the URI of where the content can be found. The `type` attribute, if present, is the media type of the content.
14 * Otherwise, if the `type` attribute ends in `+xml` or `/xml`, then an xml document of this type is contained inline.
15 * Otherwise, if the `type` attribute starts with `text`, then an escaped document of this type is contained inline.
16 * Otherwise, a base64 encoded document of the indicated media type is contained inline.
17 */
18export interface AtomContent {
19 type?: AtomTextType;
20 src?: string;
21 /** the value stored here should be safe, unescaped HTML that can be put anywhere */
22 value: string;
23}
24/**
25 * <link> is patterned after html's link element. It has one required attribute, `href`, and five optional attributes: `rel`, `type`, `hreflang`, `title`, and `length`.
26 */
27export interface AtomLink {
28 /** `href` is the URI of the referenced resource (typically a Web page) */
29 href: string;
30 /**
31 * rel contains a single link relationship type. It can be a full URI (see extensibility), or one of the following predefined values (default=`alternate`):
32 * - `alternate`: an alternate representation of the entry or feed, for example a permalink to the html version of the entry, or the front page of the weblog.
33 * - `enclosure`: a related resource which is potentially large in size and might require special handling, for example an audio or video recording.
34 * - `related`: an document related to the entry or feed.
35 * - `self`: the feed itself.
36 * - `via`: the source of the information provided in the entry.
37 */
38 rel?: AtomLinkRelType;
39 /** `type` indicates the media type of the resource. */
40 type?: string;
41 /** `hreflang` indicates the language of the referenced resource. */
42 hreflang?: string;
43 /** `title`, human readable information about the link, typically for display purposes. */
44 title?: string;
45 /** `length`, the length of the resource, in bytes. */
46 length?: string;
47}
48/** describes a person, corporation, or similar entity. */
49export interface AtomPerson {
50 /** conveys a human-readable name for the person. */
51 name: string;
52 /** contains a home page for the person. */
53 uri?: string;
54 /** contains an email address for the person. */
55 email?: string;
56}
57export declare type AtomLinkRelType = 'alternate' | 'enclosure' | 'related' | 'self' | 'via';
58/** representation of <author> element */
59export interface AtomAuthor extends AtomPerson {
60}
61/** representation of <contributor> element */
62export interface AtomContributor extends AtomPerson {
63}
64/**
65 * <title>, <summary>, <content>, and <rights> contain human-readable text, usually in small quantities. The type attribute determines how this information is encoded (default="text")
66 * - If `type="text"`, then this element contains plain text with no entity escaped html.
67 * - If `type="html"`, then this element contains entity escaped html.
68 * - If `type="xhtml"`, then this element contains inline xhtml, wrapped in a div element.
69 */
70export interface AtomText {
71 type?: AtomTextType;
72 value: string;
73}
74export declare type AtomTextType = 'text' | 'html' | 'xhtml';
75/** representation of <title> element */
76export interface AtomTitle extends AtomText {
77}
78/** representation of <summary> element */
79export interface AtomSummary extends AtomText {
80}
81/** representation of <rights> element */
82export interface AtomRights extends AtomText {
83}