vue-feature-toggle icon indicating copy to clipboard operation
vue-feature-toggle copied to clipboard

Missing TypeScript support

Open Clex1o1 opened this issue 2 years ago • 1 comments

The package does not provide types. I tested it in my Vue3 project. Also npm i --save-dev @types/vue-feature-toggle did not help. Can you provide types?

Clex1o1 avatar Apr 06 '22 13:04 Clex1o1

you can use this as a quick fix

// vue-feature-toggle.d.ts

declare module 'vue-feature-toggle' {
  export const FeatureToggleComponent: {

      name: string;
      on(eventtype: string, fn: Function, config: any | undefined): void;
      trigger: Function;
      showLogs: (showLogs: boolean) => void;
      isVisible: boolean;
      visibility(param1: any, param2: any, param3: any, param4: any): void;
      requiredVisibility(fn: Function): void;
      defaultVisibility(fn: Function): void;
      addPlugin(plugin: any): void;
      setData(nameParam: string | undefined, variantOrDataParam: any, dataParam: any): void;
  };
}

theRenard avatar Jun 06 '22 10:06 theRenard