declare type DateTime = Date; declare type Url = string; export declare namespace OpenGraph { type WebsiteType = "website"; type ArticleType = "article"; type ProductType = "product"; type BookType = "book"; type ProfileType = "profile"; type MusicType = "music.song" | "music.album" | "music.playlist" | "music.radio_station"; type VideoType = "video" | "video.movie" | "video.episode"; type ObjectType = WebsiteType | ArticleType | ProductType | BookType | ProfileType | VideoType; interface Alternate { alternate: string; } interface Basic { title: string; image: Url | Image; url: Url; audio?: Url | Audio; description?: string; determiner?: string; locale?: string | Array; site_name?: string; } interface Image { url: string; secure_url?: Url; type?: string; width?: string; height?: string; alt?: string; } interface Audio { url: string; secure_url?: string; type?: string; } interface Website extends Basic { type: T; } interface Article extends Basic { type: T; article: { published_time: DateTime; modified_time: DateTime; expiration_time: DateTime; author: Url | Url[]; section: string; tag: string | string[]; }; } interface Amount { amount: number; } interface Currency { currency: string; } interface Product extends Basic { type: T; product: { plural_title?: string; price: Array; }; } interface Book extends Basic { type: T; book: { author: Url | Url[]; isbn: string; release_date: DateTime; tag: string | string[]; }; } interface Profile extends Basic { type: T; book: { first_name: string; last_name: string; username: string; gender: "male" | "female"; }; } interface Music extends Basic { type: T; music: Url | Music.Props; } interface Video extends Basic { type: T; video: Url | Video.Props; } namespace Music { interface Disc { disc: number; } interface Track { track: number; } export interface Song { duration: number; album: Url | Array; musician: Url; } export interface Album { song: Url | Url[] | Array; musician: Url; release_date: DateTime; } export interface Playlist { song: Url | Url[] | Array; creator: Url; } export interface RadioStation { creator: Url; } export type Props = T extends "music.song" ? Music.Song : T extends "music.album" ? Music.Album : T extends "music.playlist" ? Music.Playlist : T extends "music.radio_station" ? Music.RadioStation : never; export {}; } namespace Video { interface Role { role: string; } export interface Base { url: string; secure_url?: string; type?: string; width?: string; height?: string; } export interface Movie extends Base { actor: string | string[] | Array; director: Url | Url[]; writer: Url | Url[]; duration: number; release_date: DateTime; tag: string | string[]; } export interface Episode extends Base { actor: string | string[] | Array; director: string | string[]; writer: string | string[]; duration: number; release_date: DateTime; tag: string | string[]; series: string; } export type Props = T extends "video" ? Video.Base : T extends "video.movie" ? Video.Movie : T extends "video.episode" ? Video.Episode : never; export {}; } export type Metadata = T extends WebsiteType ? Website : T extends ArticleType ? Article : T extends ProductType ? Product : T extends BookType ? Book : T extends ProfileType ? Profile : T extends MusicType ? Music : T extends VideoType ? Video : never; interface Meta { property: string; content: string; } export const build: (object: any, iterator: (key: string, value: string) => any, parent?: string | undefined) => Meta[]; export {}; } export {};