-
Notifications
You must be signed in to change notification settings - Fork 39
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
no support for tsx #39
Comments
Just create a file ending with declare module '@ideasio/add-to-homescreen-react'; |
Doesn't work sadly. |
I'm late for this but I would suggest to create a new Then paste this in the declare module '@ideasio/add-to-homescreen-react' {
interface PlatformPropType {
showClasses?: string[];
targetUrl?: string;
images?: { src?: string; alt?: string }[];
action?: { ok?: string; cancel?: string; guidanceCancel?: string };
}
interface AddToHomeScreenProps {
appId?: string;
debug?: boolean;
activateLogging?: boolean;
startAutomatically?: boolean;
skipFirstVisit?: boolean;
minPageViews?: number;
startDelay?: number;
lifespan?: number;
displayPace?: number;
mustShowCustomPrompt?: boolean;
maxDisplayCount?: number;
validLocation?: RegExp[];
onInit?: () => void;
onShow?: () => void;
onAdd?: () => void;
onInstall?: () => void;
onCancel?: () => void;
showClasses?: string[];
showClass?: string;
hideClass?: string;
customCriteria?: null | (() => void) | boolean;
customPromptContent?: {
title?: string;
src?: string;
cancelMsg?: string;
installMsg?: string;
guidanceCancelMsg?: string;
};
customPromptElements?: {
container?: string;
containerAddOns?: string;
banner?: string;
bannerAddOns?: string;
logoCell?: string;
logoCellAddOns?: string;
logo?: string;
logoAddOns?: string;
titleCell?: string;
titleCellAddOns?: string;
title?: string;
titleAddOns?: string;
cancelButtonCell?: string;
cancelButtonCellAddOns?: string;
cancelButton?: string;
cancelButtonAddOns?: string;
installButtonCell?: string;
installButtonCellAddOns?: string;
installButton?: string;
installButtonAddOns?: string;
guidance?: string;
guidanceAddOns?: string;
guidanceImageCell?: string;
guidanceImageCellAddOns?: string;
guidanceCancelButton?: string;
guidanceCancelButtonAddOns?: string;
};
customPromptPlatformDependencies?: {
native?: PlatformPropType;
chromium?: PlatformPropType;
edge?: PlatformPropType;
iphone?: PlatformPropType;
ipad?: PlatformPropType;
firefox?: PlatformPropType;
samsung?: PlatformPropType;
opera?: PlatformPropType;
};
}
declare const AddToHomeScreen: React.FC<AddToHomeScreenProps>;
export default AddToHomeScreen;
} Perhaps I should make a PR to include this to NPM so Typescript users would be able to use it too. |
how to use this library with cra and tsx? there is no way to import it. It keeps complaining that module not found!
The text was updated successfully, but these errors were encountered: