diff --git a/CHANGELOG.md b/CHANGELOG.md index e0d8e7e..6345bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ + +## [1.1.5](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.4...v1.1.5) (2019-03-21) + + +### Bug Fixes + +* **typings:** add IBase ([263c997](https://github.com/dreambo8563/vue-lazy-calc/commit/263c997)) + + + + +## [1.1.4](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.3...v1.1.4) (2019-03-21) + + +### Bug Fixes + +* **typings:** root type ([c3d0055](https://github.com/dreambo8563/vue-lazy-calc/commit/c3d0055)) + + + ## [1.1.3](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.2...v1.1.3) (2019-03-21) diff --git a/package-lock.json b/package-lock.json index ca615bf..fd53571 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-lazy-calc", - "version": "1.1.3", + "version": "1.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 016944b..942d85f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-lazy-calc", - "version": "1.1.3", + "version": "1.1.5", "private": false, "author": "dreambo8563", "main": "dist/vue-lazy-calc.umd.min.js", diff --git a/src/main.ts b/src/main.ts index ca57c20..a909e92 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,10 @@ import { LazyCalc } from "./simple"; export type operatorFunc = (i: number | string) => number; export type CalcMethod = "ceil" | "floor" | "round"; +export interface ILazyBase { + lazy(init?: number | object): LazyCalc; + stream(s?: LazyCalc): LazyStream; +} export class LazyBase { constructor() {} static lazy(init: number | object = 0): LazyCalc { @@ -20,7 +24,7 @@ export type LzCalcPlugin = { const instantce: LzCalcPlugin = { install(vue, options) { let alias = "$lzCalc"; - vue.prototype[alias] = LazyBase; + vue.prototype[alias] = LazyBase as ILazyBase; Object.defineProperty(Vue, `${alias}`, { get() { return LazyBase; diff --git a/src/stream.ts b/src/stream.ts index 81cafcd..76740a9 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -1,5 +1,6 @@ import { operatorFunc, CalcMethod } from "./main"; import { LazyCalc } from "./simple"; + class LazyStream { private operators: operatorFunc[]; private compose = (fns: operatorFunc[]) => diff --git a/types/main.d.ts b/types/main.d.ts index bd19588..93232f1 100644 --- a/types/main.d.ts +++ b/types/main.d.ts @@ -3,6 +3,10 @@ import LazyStream from "./stream"; import { LazyCalc } from "./simple"; export declare type operatorFunc = (i: number | string) => number; export declare type CalcMethod = "ceil" | "floor" | "round"; +export interface ILazyBase { + lazy(init?: number | object): LazyCalc; + stream(s?: LazyCalc): LazyStream; +} export declare class LazyBase { constructor(); static lazy(init?: number | object): LazyCalc; diff --git a/types/vue.d.ts b/types/vue.d.ts index 0908ec9..da78bdd 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -1,17 +1,17 @@ import Vue, { VueConstructor } from "vue"; -import { LazyCalc } from "./simple"; +import { ILazyBase } from "./main"; declare module "vue/types/vue" { interface Vue { - $lzCalc: LazyCalc; + $lzCalc: ILazyBase; } interface VueConstructor { - $lzCalc: LazyCalc; + $lzCalc: ILazyBase; } } declare module "vue/types/options" { interface ComponentOptions { - $lzCalc?: LazyCalc; + $lzCalc?: ILazyBase; } }