diff --git a/README.md b/README.md index 1be5cb6..fd5f6a7 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ const result = unfurl('https://github.com/trending') #### result is `>` ```typescript type Metadata = { + title?: string + description?: string + keywords?: string[] + favicon?: string oEmbed?: { type: 'photo' | 'video' | 'link' | 'rich' version?: string @@ -47,11 +51,11 @@ type Metadata = { provider_name?: string provider_url?: string cache_age?: number - thumbnails?: { + thumbnails?: [{ url?: string width?: number height?: number - }[] + }] } twitter_card: { card: string @@ -82,7 +86,7 @@ type Metadata = { name: string url: string } - }, + } images: { url: string alt: string @@ -102,7 +106,7 @@ type Metadata = { audio?: { url: string secure_url?: string - type: string + type: string }[] description?: string determiner?: string diff --git a/src/types.ts b/src/types.ts index c9c6ac2..f31443c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -14,10 +14,10 @@ export type Opts = { } export type Metadata = { - title: string - description: string - keywords: string[] - favicon: string + title?: string + description?: string + keywords?: string[] + favicon?: string oEmbed?: { type: 'photo' | 'video' | 'link' | 'rich' version?: string @@ -67,7 +67,7 @@ export type Metadata = { url: string alt: string }[] - }[] + } open_graph: { title: string type: string @@ -95,5 +95,5 @@ export type Metadata = { width?: number tags?: string[] }[] - }[] + } }