ogp-parser
Version:
This Package is Open Graph Parser.
36 lines (35 loc) • 808 B
TypeScript
type OembedInfo = {
type: 'json' | 'xml';
url: string;
};
export type OembedData = {
version: string;
title?: string;
author_name?: string;
author_url?: string;
provider_name?: string;
provider_url?: string;
cache_age?: string;
thumbnail_url?: string;
thumbnail_width?: number | string;
thumbnail_height?: number | string;
} & ({
type: 'photo';
url: string;
width: number | string;
height: number | string;
} | {
type: 'video';
html: string;
width: number | string;
height: number | string;
} | {
type: 'rich';
html: string;
width: number | string;
height: number | string;
} | {
type: 'link';
});
export declare const fetchOembed: ({ type, url, }: OembedInfo) => Promise<OembedData | undefined>;
export {};