-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
264 additions
and
207 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { Scraper } from './scraper'; | ||
export type Image = { | ||
typeName: 'Image'; | ||
import { BaseScrapeResult, Scraper } from './scraper'; | ||
export interface Image extends BaseScrapeResult<'Image'> { | ||
imageURL: string; | ||
}; | ||
export declare class ImageScraper extends Scraper<'Image', Image> { | ||
} | ||
export declare class ImageScraper extends Scraper<Image> { | ||
readonly pattern: URLPattern; | ||
readonly scrape: () => Image; | ||
scrape(): { | ||
typeName: "Image"; | ||
version: number; | ||
imageURL: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
import { Scraper } from './scraper'; | ||
export type MyAnimeListAnime = { | ||
typeName: 'MyAnimeListAnime'; | ||
import { BaseScrapeResult, Scraper } from './scraper'; | ||
export interface MyAnimeListAnime extends BaseScrapeResult<'MyAnimeListAnime'> { | ||
title: string; | ||
coverURL: string; | ||
releaseDate: string; | ||
creators: string; | ||
duration: string; | ||
description: string; | ||
}; | ||
export declare class MyAnimeListAnimeScraper extends Scraper<'MyAnimeListAnime', MyAnimeListAnime> { | ||
} | ||
export declare class MyAnimeListAnimeScraper extends Scraper<MyAnimeListAnime> { | ||
readonly pattern: URLPattern; | ||
readonly scrape: () => MyAnimeListAnime; | ||
scrape(): { | ||
typeName: "MyAnimeListAnime"; | ||
version: number; | ||
title: string; | ||
coverURL: string; | ||
releaseDate: string; | ||
creators: string; | ||
duration: string; | ||
description: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import 'urlpattern-polyfill'; | ||
export declare abstract class Scraper<TypeName extends string, Data extends { | ||
export interface BaseScrapeResult<TypeName extends string> { | ||
typeName: TypeName; | ||
}> { | ||
version: number; | ||
} | ||
export declare abstract class Scraper<R extends BaseScrapeResult<string>> { | ||
abstract readonly pattern: URLPattern; | ||
abstract readonly scrape: (() => Data) | (() => Promise<Data>); | ||
abstract scrape(): Promise<R> | R; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { Scraper } from './scraper'; | ||
export type SteamGame = { | ||
typeName: 'SteamGame'; | ||
import { BaseScrapeResult, Scraper } from './scraper'; | ||
export interface SteamGame extends BaseScrapeResult<'SteamGame'> { | ||
coverURL: string; | ||
name: string; | ||
releaseDate: string; | ||
developers: string; | ||
description: string; | ||
}; | ||
export declare class SteamGameScraper extends Scraper<'SteamGame', SteamGame> { | ||
} | ||
export declare class SteamGameScraper extends Scraper<SteamGame> { | ||
readonly pattern: URLPattern; | ||
readonly scrape: () => SteamGame; | ||
scrape(): { | ||
typeName: "SteamGame"; | ||
version: number; | ||
coverURL: string; | ||
name: string; | ||
releaseDate: string; | ||
developers: string; | ||
description: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.