feeds.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import type { AnyNode } from "domhandler";
  2. /**
  3. * The type of a media item.
  4. *
  5. * @category Feeds
  6. */
  7. export declare type FeedItemMediaMedium = "image" | "audio" | "video" | "document" | "executable";
  8. /**
  9. * The type of a media item.
  10. *
  11. * @category Feeds
  12. */
  13. export declare type FeedItemMediaExpression = "sample" | "full" | "nonstop";
  14. /**
  15. * A media item of a feed entry.
  16. *
  17. * @category Feeds
  18. */
  19. export interface FeedItemMedia {
  20. medium: FeedItemMediaMedium | undefined;
  21. isDefault: boolean;
  22. url?: string;
  23. fileSize?: number;
  24. type?: string;
  25. expression?: FeedItemMediaExpression;
  26. bitrate?: number;
  27. framerate?: number;
  28. samplingrate?: number;
  29. channels?: number;
  30. duration?: number;
  31. height?: number;
  32. width?: number;
  33. lang?: string;
  34. }
  35. /**
  36. * An entry of a feed.
  37. *
  38. * @category Feeds
  39. */
  40. export interface FeedItem {
  41. id?: string;
  42. title?: string;
  43. link?: string;
  44. description?: string;
  45. pubDate?: Date;
  46. media: FeedItemMedia[];
  47. }
  48. /**
  49. * The root of a feed.
  50. *
  51. * @category Feeds
  52. */
  53. export interface Feed {
  54. type: string;
  55. id?: string;
  56. title?: string;
  57. link?: string;
  58. description?: string;
  59. updated?: Date;
  60. author?: string;
  61. items: FeedItem[];
  62. }
  63. /**
  64. * Get the feed object from the root of a DOM tree.
  65. *
  66. * @category Feeds
  67. * @param doc - The DOM to to extract the feed from.
  68. * @returns The feed.
  69. */
  70. export declare function getFeed(doc: AnyNode[]): Feed | null;
  71. //# sourceMappingURL=feeds.d.ts.map