Created
May 8, 2024 17:27
-
-
Save okysky1121/9394a0985eb6a6297901633c5aaae490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export namespace oEmbed { | |
interface Request { | |
url: string; | |
max_width?: number; // maxwidth | |
max_height?: number; // maxheight | |
format?: "json" | "xml"; | |
} | |
interface Response { | |
type: "photo" | "video" | "link" | "rich"; | |
version: "1.0"; | |
title?: string; | |
author_name?: string; | |
author_url?: string; | |
provider_name?: string; | |
provider_url?: string; | |
cache_age?: number; | |
thumbnail_url?: string; | |
thumbnail_width?: number; | |
thumbnail_height?: number; | |
} | |
interface SizedResponse { | |
width: number; | |
height: number; | |
} | |
interface PhotoResponse extends Response, SizedResponse { | |
type: "photo"; | |
url: string; | |
} | |
interface VideoResponse extends Response, SizedResponse { | |
type: "video"; | |
html: string; | |
} | |
interface LinkResponse extends Response { | |
type: "link"; | |
} | |
interface RichResponse extends Response, SizedResponse { | |
type: "rich"; | |
html: string; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment