beholdr / maska

Simple zero-dependency input mask for Vue, Svelte, Alpine.js and vanilla JS.
https://beholdr.github.io/maska/
MIT License
1.79k stars 71 forks source link

MaskInputOptions is not exported #223

Closed VChet closed 5 months ago

VChet commented 5 months ago

Describe the bug

The Vue demo shows that the v-mask options are set in a variable. In v2 I found it convenient to declare its type, so I could see type errors in the options variable itself rather than in the template directive. Do you consider exposing this interface back, or should I take a different approach in v3?

Steps to reproduce

<script setup lang="ts">
  import { vMaska, type MaskInputOptions } from "maska/vue" // error TS2459: Module 'maska/vue' declares 'MaskInputOptions' locally, but it is not exported.

  const options: MaskInputOptions = ({
    mask: "#-#",
    eager: true
  })
</script>

<template>
  <input v-maska="options">
</template>
beholdr commented 5 months ago

MaskInputOptions interface is exposed, but in maska not maska/vue. Because it is generic type not vue specific:

import type { MaskInputOptions } from 'maska'