-
-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathtypes.ts
More file actions
35 lines (29 loc) · 708 Bytes
/
types.ts
File metadata and controls
35 lines (29 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export type Options = {
/** How many requests can be made at the same time */
concurrency?: number
/**
* Match pathname by specific patterns, powered by micromatch
* Only pages matched by this will be fetched
*/
match?: string[]
/**
* The CSS selector to find content
*/
contentSelector?:
| string
| ((ctx: { pathname: string }) => string | void | undefined)
/**
* Limit the result to this amount of pages
*/
limit?: number
/**
* A custom function to fetch URL
*/
fetch?: (url: string, init: RequestInit) => Promise<Response>
}
export type Page = {
title: string
url: string
content: string
}
export type FetchSiteResult = Map<string, Page>