flekschas / svelte-simple-modal

A simple, small, and content-agnostic modal for Svelte v3 and v4
https://svelte.dev/repl/b95ce66b0ef34064a34afc5c0249f313
MIT License
422 stars 30 forks source link

type: add other properties types to svelte transition functions #94

Closed leovoon closed 1 year ago

leovoon commented 1 year ago

Background

I'm trying to use another transition function as follows

<script lang='ts'>
  import { fly } from 'svelte/transition'

</script>

<Modal
  transitionWindow={fly}
  transitionWindowProps={{ y: 50, duration: 300 }} // Typescript is not happy
</Modal>

Currently Observed Behavior

The type is currently only supported for blurparam. This PR adds properties for fly, fade and slide functions and updates docs.

New Behavior

No typescript warnings

flekschas commented 1 year ago

New version with the improved type definition is out!