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

[Question] - Typescript? #32

Open
IrvingArmenta opened this issue Jul 3, 2019 · 2 comments · May be fixed by #33
Open

[Question] - Typescript? #32

IrvingArmenta opened this issue Jul 3, 2019 · 2 comments · May be fixed by #33

Comments

@IrvingArmenta
Copy link

Typescript Support

  • Is there Typescript support planned?
@rosenbjerg
Copy link

I need that as well

@squidfunk
Copy link

squidfunk commented Apr 6, 2020

Save this in typings/preact-helmet.d.ts:

declare module "preact-helmet" {
  import { ComponentType, JSX } from "preact"

  /**
   * Helmet properties
   */
  export interface HelmetProperties {
    htmlAttributes?: JSX.HTMLAttributes<HTMLHtmlElement>
    title?: string
    titleTemplate?: string
    defaultTitle?: string
    titleAttributes?: JSX.HTMLAttributes<HTMLTitleElement>
    base?: JSX.HTMLAttributes<HTMLBaseElement>
    meta?: Array<JSX.HTMLAttributes<HTMLMetaElement>>
    link?: Array<JSX.HTMLAttributes<HTMLLinkElement>>
    script?: Array<JSX.HTMLAttributes<HTMLScriptElement>>
    noscript?: Array<JSX.HTMLAttributes<HTMLElement>>
    style?: Array<JSX.HTMLAttributes<HTMLStyleElement>>
  }

  /**
   * Helmet
   */
  const Helmet: ComponentType<HelmetProperties>
  export default Helmet
}

@Download I can PR this, if desired.

@DamianoMagrini DamianoMagrini linked a pull request Jun 17, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants