-
Notifications
You must be signed in to change notification settings - Fork 14
/
.d.ts
173 lines (167 loc) · 4.32 KB
/
.d.ts
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
declare module 'part:@sanity/*';
declare module '*.module.css' {
const c: { [key: string]: string };
export = c;
}
declare module 'react-serp-preview' {
const SerpPreview: import('react').FC<{
title: string
metaDescription: string
url: string
}>
export default SerpPreview
}
declare module 'yoastseo' {
export class Paper {
constructor(
html: string,
options: {
keyword?: string;
synonyms?: string;
description?: string;
title?: string;
titleWidth?: number;
url?: string;
locale?: string;
permalink?: string;
}
);
}
export class Researcher {
constructor(paper: Paper);
getResearch(type: 'keyphraseLength'): number;
getResearch(type: 'metaDescriptionKeyword'): number;
getResearch(type: 'getLinkStatistics'):
| false
| {
total: number;
totalNaKeyword: number;
keyword: {
totalKeyword: number;
matchedAnchors: any[];
};
internalTotal: number;
internalDofollow: number;
internalNofollow: number;
externalTotal: number;
externalDofollow: number;
externalNofollow: number;
otherTotal: number;
otherDofollow: number;
otherNofollow: number;
};
getResearch(type: 'firstParagraph'):
| false
| {
foundInOneSentence: boolean;
foundInParagraph: boolean;
keyphraseOrSynonym: string;
};
getResearch(type: 'getKeywordDensity'): number;
getResearch(type: 'wordCountInText'): number;
getResearch(type: 'keywordCount'):
| false
| {
count: number;
length: number;
markings: any[];
matches: string[];
};
getResearch(type: 'findKeywordInPageTitle'):
| false
| {
allWordsFound: boolean;
exactMatchFound: boolean;
exactMatchKeyphrase: boolean;
position: number;
};
getResearch(type: 'altTagCount'):
| false
| {
noAlt: number;
withAlt: number;
withAltKeyword: number;
withAltNonKeyword: number;
};
getResearch(type: 'pageTitleWidth'): number;
getResearch(type: 'keywordCountInUrl'):
| false
| {
keyphraseLength: number;
percentWordMatches: number;
};
getResearch(type: 'countSentencesFromText'): string[];
getResearch(type: 'passiveVoice'):
| false
| {
passives: string[];
total: number;
};
getResearch(type: 'getSentenceBeginnings'):
| false
| {
word: string;
count: number;
sentences: string[];
}[];
getResearch(type: 'sentences'): string[];
getResearch(type: 'calculateFleschReading'): number;
getResearch(type: 'getParagraphLength'):
| false
| {
wordCount: number;
text: string;
}[];
getResearch(type: 'findTransitionWords'):
| false
| {
sentenceResults: {
sentence: string;
transitionWords: string[];
}[];
totalSentences: number;
transitionWordSentences: number;
};
}
export type AssessmentResult = {
score: number
text :string
}
export type AssessmentCategory = import('./src/constants/AssessmentCategory').AssessmentCategory
export type AssessmentRating = 'error' | 'feedback' | 'bad' | 'ok' | 'good' | ''
export class Assessment {
constructor(...args: any[])
getResult(paper: Paper, researcher: Researcher, i18n: import('jed')): AssessmentResult | null
}
export const assessments: Record<
AssessmentCategory,
Record<string, Assessment | typeof Assessment>
>
export const helpers: {
scoreToRating(score: number): AssessmentRating
}
}
declare module 'yoastseo/src/config/content/default.js' {
const config: Record<string, any>
export default config
}
declare module 'string-pixel-width' {
function pixelWidth(
input: string,
settings?: {
font?: string;
size?: number;
}
): number;
export default pixelWidth;
}
declare module 'jed' {
export default class Jed {
constructor(opts: {
domain: string
locale_data: Record<string, (
Record<string, unknown>
)>
})
}
}