Browse Source

feat: KERNEL-798 core/func/function && core/func/number

master
alan 6 years ago
parent
commit
37745883eb
  1. 29
      typescript/core/func/function.ts
  2. 32
      typescript/core/func/number.ts
  3. 15
      typescript/index.ts

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