Skip to content

Commit

Permalink
exported interface
Browse files Browse the repository at this point in the history
  • Loading branch information
adblanc committed Dec 25, 2019
1 parent e1b17d7 commit 00d6d12
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/animes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import fetch from "node-fetch";
import { apiAnimesUrl, apiRandomAnimesUrl } from "../config.json";
import moment = require("moment");

interface Genre {
export interface Genre {
_id: string;
name: string;
}

interface Anime {
export interface Anime {
ref: string[];
_id: string;
name: string;
Expand All @@ -28,7 +28,7 @@ interface Anime {
genres: Genre[];
}

interface RandomAnime {
export interface RandomAnime {
_id: string;
date: string;
anime: Anime;
Expand Down
22 changes: 19 additions & 3 deletions src/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@ import fetch from "node-fetch";
import moment from "moment";
import { apiCalendarUrl, calendarFormat as format } from "../config.json";

interface Calendar {
export interface Episode {
ref: string[];
_id: string;
hour: string;
title: string;
number: string | number;
link: string;
image: string;
}

export interface Day {
_id?: string;
date: string;
episodes: Episode[];
}

export interface Calendar {
startDate: string;
endDate: string;
days: object[];
days: Day[];
}

export default async function(startDate?: string): Promise<Calendar> {
export async function getCalendar(startDate?: string): Promise<Calendar> {
const monday = moment()
.isoWeekday(1)
.format(format);
Expand Down
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import getCalendar from "./calendar";
import { getAllAnimes, getAnime, getRandomAnime } from "./animes";

export { getCalendar, getAllAnimes, getAnime, getRandomAnime };
export * from "./animes";
export * from "./calendar";

0 comments on commit 00d6d12

Please sign in to comment.