Closed silvioprog closed 3 years ago
Hi.
Supposing we run the svelte-dts in this small project, some generated types are duplicated, e.g:
svelte-dts
import { SvelteComponentTyped } from "svelte"; declare module '@duallsistemas/duall-svelte-bootstrap5'; declare module '@duallsistemas/duall-svelte-bootstrap5/types.ts' { export type BackgroundColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'body' | 'white' | 'transparent'; export type AlertType = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark'; export type ButtonType = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link'; export type ButtonSize = 'sm' | 'lg'; export type ModalSize = 'sm' | 'lg' | 'xl' | 'fullscreen'; } declare module '@duallsistemas/duall-svelte-bootstrap5'; declare module '@duallsistemas/duall-svelte-bootstrap5/utils.ts' { export function makeId(): string; } declare module '@duallsistemas/duall-svelte-bootstrap5/types.ts' { export type BackgroundColor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'body' | 'white' | 'transparent'; export type AlertType = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark'; export type ButtonType = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link'; export type ButtonSize = 'sm' | 'lg'; export type ModalSize = 'sm' | 'lg' | 'xl' | 'fullscreen'; } declare module '@duallsistemas/duall-svelte-bootstrap5/utils.ts' { export function makeId(): string; } ...
and properties:
declare module '@duallsistemas/duall-svelte-bootstrap5/Button.svelte' { interface ButtonProps { ref?: HTMLButtonElement | HTMLAnchorElement; type?: ButtonType; title?: string; hint?: string; icon?: string; href?: string; disabled?: boolean; loading?: boolean; loadingMessage?: string; size?: ButtonSize; ref?: HTMLButtonElement | HTMLAnchorElement; type?: ButtonType; title?: string; hint?: string; icon?: string; href?: string; disabled?: boolean; loading?: boolean; loadingMessage?: string; size?: ButtonSize; }
I have been trying this configuration:
export default { input: pkg.svelte, plugins: [ svelteDts({ output: pkg.types }), ...
So, is there any option to avoid those duplications to generate a smaller .d.ts file?
.d.ts
TIA for any help!
Fixed by export default ["es", "umd"].map((format) => {.
export default ["es", "umd"].map((format) => {
Hi.
Supposing we run the
svelte-dts
in this small project, some generated types are duplicated, e.g:and properties:
I have been trying this configuration:
So, is there any option to avoid those duplications to generate a smaller
.d.ts
file?TIA for any help!