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

The array type for bullets, slides and control of the .d.ts file is not reported correctly in the documentation #169

Closed
DAnn2012 opened this issue Aug 23, 2021 · 4 comments

Comments

@DAnn2012
Copy link
Contributor

DAnn2012 commented Aug 23, 2021

The type for bullets ( Dom7Array[] ) property method of Pagination, slides ( any[] ) property method of Virtual Slides and control ( Swiper[] ) property method of Controller currently present in the .d.ts files is not reported correctly in the documentation and is therefore omitted

https://github.com/nolimits4web/swiper/blob/Swiper6/src/types/components/pagination.d.ts#L11-L16

bullets2

https://github.com/nolimits4web/swiper/blob/Swiper6/src/types/components/virtual.d.ts#L18-L21

virtual-slides-methods

https://github.com/nolimits4web/swiper/blob/Swiper6/src/types/components/controller.d.ts#L4-L8

controller-control-method

Maybe at this code:

const type = (item = {}) => {
const typeObj = item.type || {};
if (typeObj.type === 'union') {
const types = [];
typeObj.types.forEach(({ name, value }) => {
if (value) types.push(`'${value}'`);
else types.push(name);
});
return types.join(`{' | '}`);
}
if (typeObj.type === 'reflection') {
if (typeObj && typeObj.declaration && typeObj.declaration.signatures) {
const args = (typeObj.declaration.signatures[0].parameters || [])
.map((param) => `<span className="text-red-700">${param.name}</span>`)
.join(', ');
return `function(${args || ''})`;
}
return `object`;
}
return typeObj.name || '';
};

changes similar to these need to be made:

4a11d94#diff-d4d80730e5323abd7f1f8324e18ebdfd3b631eb52d6a120d36a87e57c42e8603

Thanks.

@DAnn2012
Copy link
Contributor Author

DAnn2012 commented Sep 8, 2021

@nolimits4web (or @vltansky) could you take a look at it? Thanks.

@DAnn2012
Copy link
Contributor Author

@nolimits4web and @vltansky

Is it possible to take a look?

Thanks.

@DAnn2012
Copy link
Contributor Author

@nolimits4web and @vltansky

do you have a chance to take a look to fix this issue in the documentation?

Thanks.

@vltansky
Copy link
Collaborator

Hey @DAnn2012, thanks for reporting and sorry for the delay.
After consulting with @nolimits4web I opened two PRs. One fixes Dom7Array[] to Dom7Array (as its already represent array), and the second PR is handling array types for docs.

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