Skip to content

Commit e5ac31b

Browse files
authored
Merge pull request #26 from dreambo8563/release
typings
2 parents 141fcc8 + f36671f commit e5ac31b

File tree

7 files changed

+36
-7
lines changed

7 files changed

+36
-7
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
<a name="1.1.5"></a>
2+
## [1.1.5](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.4...v1.1.5) (2019-03-21)
3+
4+
5+
### Bug Fixes
6+
7+
* **typings:** add IBase ([263c997](https://github.com/dreambo8563/vue-lazy-calc/commit/263c997))
8+
9+
10+
11+
<a name="1.1.4"></a>
12+
## [1.1.4](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.3...v1.1.4) (2019-03-21)
13+
14+
15+
### Bug Fixes
16+
17+
* **typings:** root type ([c3d0055](https://github.com/dreambo8563/vue-lazy-calc/commit/c3d0055))
18+
19+
20+
121
<a name="1.1.3"></a>
222
## [1.1.3](https://github.com/dreambo8563/vue-lazy-calc/compare/v1.1.2...v1.1.3) (2019-03-21)
323

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-lazy-calc",
3-
"version": "1.1.3",
3+
"version": "1.1.5",
44
"private": false,
55
"author": "dreambo8563",
66
"main": "dist/vue-lazy-calc.umd.min.js",

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { LazyCalc } from "./simple";
44
export type operatorFunc = (i: number | string) => number;
55
export type CalcMethod = "ceil" | "floor" | "round";
66

7+
export interface ILazyBase {
8+
lazy(init?: number | object): LazyCalc;
9+
stream(s?: LazyCalc): LazyStream;
10+
}
711
export class LazyBase {
812
constructor() {}
913
static lazy(init: number | object = 0): LazyCalc {
@@ -20,7 +24,7 @@ export type LzCalcPlugin = {
2024
const instantce: LzCalcPlugin = {
2125
install(vue, options) {
2226
let alias = "$lzCalc";
23-
vue.prototype[alias] = LazyBase;
27+
vue.prototype[alias] = LazyBase as ILazyBase;
2428
Object.defineProperty(Vue, `${alias}`, {
2529
get() {
2630
return LazyBase;

src/stream.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { operatorFunc, CalcMethod } from "./main";
22
import { LazyCalc } from "./simple";
3+
34
class LazyStream {
45
private operators: operatorFunc[];
56
private compose = (fns: operatorFunc[]) =>

types/main.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import LazyStream from "./stream";
33
import { LazyCalc } from "./simple";
44
export declare type operatorFunc = (i: number | string) => number;
55
export declare type CalcMethod = "ceil" | "floor" | "round";
6+
export interface ILazyBase {
7+
lazy(init?: number | object): LazyCalc;
8+
stream(s?: LazyCalc): LazyStream;
9+
}
610
export declare class LazyBase {
711
constructor();
812
static lazy(init?: number | object): LazyCalc;

types/vue.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import Vue, { VueConstructor } from "vue";
2-
import { LazyCalc } from "./simple";
2+
import { ILazyBase } from "./main";
33
declare module "vue/types/vue" {
44
interface Vue {
5-
$lzCalc: LazyCalc;
5+
$lzCalc: ILazyBase;
66
}
77
interface VueConstructor {
8-
$lzCalc: LazyCalc;
8+
$lzCalc: ILazyBase;
99
}
1010
}
1111

1212
declare module "vue/types/options" {
1313
interface ComponentOptions<V extends Vue> {
14-
$lzCalc?: LazyCalc;
14+
$lzCalc?: ILazyBase;
1515
}
1616
}
1717

0 commit comments

Comments
 (0)