Skip to content

Commit

Permalink
🤖 Merge PR #58708 update(rollup-plugin-svelte-svg): props types minor…
Browse files Browse the repository at this point in the history
… updates by @peterblazejewicz

- support for strict optional prop type checks
- tests for 'encorce' prop

Ref: #58367

Thanks!
  • Loading branch information
peterblazejewicz committed Feb 10, 2022
1 parent d32eaac commit 6465158
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/rollup-plugin-svelte-svg/index.d.ts
Expand Up @@ -10,8 +10,8 @@ import type { Plugin } from 'rollup';
import type { OptimizeOptions } from 'svgo';

export interface Options {
enforce?: 'pre' | 'post';
svgo?: OptimizeOptions;
enforce?: 'pre' | 'post' | undefined;
svgo?: OptimizeOptions | undefined;
}

export function svelteSVG(options?: Options): Plugin;
Expand Up @@ -3,5 +3,7 @@ import Icon from './icon.svg';

svelteSVG(); // $ExpectType Plugin
svelteSVG({ svgo: {} }); // $ExpectType Plugin
svelteSVG({ svgo: {}, enforce: 'post' }); // $ExpectType Plugin
svelteSVG({ enforce: 'pre' }); // $ExpectType Plugin
Icon; // $ExpectType typeof SvelteComponentDev
new Icon({ target: document.body }); // $ExpectType SvelteComponentDev

0 comments on commit 6465158

Please sign in to comment.