Cleaned up types
This commit is contained in:
parent
bf2e402f63
commit
ef06f87ba5
3 changed files with 5 additions and 10 deletions
7
src/@types/bubo.d.ts
vendored
7
src/@types/bubo.d.ts
vendored
|
|
@ -1,11 +1,6 @@
|
|||
export interface ContentFromAllFeeds {
|
||||
export interface Feeds {
|
||||
[key: string]: object[]
|
||||
}
|
||||
|
||||
export interface Feeds {
|
||||
[key: string]: FeedItem
|
||||
}
|
||||
|
||||
export interface FeedItem {
|
||||
[key: string]: string | number | Date | FeedItem[];
|
||||
items: FeedItem[]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
import fetch from "node-fetch";
|
||||
import Parser from "rss-parser";
|
||||
import { ContentFromAllFeeds, FeedItem } from "./@types/bubo";
|
||||
import { Feeds, FeedItem } from "./@types/bubo";
|
||||
import { render } from "./renderer.js";
|
||||
import { getLink, getTitle, getTimestamp, parseFeed, getFeedList } from "./utilities.js";
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ const DEBUG = false;
|
|||
|
||||
const parser = new Parser();
|
||||
const feedList = await getFeedList();
|
||||
const contentFromAllFeeds: ContentFromAllFeeds = {};
|
||||
const contentFromAllFeeds: Feeds = {};
|
||||
const errors = [];
|
||||
|
||||
for (const [group, feeds] of Object.entries(feedList)) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
import nunjucks from "nunjucks";
|
||||
const env: nunjucks.Environment = nunjucks.configure({ autoescape: true });
|
||||
import { readFile } from "fs/promises";
|
||||
import { ContentFromAllFeeds } from "./@types/bubo";
|
||||
import { Feeds } from "./@types/bubo";
|
||||
|
||||
/**
|
||||
* Global filters for my Nunjucks templates
|
||||
|
|
@ -26,7 +26,7 @@ const template: string =
|
|||
)).toString();
|
||||
|
||||
// generate the static HTML output from our template renderer
|
||||
const render = ({ data, errors }: { data: ContentFromAllFeeds; errors: unknown[] }) => {
|
||||
const render = ({ data, errors }: { data: Feeds; errors: unknown[] }) => {
|
||||
return env.renderString(template, {
|
||||
data,
|
||||
errors
|
||||
|
|
|
|||
Loading…
Reference in a new issue