diff --git a/typescript/core/func/string.ts b/typescript/core/func/string.ts new file mode 100644 index 0000000000..fae4d7d669 --- /dev/null +++ b/typescript/core/func/string.ts @@ -0,0 +1,13 @@ +export declare type _startWith = (str: string, startTag: string) => boolean; + +export declare type _endWith = (str: string, endTag: string) => boolean; + +export declare type _getQuery = (str: string, name: string) => string|null; + +export declare type _appendQuery = (str: string, paras: {[key: string]: string|number}) => string; + +export declare type _replaceAll = (str: string, s1: string, s2: string) => string; + +export declare type _perfectStart = (str: string, start: string) => string; + +export declare type _allIndexOf = (str: string, sub: string) => number[]; diff --git a/typescript/index.ts b/typescript/index.ts index 95723ce610..b3d9cae20a 100644 --- a/typescript/index.ts +++ b/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 allIndexOf: _allIndexOf; + const appendQuery: _appendQuery; + const getQuery: _getQuery; + const perfectStart: _perfectStart; + const replaceAll: _replaceAll; }