Added nonce in the types in option.chart.nonce #4993
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New Pull Request: Add TypeScript Type Definition for Nonce in ApexCharts Options
This pull request addresses a TypeScript type error related to the
nonceattribute within the ApexCharts options. While the functionality to include anoncein the chart options already existed, the TypeScript type definitions were missing the correct type for this parameter, causing TypeScript projects to report errors. This PR adds the necessary type definition to theApexChartinterface in theapexcharts.d.tsfile, ensuring proper TypeScript support.Type of change
Summary of Changes
This PR adds the correct type definition for the
nonceparameter within theApexChartinterface in the global TypeScript types file (apexcharts.d.ts).Key changes:
nonce?: stringproperty to theApexChartinterface.nonceparameter in ApexCharts options.Motivation and Context
The
nonceattribute is crucial for Content Security Policy (CSP) compliance, enhancing security by allowing developers to include CSP nonces in script tags generated by ApexCharts. While the functionality was present, the lack of a proper TypeScript type definition hindered TypeScript project integration. This change fixes the type-related issue, improving developer experience and preventing potential type errors.Dependencies
This change does not introduce any new dependencies. It only modifies existing TypeScript type definitions within the
apexcharts.d.tsfile.Example Usage