mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[react-helmet] replace to HTMLHtmlElement from HTMLElement (#39161)
This commit is contained in:
parent
2631e23ba6
commit
ec88d3924d
17
types/react-helmet/index.d.ts
vendored
17
types/react-helmet/index.d.ts
vendored
@ -1,11 +1,20 @@
|
||||
// Type definitions for react-helmet 5.0
|
||||
// Project: https://github.com/nfl/react-helmet
|
||||
// Definitions by: Evan Bremer <https://github.com/evanbb>, Isman Usoh <https://github.com/isman-usoh>, François Nguyen <https://github.com/lith-light-g>, Kok Sam <https://github.com/sammkj>, Yui T. <https://github.com/yuit>
|
||||
// Definitions by: Evan Bremer <https://github.com/evanbb>
|
||||
// Isman Usoh <https://github.com/isman-usoh>
|
||||
// François Nguyen <https://github.com/lith-light-g>
|
||||
// Kok Sam <https://github.com/sammkj>
|
||||
// Yui T. <https://github.com/yuit>
|
||||
// Yamagishi Kazutoshi <https://github.com/ykzts>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
type HtmlProps = JSX.IntrinsicElements['html'];
|
||||
|
||||
type BodyProps = JSX.IntrinsicElements['body']
|
||||
|
||||
type LinkProps = JSX.IntrinsicElements['link'];
|
||||
|
||||
type MetaProps = JSX.IntrinsicElements['meta'];
|
||||
@ -22,11 +31,11 @@ export interface HelmetTags {
|
||||
export interface HelmetProps {
|
||||
async?: boolean;
|
||||
base?: any;
|
||||
bodyAttributes?: Object;
|
||||
bodyAttributes?: BodyProps;
|
||||
defaultTitle?: string;
|
||||
defer?: boolean;
|
||||
encodeSpecialCharacters?: boolean;
|
||||
htmlAttributes?: any;
|
||||
htmlAttributes?: HtmlProps;
|
||||
onChangeClientState?: (
|
||||
newState: any,
|
||||
addedTags: HelmetTags,
|
||||
@ -74,7 +83,7 @@ export interface HelmetHTMLBodyDatum {
|
||||
|
||||
export interface HelmetHTMLElementDatum {
|
||||
toString(): string;
|
||||
toComponent(): React.HTMLAttributes<HTMLElement>;
|
||||
toComponent(): React.HTMLAttributes<HTMLHtmlElement>;
|
||||
}
|
||||
|
||||
export const peek: () => HelmetData;
|
||||
|
||||
@ -108,6 +108,10 @@ function HTML() {
|
||||
<html lang="en" />
|
||||
</HelmetDefaultExport>;
|
||||
|
||||
// $ExpectError
|
||||
<Helmet htmlAttributes={{ invalidProp: 'foo' }} />;
|
||||
// $ExpectError
|
||||
<Helmet bodyAttributes={{ invalidProp: 'foo' }} />;
|
||||
// $ExpectError
|
||||
<Helmet link={[ invalidProp: 'foo' ]} />;
|
||||
// $ExpectError
|
||||
|
||||
Loading…
Reference in New Issue
Block a user