@sveltinio/seo
Version:
A collection of type-safe SEO related Svelte components to easily add structured SEO data to pages in Svelte & SvelteKit.
227 lines (226 loc) • 6.31 kB
TypeScript
export type SEOWebSite = {
name: string;
baseURL: string;
language: string;
title: string;
description: string;
favicon?: string;
logo?: string;
copyright?: string;
keywords?: Array<string>;
contactEmail?: string;
socials?: Socials;
creator?: SEOPerson | SEOOrganization;
};
export type Socials = {
[key: string]: string;
};
export type SEOMenuItem = {
identifier: string;
name: string;
url: string;
weight: number;
external?: boolean;
children?: Array<SEOMenuItem>;
};
export type ImageObject = {
url: string;
alt?: string;
};
export type SEOWebPage = {
url: string;
title: string;
description?: string;
author?: string;
keywords?: Array<string>;
image?: ImageObject;
opengraph?: OpenGraph;
twitter?: TwitterCard;
};
export type SEOAddress = {
city?: string;
state?: string;
postalCode?: string;
streetAddress?: string;
};
export type SEOContact = {
name?: string;
jobTitle?: string;
email?: string;
telephone?: string;
url?: string;
address?: SEOAddress | string;
};
export type SEOPerson = SEOContact;
export type SEOOrganization = SEOContact;
/**
* * OpenGraph
*/
export declare enum EnumOpenGraphType {
Website = "website",
Article = "article",
Book = "book",
Business = "business.business",
Product = "product",
Profile = "profile",
MusicSong = "music.song",
MusicAlbum = "music.album",
MusicPlaylist = "music.playlist",
MusicRadioStation = "music.radio_station",
VideoMovie = "video.movie",
VideoEpisode = "video.episode",
VideoTVShow = "video.tv_show",
VideoOther = "video.other"
}
export declare enum EnumOpenGraphProfileGender {
Male = "male",
Female = "female"
}
export declare const OpenGraphType: typeof EnumOpenGraphType;
export declare const OpenGraphProfileGender: typeof EnumOpenGraphProfileGender;
export type OpenGraph = {
type: string;
article?: OpenGraphArticle;
book?: OpenGraphBook;
business?: OpenGraphBusiness;
product?: OpenGraphProduct;
profile?: OpenGraphProfile;
song?: OpenGraphMusicSong;
album?: OpenGraphMusicAlbum;
playlist?: OpenGraphMusicPlaylist;
radioStation?: OpenGraphMusicRadioStation;
movie?: OpenGraphVideoMovie;
episode?: OpenGraphVideoEpisode;
tvShow?: OpenGraphVideoTVShow;
};
export type ISODateString = string;
export type OpenGraphArticle = {
published_time?: ISODateString;
modified_time?: ISODateString;
expiration_time?: ISODateString;
section?: string;
tags?: Array<string>;
};
export type OpenGraphBook = {
author: string;
isbn?: string;
release_date?: ISODateString;
tags?: Array<string>;
};
export type OpenGraphBusiness = {
street_address?: string;
city?: string;
state?: string;
postal_code?: number;
country?: string;
};
export type OpenGraphProduct = {
plural_title?: string;
price?: number;
currency?: string;
};
export type OpenGraphProfile = {
url: string;
first_name?: string;
last_name?: string;
username?: string;
gender?: EnumOpenGraphProfileGender;
};
type OpenGraphMusic = {
url: string;
disc?: number;
track?: number;
};
export type OpenGraphMusicSong = OpenGraphMusic & {
duration?: number;
album?: Array<OpenGraphMusicAlbum>;
musician?: Array<OpenGraphProfile>;
};
export type OpenGraphMusicAlbum = OpenGraphMusic & {
songs?: Array<OpenGraphMusicSong>;
musicians?: Array<OpenGraphProfile>;
release_date?: ISODateString;
};
export type OpenGraphMusicPlaylist = OpenGraphMusic & {
song?: OpenGraphMusicSong;
creator?: OpenGraphProfile;
};
export type OpenGraphMusicRadioStation = {
creator?: OpenGraphProfile;
};
type OpenGraphVideo = {
actor?: Array<OpenGraphProfile>;
actorRole?: string;
director?: Array<OpenGraphProfile>;
writer?: Array<OpenGraphProfile>;
duration?: number;
release_date?: ISODateString;
tags?: Array<string>;
};
export type OpenGraphVideoMovie = OpenGraphVideo;
export type OpenGraphVideoTVShow = OpenGraphVideo;
export type OpenGraphVideoOther = OpenGraphVideo;
export type OpenGraphVideoEpisode = OpenGraphVideo & {
series: OpenGraphVideoTVShow;
};
/**
* * EnumTwitterCardType
*
* * Enumeration with different TwitterCard types:
* * https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards
*
* - SUMMARY: Title, description, and thumbnail
* - LARGE: Similar to the Summary Card, but with a prominently-featured image
* - APP: A Card with a direct download to a mobile app
* - PLAYER: A Card that can display video/audio/media
*/
export declare enum EnumTwitterCardType {
Summary = "summary",
Large = "summary_large_image",
App = "app",
Player = "player"
}
export declare const TwitterCardType: typeof EnumTwitterCardType;
/**
* * TwitterCard
*
* @param type The card type: summary | summary_large_image | player | app
* @param site (optional) The Twitter @username the card should be attributed to.
* @param player (optional) A Card that can display video/audio/media
* @param app (optional) A Card with a direct download to a mobile app
*/
export type TwitterCard = {
type: string;
site?: string;
player?: TwitterPlayer;
app?: TwitterApp;
};
/**
* * TwitterPlayer
*
* * https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card
* @param url HTTPS URL to iFrame player
* @param width Width of iFrame specified in twitter:player in pixels
* @param height Height of iFrame specified in twitter:player in pixels
*/
export type TwitterPlayer = {
url: string;
width: string;
height: string;
};
/**
* * ITwitterApp
*
* * https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/app-card
* @param country (optional)
* @param idIPhone String value, the numeric representation of your app ID in the App Store
* @param idIPad String value, the numeric representation of your app ID in the App Store
* @param idGooglePlay String value, the numeric representation of your app ID in the Google Play
*/
export type TwitterApp = {
country?: string;
idIPhone: string;
idIPad: string;
idGooglePlay: string;
};
export {};