opds-ts - v2.1.0
    Preparing search index...

    Class Entry

    An entry in an OPDS feed.

    Index

    Constructors

    • Creates a new Entry instance.

      Parameters

      Returns Entry

    • Creates a new Entry instance with id and title.

      Parameters

      • id: string

        The unique identifier for the entry.

      • title: string

        The title of the entry.

      Returns Entry

    Methods

    • Adds an acquisition link to the entry. This is a convenience method for adding an acquisition link with the appropriate rel. If openAccess is true, the rel will be set to open-access.

      Parameters

      Returns Entry

      The Entry instance (for chaining).

    • Adds extra metadata to the entry.

      Parameters

      • key: string

        The key for the extra metadata.

      • value: any

        The value for the extra metadata.

      Returns Entry

      The Entry instance (for chaining).

    • Adds an image link to the entry. This is a convenience method for adding an image link with the appropriate rel and type. The image is assumed to be a JPEG.

      Parameters

      • href: string

        The URL of the image.

      • type: string = 'image/jpeg'

      Returns Entry

      The Entry instance (for chaining).

    • Adds one or more links to the feed.

      Parameters

      • ...links: Link[]

        The links to add.

      Returns Entry

      The Feed instance (for chaining).

    • Adds multiple links to the entry.

      Parameters

      • links: Link[]

        The links to add.

      Returns Entry

      The Entry instance (for chaining).

    • Adds a page stream link to the entry. This is a convenience method for adding a page stream link with the appropriate rel and properties. This is using the OPDS Page Stream Extension.

      Parameters

      • href: string

        The URL of the page stream link. (Replaces {pageNumber} with the actual page number when requesting a specific page.)

      • type: string

        The type of the page stream link (e.g., image/jpeg).

      • pageCount: number

        The total number of pages in the resource.

      Returns Entry

      The Entry instance (for chaining).

    • Adds a subsection link to the entry. This is a convenience method for adding a subsection link with the appropriate rel and type. This is used to link to a subsection feed (e.g. a category or collection).

      Parameters

      • href: string

        The URL of the subsection.

      • kind: FeedKind

        The kind of the feed (navigation or acquisition).

      Returns Entry

      The Entry instance (for chaining).

    • Adds a thumbnail link to the entry. This is a convenience method for adding a thumbnail link with the appropriate rel and type. The thumbnail is assumed to be a JPEG.

      Parameters

      • href: string

        The URL of the thumbnail image.

      • type: string = 'image/jpeg'

      Returns Entry

      The Entry instance (for chaining).

    • Gets the author information of the entry.

      Returns undefined | string

      The author information.

    • Gets the content of the entry.

      Returns undefined | { type?: string; value: string }

      The content object.

    • Gets the ID of the entry.

      Returns string

      The ID of the entry.

    • Gets the current links in the entry.

      Returns Link[]

      The array of links.

    • Gets the rights information of the entry.

      Returns undefined | string

      The rights information.

    • Gets the summary of the entry.

      Returns undefined | string

      The summary text.

    • Gets the title of the entry.

      Returns string

      The title of the entry.

    • Gets the updated date of the entry.

      Returns undefined | string

      The updated date.

    • Sets the author of the entry.

      Parameters

      • author: string

        The author's name.

      Returns Entry

      The Entry instance (for chaining).

    • Sets the content of the entry.

      Parameters

      • content: { type?: string; value: string }

        The content object with type and value.

      Returns Entry

      The Entry instance (for chaining).

    • Sets the DC metadata of the entry.

      Parameters

      Returns Entry

      The Entry instance (for chaining).

    • Sets a specific field in the DC metadata of the entry.

      Type Parameters

      Parameters

      • key: K

        The key of the DC metadata field.

      • value: DCMetadata[K]

        The value to set for the specified field.

      Returns Entry

      The Entry instance (for chaining).

    • Sets the rights information for the entry.

      Parameters

      • rights: string

        The rights information.

      Returns Entry

      The Entry instance (for chaining).

    • Sets the summary of the entry.

      Parameters

      • summary: string

        The summary text.

      Returns Entry

      The Entry instance (for chaining).

    • Sets the updated date of the entry.

      Parameters

      • updated: string

        The updated date in ISO 8601 format.

      Returns Entry

      The Entry instance (for chaining).

    • Creates an Entry instance from an XML string.

      Parameters

      • xmlString: string

        The XML string representing an entry.

      Returns Entry

      A new Entry instance.