@pinwheel/react-modal
Advanced tools
Comparing version 1.0.6 to 2.0.0-alpha
/// <reference types="react" /> | ||
export declare type LinkResult = { | ||
accountId: string; | ||
job: string; | ||
userSelectedParameters: { | ||
amount?: { | ||
value: number; | ||
unit: '%' | '$'; | ||
}; | ||
}; | ||
}; | ||
export declare type ErrorType = 'clientError' | 'systemError' | 'userActionRequired' | 'platformError' | 'invalidAccountsConfiguration' | 'invalidUserInput' | 'invalidLinkToken'; | ||
export declare type Error = { | ||
type: ErrorType; | ||
code: string; | ||
message: string; | ||
}; | ||
declare type EventPayload = { | ||
selectedEmployerId: string; | ||
selectedEmployerName: string; | ||
} | { | ||
selectedPlatformId: string; | ||
selectedPlatformName: string; | ||
} | { | ||
value: number; | ||
unit: '%' | '$'; | ||
} | LinkResult | { | ||
accountId: string; | ||
} | Error | {} | undefined; | ||
interface PinwheelOpenOptions { | ||
linkToken: string; | ||
onSuccess?: (result: { | ||
tokenId: string; | ||
onLogin?: (result: { | ||
accountId: string; | ||
}) => void; | ||
onExit?: (error: { | ||
errorCode: string; | ||
errorMsg: string; | ||
}, result: { | ||
tokenId: string; | ||
}) => void; | ||
onEvent?: (eventName: string, params: { | ||
modalSessionId?: string; | ||
[key: string]: any; | ||
}) => void; | ||
onSuccess?: (result: LinkResult) => void; | ||
onError?: (error: Error) => void; | ||
onExit?: (error?: Error) => void; | ||
onEvent?: (eventName: string, payload: EventPayload) => void; | ||
} | ||
@@ -22,6 +44,3 @@ export declare type PinwheelModalProps = PinwheelOpenOptions & { | ||
}; | ||
declare const PinwheelModal: ({ open, _srcUrl, ...props }: PinwheelOpenOptions & { | ||
open?: boolean | undefined; | ||
_srcUrl?: string | undefined; | ||
}) => JSX.Element; | ||
declare const PinwheelModal: ({ open, _srcUrl, ...props }: PinwheelModalProps) => JSX.Element; | ||
export default PinwheelModal; |
@@ -22,3 +22,3 @@ var React = require('react'); | ||
tag.type = 'application/javascript'; | ||
tag.src = url || 'https://cdn.getpinwheel.com/pinwheel-v1.js'; | ||
tag.src = url || 'https://cdn.getpinwheel.com/pinwheel-v2.js'; | ||
document.body.appendChild(tag); | ||
@@ -25,0 +25,0 @@ tag.addEventListener('load', function () { |
@@ -22,3 +22,3 @@ import { useState, useEffect, createElement } from 'react'; | ||
tag.type = 'application/javascript'; | ||
tag.src = url || 'https://cdn.getpinwheel.com/pinwheel-v1.js'; | ||
tag.src = url || 'https://cdn.getpinwheel.com/pinwheel-v2.js'; | ||
document.body.appendChild(tag); | ||
@@ -25,0 +25,0 @@ tag.addEventListener('load', function () { |
{ | ||
"name": "@pinwheel/react-modal", | ||
"version": "1.0.6", | ||
"version": "2.0.0-alpha", | ||
"description": "React package for Pinwheel modal", | ||
@@ -5,0 +5,0 @@ "author": "roscioli", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18810
190
2