Skip to content

Commit

Permalink
chore: fix the type mess
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat committed Jan 29, 2024
1 parent 3182fde commit 312aebd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/npm/@amazeelabs/save-webpage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"test:static": "tsc --noEmit && eslint '**/*.{ts,tsx,js,jsx}' --ignore-path='./.gitignore'"
},
"dependencies": {
"@types/website-scraper": "^1.2.10",
"website-scraper": "^5.3.1"
},
"devDependencies": {
"@amazeelabs/eslint-config": "1.4.43",
"@amazeelabs/prettier-config": "1.1.3",
"@types/website-scraper": "^1.2.10",
"typescript": "5.3.3"
},
"keywords": [],
Expand Down
19 changes: 18 additions & 1 deletion packages/npm/@amazeelabs/save-webpage/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
import scrape from 'website-scraper';

type Options = Omit<Parameters<typeof scrape>[0], 'urls' | 'directory'>;
type Options = {
directory: string;
urlFilter?: (url: string) => boolean;
filenameGenerator?: string;
defaultFilename?: string;
prettifyUrls?: boolean;
request?: {
headers: {
[key: string]: any;
};
};
recursive?: boolean;
maxDepth?: number;
ignoreErrors?: boolean;
maxRecursiveDepth?: number;
requestConcurrency?: number;
plugins?: object[];
};

export async function saveWebpage(args: {
/**
Expand Down
15 changes: 8 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 312aebd

Please sign in to comment.