Browse Source

Merge pull request #991 in VISUAL/fineui from ~ALAN/fineui:master to master

* commit 'abd70faddb73af4532d194f01a8cc6fb57a8c8ef':
  fix: 少了一个参数
  feat: KERNEL-798 core/func/function && core/func/number
es6
guy 6 years ago
parent
commit
15ad5ae364
  1. 2
      src/core/func/function.js
  2. 29
      typescript/core/func/function.ts
  3. 32
      typescript/core/func/number.ts
  4. 15
      typescript/index.ts

2
src/core/func/function.js

@ -87,7 +87,7 @@ _.extend(BI, {
};
},
afterFunc: function (func) {
afterFunc: function (sFunc, func) {
var __self = sFunc;
return function () {
var ret = __self.apply(sFunc, arguments);

29
typescript/core/func/function.ts

@ -0,0 +1,29 @@
/**
*
* @param array
* @param name
* @return
*/
export declare type _createDistinctName = (array: any[], name: string) => string;
/**
*
* @param items
* @param keyword
* @param param
*/
export declare type _getSearchResult = (items: any, keyword: any, param: string) => {find: any, match: any}
/**
* A执行之前执行方法B
* @param sFunc A
* @param func B
*/
export declare type _beforeFunc = (sFunc: Function, func: Function) => Function;
/**
* A执行之后执行方法B
* @param sFunc A
* @param func B
*/
export declare type _afterFunc = (sFunc: Function, func: Function) => Function;

32
typescript/core/func/number.ts

@ -0,0 +1,32 @@
/**
*
* @param {Number} num
* @param {Number} arg
* @return {Number}
*/
export declare type _add = (num: number, arg: number) => number;
/**
*
* @param {Number} num
* @param {Number} arg
* @return {Number}
*/
export declare type _sub = (num: number, arg: number) => number;
/**
*
* @param {Number} num
* @param {Number} arg
* @return {Number}
*/
export declare type _mul = (num: number, arg: number) => number;
/**
*
* @param {Number} num
* @param {Number} arg
* @return {Number}
*/
export declare type _div = (num: number, arg: number) => number;

15
typescript/index.ts

@ -2,6 +2,8 @@ import { _addI18n, _i18nText } from "./core/i18n";
import { _OB } from "./core/ob";
import { _pushArray, _pushDistinct, _pushDistinctArray} from "./core/func/array";
import {_startWith, _allIndexOf, _appendQuery, _endWith, _getQuery, _perfectStart, _replaceAll} from "./core/func/string";
import {_add, _sub, _mul, _div} from "./core/func/number";
import {_afterFunc, _beforeFunc, _createDistinctName, _getSearchResult} from "./core/func/function";
export declare module BI {
namespace i18n {
@ -22,4 +24,17 @@ export declare module BI {
const replaceAll: _replaceAll;
const perfectStart: _perfectStart;
const allIndexOf: _allIndexOf;
const add: _add;
const sub: _sub;
const mul: _mul;
const div: _div;
const afterFunc: _afterFunc;
const beforeFunc: _beforeFunc;
namespace Func {
const createDistinctName: _createDistinctName;
const getSearchResult: _getSearchResult;
}
}

Loading…
Cancel
Save