euvl / vue-js-modal

Easy to use, highly customizable Vue.js modal library.
http://vue-js-modal.yev.io
MIT License
4.36k stars 594 forks source link

feat: add missing TypeScript exports #699

Closed iamandrewluca closed 3 years ago

iamandrewluca commented 3 years ago
sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

iamandrewluca commented 3 years ago

@euvl any time to look at this? 🤔

iamandrewluca commented 3 years ago

TODO:

declare global {
  declare module 'vue-js-modal' {
    type ModalProps = {
      name: string,
      resizable?: boolean,
      resizeEdges?: Array<'r' | 'br' | 'b' | 'bl' | 'l' | 'tl' | 't' | 'tr'>,
      centerResize?: boolean,
      resizeIndicator?: boolean,
      adaptive?: boolean,
      draggable?: boolean | string,
      scrollable?: boolean,
      focusTrap?: boolean,
      reset?: boolean,
      overlayTransition?: string,
      transition?: string,
      clickToClose?: boolean,
      classes?: string | string[],
      styles?: string | string[] | Record<string, string>,
      minWidth?: number,
      minHeight?: number,
      maxWidth?: number,
      maxHeight?: number,
      width?: number | string,
      height?: number | string,
      shiftX?: number,
      shiftY?: number
    }

    export const Modal: FunctionalComponentOptions<ModalProps>

    export interface VModal {
      show(
        component: typeof Vue | ComponentOptions<Vue> | AsyncComponent,
        componentProps?: object,
        modalProps?: ModalProps,
        modalEvents?: {
          'before-open': (state: unknown) => void,
          'opened': (state: unknown) => void,
          'before-close': (state: unknown) => void,
          'closed': (state: unknown) => void,
        }
      ): void
    }
  }
}