pyseoa-ts
Version:
SEO analysis tools for the web, ported from pyseoa (Python) to TypeScript
97 lines (96 loc) • 2.12 kB
TypeScript
export type RunSeoAuditOptions = {
crawl?: boolean;
maxPages?: number;
maxDepth?: number;
};
export type PageAnalysisResult = {
url: string;
result: AnalysisResult;
};
export type AuditSummary = {
pages: PageAnalysisResult[];
summary: {
averageScore: number;
averagePercentage: number;
maxPages: number;
fields: string[];
};
};
export type RunAnalysisOptions = {
keywordDensity?: boolean;
densityThresholds?: {
low: number;
high: number;
};
};
export interface AnalysisResult {
title: TitleResult;
metaDescription: MetaDescriptionResult;
h1: H1Result;
canonical: CanonicalResult;
robots: RobotsResult;
keywords: KeywordsResult;
openGraph: OpenGraphResult;
twitterCard: TwitterCardResult;
keywordDensity: KeywordDensityResult[];
scoreSummary: {
totalScore: number;
maxScore: number;
percentage: number;
breakdown: Record<string, number>;
};
}
export type AuditProgress = {
type: "crawl" | "analyze";
url: string;
pageIndex: number;
stage: "fetch" | "skip" | "analyze";
};
export type CanonicalResult = {
score: number;
message: string;
canonicalUrl?: string;
};
export type H1Result = {
score: number;
message: string;
h1Tags: string[];
};
export type KeywordDensityResult = {
keyword: string;
count: number;
totalWords: number;
density: number;
score: number;
message: string;
};
export type KeywordsResult = {
score: number;
message: string;
keywords: string[];
};
export type MetaDescriptionResult = {
score: number;
message: string;
description?: string;
};
export type OpenGraphResult = {
score: number;
message: string;
tags: Record<string, string>;
};
export type RobotsResult = {
score: number;
message: string;
content?: string;
};
export type TitleResult = {
score: number;
message: string;
title?: string;
};
export type TwitterCardResult = {
score: number;
message: string;
tags: Record<string, string>;
};