Browse Source

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

* commit '5f1709e9cca9747bf90a6f54ceb2446b1aafc2ba':
  docs: 调整注释位置
  docs: 加入注释
  feat: KERNEL-798 core/func/string
es6
alan 5 years ago
parent
commit
894c3d49ff
  1. 56
      typescript/core/func/string.ts
  2. 9
      typescript/index.ts

56
typescript/core/func/string.ts

@ -0,0 +1,56 @@
/**
*
* @param str source字符串
* @param {String} startTag
* @return {Boolean} truefalse
*/
export declare type _startWith = (str: string, startTag: string) => boolean;
/**
*
* @param str source字符串
* @param {String} endTag
* @return {Boolean} truefalse
*/
export declare type _endWith = (str: string, endTag: string) => boolean;
/**
* url中指定名字的参数
* @param str source字符串
* @param {String} name
* @return {String}
*/
export declare type _getQuery = (str: string, name: string) => string|null;
/**
* url加上给定的参数
* @param str source字符串
* @param {Object} paras
* @return {String} url
*/
export declare type _appendQuery = (str: string, paras: {[key: string]: string|number}) => string;
/**
*
* @param str source字符串
* @param {String} s1
* @param {String} s2
* @returns {String}
*/
export declare type _replaceAll = (str: string, s1: string, s2: string) => string;
/**
*
* @param str source字符串
* @param {String} start
* @returns {String}
*/
export declare type _perfectStart = (str: string, start: string) => string;
/**
*
* @param str source字符串
* @param {String} sub
* @return {Number[]}
*/
export declare type _allIndexOf = (str: string, sub: string) => number[];

9
typescript/index.ts

@ -1,6 +1,7 @@
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";
export declare module BI {
namespace i18n {
@ -13,4 +14,12 @@ export declare module BI {
const pushArray: _pushArray;
const pushDistinct: _pushDistinct;
const pushDistinctArray: _pushDistinctArray;
const startWith: _startWith;
const endWith: _endWith;
const getQuery: _getQuery;
const appendQuery: _appendQuery;
const replaceAll: _replaceAll;
const perfectStart: _perfectStart;
const allIndexOf: _allIndexOf;
}

Loading…
Cancel
Save