Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typings #74

Merged
merged 2 commits into from Feb 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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[]
}[]
}[]
}
}