Merge pull request #32558 from ThomasK33/master

Added typings for Next-seo
This commit is contained in:
Pranav Senthilnathan
2019-01-28 17:32:39 -08:00
committed by GitHub
4 changed files with 158 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
// Type definitions for next-seo 1.10
// Project: https://github.com/garmeeh/next-seo#readme
// Definitions by: Thomas Kosiewski <https://github.com/ThomasK33>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { Component } from "react";
export interface NextSeoProps {
config: Config;
}
export interface Config {
title?: string;
titleTemplate?: string;
description?: string;
canonical?: string;
dangerouslySetAllPagesToNoIndex?: boolean;
noindex?: boolean;
twitter?: Twitter;
facebook?: Facebook;
openGraph?: OpenGraph;
}
export interface Twitter {
cardType?: string;
site?: string;
handle?: string;
}
export interface Facebook {
appId?: number;
}
export interface OpenGraph {
url?: string;
type?: string;
title?: string;
description?: string;
images?: ReadonlyArray<OpenGraphImages>;
defaultImageHeight?: number;
defaultImageWidth?: number;
locale?: string;
site_name?: string;
profile?: OpenGraphProfile;
book?: OpenGraphBook;
article?: OpenGraphArticle;
}
export interface OpenGraphImages {
url?: string;
width?: number;
height?: number;
alt?: string;
}
export interface OpenGraphProfile {
firstName?: string;
lastName?: string;
username?: string;
gender?: string;
}
export interface OpenGraphBook {
authors?: ReadonlyArray<string>;
isbn?: string;
releaseDate?: string;
tags?: ReadonlyArray<string>;
}
export interface OpenGraphArticle {
publishedTime?: string;
modifiedTime?: string;
expirationTime?: string;
authors?: ReadonlyArray<string>;
section?: string;
tags?: ReadonlyArray<string>;
}
export default class NextSeo extends Component<NextSeoProps> { }
+48
View File
@@ -0,0 +1,48 @@
import NextSeo from 'next-seo';
new NextSeo({
config: {
canonical: "",
dangerouslySetAllPagesToNoIndex: false,
description: "",
facebook: {
appId: 0,
},
noindex: false,
openGraph: {
book: {
authors: [""],
isbn: "",
releaseDate: "",
tags: [""],
},
defaultImageHeight: 0,
defaultImageWidth: 0,
description: "",
images: [{
alt: "",
height: 0,
url: "",
width: 0,
}],
locale: "",
profile: {
firstName: "",
gender: "",
lastName: "",
username: "",
},
site_name: "",
title: "",
type: "",
url: "",
},
title: "",
titleTemplate: "",
twitter: {
cardType: "",
handle: "",
site: "",
},
},
});
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"target": "es6",
"jsx": "react",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"next-seo-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }