Skip to content

Commit

Permalink
fix: typings (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrikas Kuzmickas committed Feb 28, 2021
1 parent 7482693 commit 915bf8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 8 additions & 4 deletions README.md
Expand Up @@ -38,6 +38,10 @@ const result = unfurl('https://github.com/trending')
#### result is `<Promise<Metadata>>`
```typescript
type Metadata = {
title?: string
description?: string
keywords?: string[]
favicon?: string
oEmbed?: {
type: 'photo' | 'video' | 'link' | 'rich'
version?: string
Expand All @@ -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
Expand Down Expand Up @@ -82,7 +86,7 @@ type Metadata = {
name: string
url: string
}
},
}
images: {
url: string
alt: string
Expand All @@ -102,7 +106,7 @@ type Metadata = {
audio?: {
url: string
secure_url?: string
type: string
type: string
}[]
description?: string
determiner?: string
Expand Down
12 changes: 6 additions & 6 deletions src/types.ts
Expand Up @@ -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
Expand Down Expand Up @@ -67,7 +67,7 @@ export type Metadata = {
url: string
alt: string
}[]
}[]
}
open_graph: {
title: string
type: string
Expand Down Expand Up @@ -95,5 +95,5 @@ export type Metadata = {
width?: number
tags?: string[]
}[]
}[]
}
}

0 comments on commit 915bf8a

Please sign in to comment.