|
1 | 1 | declare module 'react-helmet-async' {
|
2 | 2 | import * as React from 'react';
|
3 |
| - import { Helmet, HelmetData } from 'react-helmet'; |
4 |
| - export { Helmet }; |
5 | 3 |
|
6 |
| - export type FilledContext = { |
| 4 | + interface OtherElementAttributes { |
| 5 | + [key: string]: string | number | boolean | null | undefined; |
| 6 | + } |
| 7 | + |
| 8 | + type HtmlProps = JSX.IntrinsicElements['html'] & OtherElementAttributes; |
| 9 | + |
| 10 | + type BodyProps = JSX.IntrinsicElements['body'] & OtherElementAttributes; |
| 11 | + |
| 12 | + type LinkProps = JSX.IntrinsicElements['link']; |
| 13 | + |
| 14 | + type MetaProps = JSX.IntrinsicElements['meta']; |
| 15 | + |
| 16 | + export interface HelmetTags { |
| 17 | + baseTag: Array<any>; |
| 18 | + linkTags: Array<HTMLLinkElement>; |
| 19 | + metaTags: Array<HTMLMetaElement>; |
| 20 | + noscriptTags: Array<any>; |
| 21 | + scriptTags: Array<HTMLScriptElement>; |
| 22 | + styleTags: Array<HTMLStyleElement>; |
| 23 | + } |
| 24 | + |
| 25 | + export interface HelmetProps { |
| 26 | + async?: boolean; |
| 27 | + base?: any; |
| 28 | + bodyAttributes?: BodyProps; |
| 29 | + defaultTitle?: string; |
| 30 | + defer?: boolean; |
| 31 | + encodeSpecialCharacters?: boolean; |
| 32 | + htmlAttributes?: HtmlProps; |
| 33 | + onChangeClientState?: (newState: any, addedTags: HelmetTags, removedTags: HelmetTags) => void; |
| 34 | + link?: LinkProps[]; |
| 35 | + meta?: MetaProps[]; |
| 36 | + noscript?: Array<any>; |
| 37 | + script?: Array<any>; |
| 38 | + style?: Array<any>; |
| 39 | + title?: string; |
| 40 | + titleAttributes?: Object; |
| 41 | + titleTemplate?: string; |
| 42 | + } |
| 43 | + |
| 44 | + export class Helmet extends React.Component<HelmetProps> { |
| 45 | + } |
| 46 | + |
| 47 | + export interface HelmetData { |
| 48 | + base: HelmetDatum; |
| 49 | + bodyAttributes: HelmetHTMLBodyDatum; |
| 50 | + htmlAttributes: HelmetHTMLElementDatum; |
| 51 | + link: HelmetDatum; |
| 52 | + meta: HelmetDatum; |
| 53 | + noscript: HelmetDatum; |
| 54 | + script: HelmetDatum; |
| 55 | + style: HelmetDatum; |
| 56 | + title: HelmetDatum; |
| 57 | + titleAttributes: HelmetDatum; |
| 58 | + } |
| 59 | + |
| 60 | + export interface HelmetDatum { |
| 61 | + toString(): string; |
| 62 | + toComponent(): React.Component<any>; |
| 63 | + } |
| 64 | + |
| 65 | + export interface HelmetHTMLBodyDatum { |
| 66 | + toString(): string; |
| 67 | + toComponent(): React.HTMLAttributes<HTMLBodyElement>; |
| 68 | + } |
| 69 | + |
| 70 | + export interface HelmetHTMLElementDatum { |
| 71 | + toString(): string; |
| 72 | + toComponent(): React.HTMLAttributes<HTMLHtmlElement>; |
| 73 | + } |
| 74 | + |
| 75 | + export interface FilledContext { |
7 | 76 | helmet: HelmetData;
|
8 | 77 | };
|
9 | 78 |
|
10 |
| - type ProviderProps = { |
| 79 | + interface ProviderProps { |
11 | 80 | context?: {};
|
12 | 81 | };
|
13 | 82 |
|
14 |
| - export const HelmetProvider: React.ComponentClass<ProviderProps>; |
| 83 | + export class HelmetProvider extends React.Component<ProviderProps> { |
| 84 | + static canUseDOM = canUseDOM; |
| 85 | + } |
15 | 86 | }
|
0 commit comments