Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<a name="1.1.5"></a>
## [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))



<a name="1.1.4"></a>
## [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))



<a name="1.1.3"></a>
## [1.1.3](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.2...v1.1.3) (2019-03-21)

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/stream.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { operatorFunc, CalcMethod } from "./main";
import { LazyCalc } from "./simple";

class LazyStream {
private operators: operatorFunc[];
private compose = (fns: operatorFunc[]) =>
Expand Down
4 changes: 4 additions & 0 deletions types/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions types/vue.d.ts
Original file line number Diff line number Diff line change
@@ -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<V extends Vue> {
$lzCalc?: LazyCalc;
$lzCalc?: ILazyBase;
}
}

Expand Down