From c3d005569b2ccc24026adbe487592ebc7f0741a8 Mon Sep 17 00:00:00 2001 From: dreambo8563 Date: Thu, 21 Mar 2019 13:33:20 +0800 Subject: [PATCH 1/6] fix(typings): root type --- types/vue.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/vue.d.ts b/types/vue.d.ts index 0908ec9..dc04eb3 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 { LazyBase } from "./main"; declare module "vue/types/vue" { interface Vue { - $lzCalc: LazyCalc; + $lzCalc: LazyBase; } interface VueConstructor { - $lzCalc: LazyCalc; + $lzCalc: LazyBase; } } declare module "vue/types/options" { interface ComponentOptions { - $lzCalc?: LazyCalc; + $lzCalc?: LazyBase; } } From 03d5869515f13e96a4051fb7e2d87b9197de3b54 Mon Sep 17 00:00:00 2001 From: dreambo8563 Date: Thu, 21 Mar 2019 13:33:35 +0800 Subject: [PATCH 2/6] 1.1.4 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ca615bf..de01eb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-lazy-calc", - "version": "1.1.3", + "version": "1.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 016944b..5391d39 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-lazy-calc", - "version": "1.1.3", + "version": "1.1.4", "private": false, "author": "dreambo8563", "main": "dist/vue-lazy-calc.umd.min.js", From 225a13c7763cdae270341a96611e148df7e95280 Mon Sep 17 00:00:00 2001 From: dreambo8563 Date: Thu, 21 Mar 2019 13:33:47 +0800 Subject: [PATCH 3/6] fix(typings): --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0d8e7e..4f9aa16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [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) From 263c99702e60f4e4f842f2807d3413156803040c Mon Sep 17 00:00:00 2001 From: dreambo8563 Date: Thu, 21 Mar 2019 13:55:39 +0800 Subject: [PATCH 4/6] fix(typings): add IBase --- src/main.ts | 6 +++++- src/stream.ts | 1 + types/main.d.ts | 4 ++++ types/vue.d.ts | 8 ++++---- 4 files changed, 14 insertions(+), 5 deletions(-) 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 dc04eb3..da78bdd 100644 --- a/types/vue.d.ts +++ b/types/vue.d.ts @@ -1,17 +1,17 @@ import Vue, { VueConstructor } from "vue"; -import { LazyBase } from "./main"; +import { ILazyBase } from "./main"; declare module "vue/types/vue" { interface Vue { - $lzCalc: LazyBase; + $lzCalc: ILazyBase; } interface VueConstructor { - $lzCalc: LazyBase; + $lzCalc: ILazyBase; } } declare module "vue/types/options" { interface ComponentOptions { - $lzCalc?: LazyBase; + $lzCalc?: ILazyBase; } } From 2578c7a46d2458ae13f1d985ae228ab6c91bd756 Mon Sep 17 00:00:00 2001 From: dreambo8563 Date: Thu, 21 Mar 2019 13:55:51 +0800 Subject: [PATCH 5/6] 1.1.5 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index de01eb1..fd53571 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-lazy-calc", - "version": "1.1.4", + "version": "1.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5391d39..942d85f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-lazy-calc", - "version": "1.1.4", + "version": "1.1.5", "private": false, "author": "dreambo8563", "main": "dist/vue-lazy-calc.umd.min.js", From f36671fa37712876a279e8c0a34f48d3c9242c20 Mon Sep 17 00:00:00 2001 From: dreambo8563 Date: Thu, 21 Mar 2019 13:56:00 +0800 Subject: [PATCH 6/6] feat(1.1.5): --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f9aa16..6345bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [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)