mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-05 17:50:03 +00:00
Add typings for 'react-document-meta' package
This commit is contained in:
17
types/react-document-meta/index.d.ts
vendored
Normal file
17
types/react-document-meta/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for react-document-meta 3.0
|
||||
// Project: https://github.com/kodyl/react-document-meta#readme
|
||||
// Definitions by: ulrichb <https://github.com/ulrichb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface DocumentMetaProps {
|
||||
readonly title?: string;
|
||||
readonly description?: string;
|
||||
readonly canonical?: string;
|
||||
}
|
||||
|
||||
declare class DocumentMeta extends React.Component<DocumentMetaProps> { }
|
||||
|
||||
export default DocumentMeta;
|
||||
22
types/react-document-meta/react-document-meta-tests.tsx
Normal file
22
types/react-document-meta/react-document-meta-tests.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as React from 'react';
|
||||
import DocumentMeta from 'react-document-meta';
|
||||
|
||||
class Test extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<DocumentMeta title="title" description="description" canonical="canonical" >
|
||||
<div>some child</div>
|
||||
</DocumentMeta>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TestWithDefaultProps extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<DocumentMeta>
|
||||
<div>some child</div>
|
||||
</DocumentMeta>
|
||||
);
|
||||
}
|
||||
}
|
||||
25
types/react-document-meta/tsconfig.json
Normal file
25
types/react-document-meta/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-document-meta-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-document-meta/tslint.json
Normal file
1
types/react-document-meta/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user