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

Vue elemenets not supporting typeScript and compliler complains #335

Open
Nutcracker52 opened this issue Jul 27, 2023 · 2 comments
Open

Comments

@Nutcracker52
Copy link

Nutcracker52 commented Jul 27, 2023

Describe the bug
TS compiler errors. Please note in our platform we are using TS as FE scripting language.
As per document we have setup everything and all working fine when we use //ts-ignore before these two lines.

get stripeConfig() {
// @ts-ignore
const config = this.$stripe
return config
}
async submit() {
// @ts-ignore
await this.$refs.paymentRef.submit()
}

To Reproduce
Steps to reproduce the behavior:
1.please implement above two functions in your TS project and remove //ts-ignore
Solution is defined here, you need to change index.d.ts file as per below. (default key word is missing)
https://stackoverflow.com/questions/45555089/resolve-property-does-not-exist-on-type-vue-error

current implementation
export class StripeElementPayment extends Vue {
pk: string;
elementsOptions: any;
confirmParams: any;
createOptions: any;
redirect?: string;
stripeAccount?: string;
apiVersion?: string;
locale?: string;
disableAdvancedFraudDetection?: boolean;
}

requesting implementation
export default class StripeElementPayment extends Vue {
pk: string;
elementsOptions: any;
confirmParams: any;
createOptions: any;
redirect?: string;
stripeAccount?: string;
apiVersion?: string;
locale?: string;
disableAdvancedFraudDetection?: boolean;
}

for all classes in index.d.ts

image
image

As I mentioned above as long as I ignore the compiler errors it complely works fine.
Just in case if you wonder I have not imported stripe.
image

not sure why this.$stripe throws an error could you please look into this as well.

Expected behavior
TS shouldn't throw any errors.

Screenshots
If applicable, attached above

Desktop (please complete the following information):

  • OS: [e.g. Windows 11]
  • Browser [chrome]
  • Version [latest]
@jofftiquez
Copy link
Member

Hello, this is something out of my experience. I ah not very adept with TS. I will try to check what I can do

@jofftiquez
Copy link
Member

  • Add typings support

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

2 participants