From 16c989824170b3160249a0de0d1cd89166822d50 Mon Sep 17 00:00:00 2001 From: AlexFsmn Date: Thu, 8 Aug 2019 10:33:18 +0200 Subject: [PATCH] Fixed ts linting errors --- types/FormWizard.ts | 86 ++++++++++++++++++++++++--------------------- types/TabContent.ts | 20 +++++------ types/WizardStep.ts | 10 +++--- types/index.d.ts | 18 +++++----- 4 files changed, 69 insertions(+), 65 deletions(-) diff --git a/types/FormWizard.ts b/types/FormWizard.ts index 6a6ad95..8556b73 100644 --- a/types/FormWizard.ts +++ b/types/FormWizard.ts @@ -1,144 +1,148 @@ -import Vue from 'vue' +import Vue from 'vue'; -export type ShapeType = 'circle' | 'square' | 'tab' -export type LayoutType = 'vertical' | 'horizontal' -export type StepSizeType = 'xs' | 'sm' | 'md' | 'lg' +export type ShapeType = 'circle' | 'square' | 'tab'; +export type LayoutType = 'vertical' | 'horizontal'; +export type StepSizeType = 'xs' | 'sm' | 'md' | 'lg'; export declare class Wizard extends Vue { /** * Wizard identifier. - * + * * Default value: 'fw_' */ - id: string + id: string; /** * Wizard title. - * + * * Default value: 'Awesome Wizard' */ - title: string + title: string; /** * Wizard subtitle. - * + * * Default value: 'Split a complicated flow in multiple steps' */ - subtitle: string + subtitle: string; /** * Text to display on next button. - * + * * Default value: 'Next' */ - nextButtonText: string + nextButtonText: string; /** * Text to display on back button. - * + * * Default value: 'Back' */ - backButtonText: string + backButtonText: string; /** * Text to display on finish button. - * + * * Default value: 'Finish' */ - finishButtonText: string + finishButtonText: string; /** * Whether or not buttons should be hidden. - * + * * Default value: false */ - hideButtons: boolean + hideButtons: boolean; /** * Whether or not to trigger `beforeChange` function when navigating back. - * + * * Default value: false */ - validateOnBack: boolean + validateOnBack: boolean; /** * Color to apply to text, border and circle. - * + * * Default value: '#e74c3c' */ - color: string + color: string; /** * Step color when the current step is not valid. - * + * * Default value: '#8b0000' */ - errorColor: string + errorColor: string; /** * Shape of steps. - * + * * Default value: 'circle' */ - shape: ShapeType + shape: ShapeType; /** * Layout of wizard. - * + * * Default value: 'horizontal' */ - layout: LayoutType + layout: LayoutType; /** * Additional CSS classes to apply to steps. - * + * * Default value: '' */ - stepsClasses: string[] + stepsClasses: string[]; /** * Size of steps. - * + * * Default value: 'md' */ - stepSize: StepSizeType + stepSize: StepSizeType; /** * Name of the transition when transitioning between steps. - * + * * Default value: '' */ - transition: string + transition: string; /** * Zero-based index of the initial tab to be displayed. - * + * * Default value: 0 */ - startIndex: number + startIndex: number; /** * Resets the wizard to its initial state. */ - reset: () => void + reset: () => void; /** * Activates all steps, as if the user has navigated to each of them. */ - activateAll: () => void + activateAll: () => void; /** * Navigates to the next tab. */ - nextTab: () => void + nextTab: () => void; /** * Navigates to the previous tab. */ - prevTab: () => void + prevTab: () => void; /** * Navigates from one tab to another. Note that this method does not trigger validaiton methods. */ - changeTab: (oldIndex: number, newIndex: number, emitChangeEvent?: boolean) => boolean + changeTab: ( + oldIndex: number, + newIndex: number, + emitChangeEvent?: boolean + ) => boolean; } diff --git a/types/TabContent.ts b/types/TabContent.ts index cbd1ebd..a26e896 100644 --- a/types/TabContent.ts +++ b/types/TabContent.ts @@ -1,36 +1,36 @@ -import Vue from 'vue' +import Vue from 'vue'; export declare class Tab extends Vue { /** * Title to be displayed under each step. - * + * * Default value: '' */ - title: string - + title: string; + /** CSS class to be applied to each step icon. - * + * * Default value: '' */ - icon: string + icon: string; /** * Function to execute before changing tabs. If the return result is false, the tab switch is restricted. */ - beforeChange: () => boolean | Promise + beforeChange: () => boolean | Promise; /** * Function to execute after changing tabs. It is safe to assume that necessary validation has already occurred. */ - afterChange: () => void + afterChange: () => void; /** * Vue router route object. */ - route: string | object + route: string | object; /** * Default value: () => {} */ - additionalInfo: object + additionalInfo: object; } diff --git a/types/WizardStep.ts b/types/WizardStep.ts index 88a892f..9b318f5 100644 --- a/types/WizardStep.ts +++ b/types/WizardStep.ts @@ -1,20 +1,20 @@ -import Vue from 'vue' +import Vue from 'vue'; export declare class Step extends Vue { /** * Tab component to use for the step. This should be usually passed through the `step` scoped slot. - * + * * Default value: () => {} */ - tab: object + tab: object; /** * Default value: '' */ - transition: string + transition: string; /** * Default value: 0 */ - index: number + index: number; } diff --git a/types/index.d.ts b/types/index.d.ts index 14afe57..4394f84 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,20 +1,20 @@ -import Vue from 'vue' -import { PluginFunction } from "vue"; +import Vue from 'vue'; +import { PluginFunction } from 'vue'; -export function install (vue: typeof Vue): void +export function install(vue: typeof Vue): void; export { Wizard as FormWizard, ShapeType, LayoutType, StepSizeType -} from "./FormWizard" -export { Tab as TabContent } from "./TabContent" -export { Step as WizardStep } from "./WizardStep" +} from './FormWizard'; +export { Tab as TabContent } from './TabContent'; +export { Step as WizardStep } from './WizardStep'; -import { Wizard as FormWizard } from "./FormWizard" -import { Tab as TabContent } from "./TabContent" -import { Step as WizardStep } from "./WizardStep" +import { Wizard as FormWizard } from './FormWizard'; +import { Tab as TabContent } from './TabContent'; +import { Step as WizardStep } from './WizardStep'; declare class VueFormWizard { static install: PluginFunction;