alexprey / sveltedoc-parser

Generate a JSON documentation for a Svelte (https://github.com/sveltejs/svelte) component
https://www.npmjs.com/package/sveltedoc-parser
MIT License
90 stars 7 forks source link

Fix typings to match the actual exported api format #42

Closed soft-decay closed 3 years ago

soft-decay commented 3 years ago

@alexprey As you said, the typings should be updated to match the actual api.

First thing I found is :

export interface SvelteDataItem extends ISvelteItem {
// ...
/**
 * The default value of property, if provided.
 */
value?: any;
// ...
}

but the exported key is actually defaultValue (see the example Button).

Which one should be kept?

alexprey commented 3 years ago

Thanks for that catch, I'm fix it. And also update the API for default value of optional parameter

soft-decay commented 3 years ago

I just saw you pushed modifications for the typings, but I made a mistake when I renamed SvelteMethodArgumentItem to SvelteMethodParamItem.

It should be:

/**
 * @deprecated
 */
export type SvelteMethodArgumentItem = SvelteMethodParamItem;

and you can delete type SvelteArgItem and type SvelteArgumentItem, I added them by mistake in #40, so they were never released.

alexprey commented 3 years ago

Ok, thanks for note about that, I'm remove this types from typings file.