@realfavicongenerator/check-favicon
Version:
Check the favicon of a website
142 lines (141 loc) • 3.93 kB
TypeScript
export declare enum CheckerStatus {
Ok = "Ok",
Error = "Error",
Warning = "Warning"
}
export declare enum MessageId {
noHead = 0,
svgFaviconDeclared = 1,
noSvgFavicon = 2,
multipleSvgFavicons = 3,
noSvgFaviconHref = 4,
svgFavicon404 = 5,
svgFaviconCannotGet = 6,
svgFaviconDownloadable = 7,
svgFaviconSquare = 8,
svgFaviconNotSquare = 9,
noIcoFavicon = 10,
multipleIcoFavicons = 11,
icoFaviconDeclared = 12,
noIcoFaviconHref = 13,
icoFavicon404 = 14,
icoFaviconCannotGet = 15,
icoFaviconDownloadable = 16,
icoFaviconExtraSizes = 17,
icoFaviconMissingSizes = 18,
icoFaviconExpectedSizes = 19,
noDesktopPngFavicon = 20,
no96x96DesktopPngFavicon = 21,
desktopPngFaviconDeclared = 22,
noDesktopPngFaviconHref = 23,
desktopPngFaviconCannotGet = 24,
desktopPngFaviconDownloadable = 25,
desktopPngFavicon404 = 26,
desktopPngFaviconWrongSize = 27,
desktopPngFaviconRightSize = 28,
noTouchWebAppTitle = 29,
multipleTouchWebAppTitles = 30,
emptyTouchWebAppTitle = 31,
touchWebAppTitleDeclared = 32,
noTouchIcon = 33,
duplicatedTouchIconSizes = 34,
touchIconWithSize = 35,
touchIconDeclared = 36,
noTouchIconHref = 37,
touchIcon404 = 38,
touchIconCannotGet = 39,
touchIconDownloadable = 40,
touchIconSquare = 41,
touchIcon180x180 = 42,
touchIconNotSquare = 43,
touchIconWrongSize = 44,
noManifest = 45,
noManifestHref = 46,
manifest404 = 47,
manifestCannotGet = 48,
manifestInvalidJson = 49,
manifestName = 50,
noManifestName = 51,
manifestShortName = 52,
noManifestShortName = 53,
manifestBackgroundColor = 54,
noManifestBackgroundColor = 55,
manifestThemeColor = 56,
noManifestThemeColor = 57,
noManifestIcons = 58,
noManifestIcon = 59,
manifestIconDeclared = 60,
manifestIconCannotGet = 61,
manifestIconDownloadable = 62,
manifestIcon404 = 63,
manifestIconNoHref = 64,
manifestIconNotSquare = 65,
manifestIconRightSize = 66,
manifestIconSquare = 67,
manifestIconWrongSize = 68,
googleNoRobotsFile = 69,
googleRobotsFileFound = 70,
googleIcoBlockedByRobots = 71,
googleIcoAllowedByRobots = 72,
googleSvgIconBlockedByRobots = 73,
googleSvgIconAllowedByRobots = 74,
googlePngIconBlockedByRobots = 75,
googlePngIconAllowedByRobots = 76
}
export type CheckerMessage = {
status: CheckerStatus;
id: MessageId;
text: string;
};
export type FetchResponse = {
status: number;
contentType: string | null;
readableStream?: ReadableStream | null;
};
export type Fetcher = (url: string, contentType?: string) => Promise<FetchResponse>;
export type CheckedIcon = {
content: string | null;
url: string | null;
width: number | null;
height: number | null;
};
export type DesktopSingleReport = {
messages: CheckerMessage[];
icon: CheckedIcon | null;
};
export type DesktopFaviconReport = {
messages: CheckerMessage[];
icon: string | null;
icons: {
png: CheckedIcon | null;
ico: CheckedIcon | null;
svg: CheckedIcon | null;
};
};
export type TouchIconTitleReport = {
messages: CheckerMessage[];
appTitle?: string;
};
export type TouchIconIconReport = {
messages: CheckerMessage[];
touchIcon: string | null;
};
export type WebAppManifestReport = {
messages: CheckerMessage[];
name?: string;
shortName?: string;
backgroundColor?: string;
themeColor?: string;
icon: string | null;
};
export type FaviconReport = {
desktop: DesktopFaviconReport;
touchIcon: TouchIconReport;
webAppManifest: WebAppManifestReport;
};
export type TouchIconReport = TouchIconIconReport & TouchIconTitleReport;
export type GoogleReport = {
messages: CheckerMessage[];
icon: string | null;
icons: CheckedIcon[];
};