add links page
This commit is contained in:
parent
28078ca979
commit
9620ed2247
9 changed files with 418 additions and 1 deletions
31
types.d.ts
vendored
Normal file
31
types.d.ts
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
declare module "@11ty/eleventy-fetch" {
|
||||
|
||||
type FetchType =
|
||||
| "json"
|
||||
| "buffer"
|
||||
| "text";
|
||||
|
||||
type EleventyFetchOptionsBase<TType extends FetchType> = {
|
||||
type: TType;
|
||||
directory?: string;
|
||||
concurrency?: number;
|
||||
fetchOptions?: RequestInit;
|
||||
dryRun?: boolean;
|
||||
removeUrlQueryParams?: boolean;
|
||||
verbose?: boolean;
|
||||
hashLength?: number;
|
||||
duration?: string;
|
||||
formatUrlForDisplay?: (url: string) => string;
|
||||
}
|
||||
|
||||
type EleventyFetch = <TReturn, TType extends FetchType = "json">(url: string, options: EleventyFetchOptionsBase<TType>) =>
|
||||
Promise<
|
||||
TType extends "json" ? TReturn :
|
||||
TType extends "buffer" ? Buffer :
|
||||
TType extends "text" ? string :
|
||||
never
|
||||
>;
|
||||
|
||||
const fetch: EleventyFetch;
|
||||
export default fetch;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue