Skip to content

Commit

Permalink
fix(types): Solved missing definition for AlertHandler component.
Browse files Browse the repository at this point in the history
  • Loading branch information
Byloth committed Jul 16, 2023
1 parent dc77799 commit 16356f7
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 8 deletions.
17 changes: 13 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ module.exports = {
"@byloth/eslint-config-typescript",
"@byloth/eslint-config-vue"
],
overrides: [{
files: ["*.ts"],
rules: { "no-dupe-class-members": "off" }
}]
overrides: [
{
files: ["*.d.ts"],
rules: {
"max-len": "off",
"@typescript-eslint/ban-types": "off"
}
},
{
files: ["*.ts"],
rules: { "no-dupe-class-members": "off" }
}
]
};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@byloth/vuert",
"version": "1.0.5",
"version": "1.1.0",
"description": "The headless alerts, notifications & popups library for Vue.js craftsmen. ℹ",
"keywords": [
"Alert",
Expand Down Expand Up @@ -52,8 +52,9 @@
"build": "yarn build:core && yarn build:docs",
"build:core": "vite build",
"build:docs": "vitepress build docs",
"build:types": "vue-tsc --emitDeclarationOnly",
"preview": "vitepress serve docs",
"check:types": "vue-tsc",
"check:types": "vue-tsc --noEmit",
"lint": "eslint --ext .cjs,.js,.json,.ts,.vue --ignore-path .gitignore .",
"lint:prod": "export NODE_ENV=\"production\" && yarn lint",
"ci": "yarn install --frozen-lockfile"
Expand Down
65 changes: 65 additions & 0 deletions src/components/AlertHandler.vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import type { PropType } from "vue";
import { Alert } from "../models/index.js";
import type { AlertOptions } from "../types/alert/index.js";
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
is: {
default: string;
type: (StringConstructor | ObjectConstructor)[];
};
duration: {
default: () => string | number | {
enter: string | number;
leave: string | number;
};
type: (StringConstructor | ObjectConstructor | NumberConstructor)[];
validator: (value: unknown) => boolean;
};
filter: {
default: () => boolean;
type: PropType<(options: AlertOptions<unknown>) => boolean>;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
opening: (alert: Alert<unknown>) => boolean;
opened: (alert: Alert<unknown>) => boolean;
closing: (alert: Alert<unknown>) => boolean;
closed: (alert: Alert<unknown>) => boolean;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
is: {
default: string;
type: (StringConstructor | ObjectConstructor)[];
};
duration: {
default: () => string | number | {
enter: string | number;
leave: string | number;
};
type: (StringConstructor | ObjectConstructor | NumberConstructor)[];
validator: (value: unknown) => boolean;
};
filter: {
default: () => boolean;
type: PropType<(options: AlertOptions<unknown>) => boolean>;
};
}>> & {
onOpening?: ((alert: Alert<unknown>) => any) | undefined;
onOpened?: ((alert: Alert<unknown>) => any) | undefined;
onClosing?: ((alert: Alert<unknown>) => any) | undefined;
onClosed?: ((alert: Alert<unknown>) => any) | undefined;
}, {
filter: (options: AlertOptions<unknown>) => boolean;
is: string | Record<string, any>;
duration: string | number | Record<string, any>;
}, {}>, {
default?(_: {
alert: Alert<any>;
isOpen: boolean;
resolve: (result?: any) => void;
reject: (error: Error) => void;
}): any;
}>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};
2 changes: 1 addition & 1 deletion src/vuert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface VuertOptions

export default class Vuert
{
public static readonly VERSION: string = "1.0.4";
public static readonly VERSION: string = "1.1.0";

public static get DEFAULT_OPTS(): VuertOptions
{
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"strict": true,
"jsx": "preserve",
"noEmit": true,
"declaration": true,
"noImplicitThis": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -23,6 +23,7 @@
"allowImportingTsExtensions": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"outDir": "types",
"paths": {
"@src/*": ["src/*"],
"@docs/*": ["docs/*"],
Expand Down

0 comments on commit 16356f7

Please sign in to comment.