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

React TypesSscript #94

Open
rdtawagon opened this issue Apr 11, 2023 · 2 comments
Open

React TypesSscript #94

rdtawagon opened this issue Apr 11, 2023 · 2 comments

Comments

@rdtawagon
Copy link

Does this library work on typescript?

@thenick775
Copy link

I found it did not unless I generated my own type definitions.

I published this fork (re-written with hooks, vite, and typescript) to satisfy this need for one of my projects:

https://www.npmjs.com/package/react-ios-pwa-prompt-ts

@mgsgde
Copy link

mgsgde commented Jan 14, 2024

Simply create a .d.ts file and declare the module:

declare module 'react-ios-pwa-prompt' {
  import React from 'react';

  interface PWAPromptProps {
    timesToShow?: number;
    promptOnVisit?: number;
    permanentlyHideOnDismiss?: boolean;
    copyTitle?: string;
    copyBody?: string;
    copyShareButtonLabel?: string;
    copyAddHomeButtonLabel?: string;
    copyClosePrompt?: string;
    delay?: number;
    debug?: boolean;
    onClose?: () => void;
  }

  const PWAPrompt: React.ComponentType<PWAPromptProps>;
  export default PWAPrompt;
}

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

No branches or pull requests

3 participants