Browse Source

chore: add lib

es6
iapyang 4 years ago
parent
commit
12670b2fde
  1. 1
      .gitignore
  2. 10
      dist/lib/base/pane.d.ts
  3. 18
      dist/lib/base/single/button/button.basic.d.ts
  4. 20
      dist/lib/base/single/single.d.ts
  5. 5
      dist/lib/base/single/trigger/trigger.d.ts
  6. 1
      dist/lib/bundle.d.ts
  7. 4
      dist/lib/case/loading/loading_pane.d.ts
  8. 8
      dist/lib/core/action/action.d.ts
  9. 3
      dist/lib/core/action/action.show.d.ts
  10. 193
      dist/lib/core/base.d.ts
  11. 7
      dist/lib/core/behavior/behavior.d.ts
  12. 3
      dist/lib/core/behavior/behavior.highlight.d.ts
  13. 3
      dist/lib/core/behavior/behavior.redmark.d.ts
  14. 64
      dist/lib/core/decorator/decorator.d.ts
  15. 9
      dist/lib/core/func/array.d.ts
  16. 92
      dist/lib/core/func/date.d.ts
  17. 36
      dist/lib/core/func/function.d.ts
  18. 8
      dist/lib/core/func/index.d.ts
  19. 35
      dist/lib/core/func/number.d.ts
  20. 62
      dist/lib/core/func/string.d.ts
  21. 6
      dist/lib/core/i18n.d.ts
  22. 35
      dist/lib/core/ob.d.ts
  23. 323
      dist/lib/core/widget.d.ts
  24. 42
      dist/lib/index.d.ts

1
.gitignore vendored

@ -6,5 +6,4 @@ node_modules/
coverage
unit.test.statistic.json
package-lock.json
dist/lib
*.tgz

10
dist/lib/base/pane.d.ts vendored

@ -0,0 +1,10 @@
import { _Widget } from "../core/widget";
export interface _Pane extends _Widget {
_assertTip: (..._args: any[]) => void;
loading: (..._args: any[]) => void;
loaded: (..._args: any[]) => void;
check: (..._args: any[]) => void;
}
export interface _PaneStatic {
EVENT_LOADED: "EVENT_LOADED";
}

18
dist/lib/base/single/button/button.basic.d.ts vendored

@ -0,0 +1,18 @@
import { _Single } from "../single";
export interface _BasicButton extends _Single {
_createShadow(): void;
bindEvent(): void;
_trigger(e: Event): void;
_doClick(e: Event): void;
beforeClick(): void;
doClick(): void;
handle(): _BasicButton;
hover(): void;
dishover(): void;
setSelected(b: any): void;
isSelected(): boolean;
isOnce(): boolean;
isForceSelected(): boolean;
isForceNotSelected(): boolean;
isDisableSelected(): boolean;
}

20
dist/lib/base/single/single.d.ts vendored

@ -0,0 +1,20 @@
import { _Widget } from "../../core/widget";
export interface _Single extends _Widget {
_showToolTip(e: Event, opt?: SingleOpt): void;
_hideTooltip(): void;
_clearTimeOut(): void;
enableHover(opt?: SingleOpt): void;
disabledHover(): void;
setTitle(title: string, opt?: SingleOpt): void;
setWarningTitle(title: string, opt?: SingleOpt): void;
getTipType(): string;
isReadOnly(): boolean;
getTitle(): string;
getWarningTitle(): string;
popluate(..._args: any[]): void;
}
interface SingleOpt {
container?: any;
belowMouse?: boolean;
}
export {};

5
dist/lib/base/single/trigger/trigger.d.ts vendored

@ -0,0 +1,5 @@
import { _Single } from "../single";
export interface _Trigger extends _Single {
setKey(..._args: any[]): void;
getKey(): string;
}

1
dist/lib/bundle.d.ts vendored

@ -0,0 +1 @@
export {};

4
dist/lib/case/loading/loading_pane.d.ts vendored

@ -0,0 +1,4 @@
import { _Pane } from "../../base/pane";
export interface _LoadingPane extends _Pane {
__loaded: (...args: any[]) => void;
}

8
dist/lib/core/action/action.d.ts vendored

@ -0,0 +1,8 @@
import { _OB } from "../ob";
export interface _Action extends _OB {
actionPerformed(src: any, tar: any, callback: Function): void;
actionBack(tar: any, src: any, callback: Function): void;
}
export interface _ActionFactory {
createAction(key: string, options: any): _Action;
}

3
dist/lib/core/action/action.show.d.ts vendored

@ -0,0 +1,3 @@
import { _Action } from "./action";
export interface _ShowAction extends _Action {
}

193
dist/lib/core/base.d.ts vendored

@ -0,0 +1,193 @@
import { _Widget } from "./widget";
export interface _base {
assert: (v: any, is: Function) => Boolean;
warn: (message: any) => Boolean;
UUID: () => string;
isWidget: (widget: any) => widget is _Widget;
createWidgets: (items: any, options: any, context: any) => any;
createItems: <T, U, K>(data: T[], innerAttr?: U, outerAttr?: K) => (U & T & K)[];
packageItems: (items: any[], layouts: any[]) => any[];
formatEL: <T>(obj: T) => {
el: T;
} | T;
stripEL: <T>(obj: {
el: T;
} | T) => T;
trans2Element: (widgets: any[]) => any[];
where: (collection: any[] | object | string, source: object) => any[];
findWhere: (collection: any[] | object | string, callback?: Function | object | string, thisArg?: any) => object | undefined;
invoke: (collection: any[] | object | string, methodName: Function | string, arg?: any) => any[];
pluck: (collection: any[] | object | string, property: string) => any[];
shuffle: (collection: any[] | object | string) => any[];
sample: (collection: any[] | object | string, n?: number) => any[];
toArray: (collection: any[] | object | string) => any[];
size: (collection: any[] | object | string) => number;
each: <T>(collection: T[] | object | string, callback?: ((index: number, value: T) => void) | object | string, thisArg?: any) => any;
map: <T, U>(collection: T[] | object | string | null | undefined, callback?: ((index: number, value: T) => U) | object | string, thisArg?: any) => U[];
reduce: <T, U>(collection: T[] | object | string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T) | object | string, initialValue?: U | T) => U extends T ? U : T;
reduceRight: <T, U>(collection: T[] | object | string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T) | object | string, initialValue?: U | T) => U extends T ? U : T;
find: <T>(collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => any;
filter: <T>(collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => any[];
reject: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => any[];
every: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean;
all: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean;
some: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean;
any: <T>(collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean;
max: <T>(collection: T[]) => T;
min: <T>(collection: T[]) => T;
sortBy: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => number) | object | string, thisArg?: any) => any[];
groupBy: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object;
indexBy: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object;
countBy: <T>(collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object;
count: (from: number, to: number, predicate: Function) => number;
inverse: (from: number, to: number, predicate: Function) => number;
firstKey: (obj: object) => string;
lastKey: (obj: object) => string;
firstObject: (obj: object) => any;
lastObject: (obj: object) => any;
concat: (obj1: any, obj2: any) => any;
backEach: (obj: any, predicate: Function, context?: any) => boolean;
backAny: (obj: any, predicate: Function, context?: any) => boolean;
backEvery: (obj: any, predicate: Function, context?: any) => boolean;
backFindKey: (obj: any, predicate: Function, context?: any) => string;
backFind: (obj: any, predicate: Function, context?: any) => any;
remove: (obj: any, predicate: any, context?: any) => void;
removeAt: (obj: any, index: number | number[]) => void;
string2Array: (str: string) => string[];
array2String: (array: any[]) => string;
abc2Int: (str: string) => number;
int2Abc: (num: number) => string;
first: <T>(array: T[], callback?: Function | object | number | string, thisArg?: any) => T;
initial: <T>(array: T[], callback?: Function | object | number | string, thisArg?: any) => T[];
last: <T>(array: T[], callback?: Function | object | number | string, thisArg?: any) => T;
rest: <T>(array: T[], callback?: Function | object | number | string, thisArg?: any) => T[];
compact: (array: any[]) => any[];
flatten: (array: any[], isShallow?: boolean, callback?: Function | object | string, thisArg?: any) => any[];
without: (array: any[], value?: any) => any[];
union: (...array: any[]) => any[];
intersection: (...array: any[]) => any[];
difference: (...array: any[]) => any[];
zip: (...array: any[]) => any[];
unzip: (...array: any[]) => any[];
object: (keys: string[], values?: any[]) => any[];
indexOf: (array: any[], value: any, fromIndex?: number) => number;
lastIndexOf: (array: any[], value: any, fromIndex?: number) => number;
sortedIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number;
range: (start: number, end: number, step: number) => number[];
take: <T>(array: T[], n: number) => T[];
takeRight: <T>(array: T[], n: number) => T[];
findIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number;
findLastIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number;
makeArray: <T>(length: number, value?: T) => number[] | T[];
makeObject: (array: any[], value: any) => any;
makeArrayByArray: <T>(array: any[], value: T) => T[];
uniq: <T>(array: T[], isSorted?: boolean, iteratee?: any, context?: any) => T[];
keys: (object: object) => string[];
allKeys: (object: object) => string[];
values: (object: object) => any[];
pairs: (object: object) => any[];
invert: (object: object, multiValue: boolean) => object;
create: (prototype: object, properties?: object) => object;
functions: (object: object) => string[];
extend: (object: object, ...sources: any[]) => object;
defaults: (object: object, ...sources: any[]) => object;
clone: <T>(object: T) => T;
property: (path: any[] | string) => Function;
propertyOf: (object: object) => Function;
isEqual: (value: any, other: any, customizer?: Function, thisArg?: any) => boolean;
isMatch: (object: object, source: object, customizer?: Function, thisArg?: any) => boolean;
isEmpty: (value: any[] | object | string | null | undefined | number) => boolean;
isElement: (value: any) => boolean;
isNumber: (value: any) => value is number;
isString: (value: any) => value is string;
isArray: <T>(value: T[] | any) => value is T[];
isObject: (value: any) => value is object;
isPlainObject: (value: any) => value is object;
isArguments: (value: any) => boolean;
isFunction: (value: any) => value is Function;
isFinite: (value: any) => value is number;
isBoolean: (value: any) => value is boolean;
isDate: (value: any) => value is Date;
isRegExp: (value: any) => value is RegExp;
isError: (value: any) => value is Error;
isNaN: (value: any) => value is number;
isUndefined: (value: any) => value is undefined;
zipObject: (props: any[], values?: any[]) => object;
cloneDeep: (value: any, customizer?: Function, thisArg?: any) => any;
findKey: (object: object, predicate?: Function | object | string, thisArg?: any) => any;
pick: (object: object, predicate?: Function | string | string[], thisArg?: any) => object;
omit: (object: object, predicate?: Function | string | string[], thisArg?: any) => object;
tap: (value: any, interceptor: Function, thisArg?: any) => any;
inherit: (sb: any, sp: any, overrides?: any) => any;
init: () => void;
has: (obj: object, keys: string | string[]) => boolean;
freeze: <T>(value: T) => T;
isKey: (key: any) => key is (number | string);
isCapitalEqual: (a: string | null | undefined, b: string | null | undefined) => boolean;
isWidthOrHeight: (w: number | string) => boolean;
isNotNull: <T>(obj: T) => obj is NonNullable<T>;
isNull: (obj: any) => obj is (undefined | null);
isEmptyArray: <T, U>(arr: T[] | U) => arr is T[] & {
length: 0;
};
isNotEmptyArray: <T, U>(arr: T[] | U) => arr is [T, ...T[]];
isEmptyObject: (obj: any) => obj is object;
isNotEmptyObject: (obj: any) => obj is object;
isWindow: (obj: any) => obj is Window;
isDeepMatch: (object: any, attrs: any) => boolean;
contains: (obj: any[], target: any, fromIndex?: number) => number;
deepContains: (obj: any[], copy: any) => number;
deepIndexOf: (obj: any[], target: any) => number;
deepRemove: (obj: any[], target: any) => boolean;
deepWithout: (obj: any[], target: any) => any[];
deepUnique: (array: any[]) => any[];
deepDiff: (object: any, other: any) => string[];
uniqueId: (prefix?: string) => string;
result: (object: any, key: string) => any;
chain: (value: any) => any;
iteratee: (func?: Function, thisArg?: any) => Function;
unescape: (str?: string) => string;
bind: (func: Function, thisArg: any, ...partials: any) => Function;
once: (func: Function) => Function;
partial: (func: Function, ...partials: any) => Function;
debounce: (func: Function, wait?: number, options?: any) => Function;
throttle: (func: Function, wait?: number, options?: any) => Function;
delay: (func: Function, wait: number, ...args: any) => number;
defer: (func: Function, ...args: any) => number;
wrap: (value: any, wrapper: Function) => Function;
nextTick: (func: Function) => Promise<any>;
random: (min?: number, max?: number, floating?: boolean) => number;
parseInt: (s: string | number) => number;
parseSafeInt: (s: string) => number;
parseFloat: (string: string) => number;
isNaturalNumber: (value: string | number) => boolean;
isPositiveInteger: (value: string | number) => boolean;
isNegativeInteger: (value: string | number) => boolean;
isInteger: (value: string | number) => boolean;
isNumeric: (value: string | number) => boolean;
isFloat: (value: string | number) => boolean;
isOdd: (value: string | number) => boolean;
isEven: (value: string | number) => boolean;
sum: (array: any[], iteratee: Function, context: any) => number;
average: (array: any[], iteratee: Function, context: any) => number;
trim: (string?: string, chars?: string) => string;
toUpperCase: (string: string) => string;
toLowerCase: (string: string) => string;
isEndWithBlank: (string: string) => boolean;
isLiteral: (string: string) => boolean;
stripQuotes: (string: string) => string;
camelize: (string: string) => string;
hyphenate: (string: string) => string;
isNotEmptyString: (string: string) => boolean;
isEmptyString: (str: any) => str is "";
encrypt: (type: string, text: string, key: string) => string;
escape: (string: string) => string;
leftPad: (val: string, size: number, ch: string) => string;
format: (format: string, ...str: string[]) => string;
isLeapYear: (year: number) => boolean;
checkDateVoid: (YY: string | number, MM: string | number, DD: string | number, minDate: string, maxDate: string) => (number | string)[];
checkDateLegal: (str: string) => boolean;
parseDateTime: (str: string, fmt: string) => Date;
getDate: (...args: (number | string)[]) => Date;
getTime: (...args: any[]) => number;
}

7
dist/lib/core/behavior/behavior.d.ts vendored

@ -0,0 +1,7 @@
import { _OB } from "../ob";
export interface _Behavior extends _OB {
doBehavior(items: any[]): void;
}
export interface _BehaviorFactory {
createBehavior(key: string, options: any): _Behavior;
}

3
dist/lib/core/behavior/behavior.highlight.d.ts vendored

@ -0,0 +1,3 @@
import { _Behavior } from "./behavior";
export interface _HighlightBehavior extends _Behavior {
}

3
dist/lib/core/behavior/behavior.redmark.d.ts vendored

@ -0,0 +1,3 @@
import { _Behavior } from "./behavior";
export interface _RedMarkBehavior extends _Behavior {
}

64
dist/lib/core/decorator/decorator.d.ts vendored

@ -0,0 +1,64 @@
export declare type Constructor<T> = new (...args: any[]) => T;
/**
* widget
*/
export declare function shortcut(): <U>(Target: Constructor<U> & {
xtype: string;
}) => void;
/**
* model
*/
export declare function model(): <U extends (new (...args: any[]) => {}) & {
xtype: string;
context?: readonly string[] | undefined;
}>(Target: U) => void;
/**
* _store属性
* @param Model model类
* @param opts
*/
export declare function store<T>(Model: Constructor<T> & {
xtype: string;
}, opts?: {
props?(this: unknown): {
[key: string]: unknown;
};
}): <U extends new (...args: any[]) => {}>(constructor: U) => {
new (...args: any[]): {
_store(): any;
};
} & U;
/**
* Model基类
*/
export declare class Model<U extends {
types?: {
[key: string]: unknown;
} | {};
context?: ReadonlyArray<string>;
} = {}> extends Fix.Model {
model: Pick<{
[key in keyof U["types"]]: U["types"][key];
}, U["context"][number]> & {
[key in keyof ReturnType<this["state"]>]: ReturnType<this["state"]>[key];
} & {
[key in keyof this["computed"]]: ReturnType<this["computed"][key]>;
};
store: this["actions"];
state(): {
[key: string]: unknown;
} | {};
context: U["context"];
actions: {
[key: string]: (...args: any[]) => any;
};
childContext: ReadonlyArray<keyof (this["computed"] & ReturnType<this["state"]>)>;
TYPE: Pick<{
[key in keyof this["computed"]]: ReturnType<this["computed"][key]>;
} & {
[key in keyof ReturnType<this["state"]>]: ReturnType<this["state"]>[key];
}, this["childContext"][number]>;
computed: {
[key: string]: () => unknown;
} | {};
}

9
dist/lib/core/func/array.d.ts vendored

@ -0,0 +1,9 @@
export declare type _pushArray = (sArray: any[], array: any[]) => void;
export declare type _pushDistinct = (sArray: any[], obj: any) => void;
export declare type _pushDistinctArray = (sArray: any[], array: any[]) => void;
declare type _array = {
pushArray: _pushArray;
pushDistinct: _pushDistinct;
pushDistinctArray: _pushDistinctArray;
};
export default _array;

92
dist/lib/core/func/date.d.ts vendored

@ -0,0 +1,92 @@
export declare type _Date = {
SECOND: number;
MINUTE: number;
HOUR: number;
DAY: number;
WEEK: number;
_DN: string[];
_SDN: string[];
_FD: number;
_MN: string[];
_SMN: number[];
_QN: string[];
_MD: number[];
_OFFSET: number[];
};
/**
*
*/
export declare type _getTimezone = (date: Date) => string;
/**
*
*/
export declare type _getMonthDays = (date: Date, month: number) => string;
/**
*
*/
export declare type _getLastDateOfMonth = (data: Date) => Date;
/**
*
*/
export declare type _getDayOfYear = (data: Date) => number;
/**
*
*/
export declare type _getWeekNumber = (data: Date) => number;
/**
*
*/
export declare type _getQuarter = (date: Date) => number;
/**
*
*/
export declare type _getOffsetDate = (date: Date, offset: number) => Date;
/**
*
*/
export declare type _getOffsetQuarter = (date: Date, n: number) => Date;
/**
*
*/
export declare type _getQuarterStartMonth = (date: Date) => number;
/**
*
*/
export declare type _getQuarterStartDate = (date: Date) => number;
/**
*
*/
export declare type _getQuarterEndDate = (date: Date) => number;
/**
* n个月之前或之后的日期
*/
export declare type _getOffsetMonth = (date: Date, n: number) => Date;
/**
*
*/
export declare type _getWeekStartDate = (date: Date) => Date;
/**
*
*/
export declare type _getWeekEndDate = (date: Date) => Date;
/**
*
*/
export declare type _print = (date: Date, str: string) => string;
export declare type _date = {
getTimezone: _getTimezone;
getMonthDays: _getMonthDays;
getLastDateOfMonth: _getLastDateOfMonth;
getDayOfYear: _getDayOfYear;
getWeekNumber: _getWeekNumber;
getQuarter: _getQuarter;
getOffsetDate: _getOffsetDate;
getOffsetQuarter: _getOffsetQuarter;
getQuarterStartMonth: _getQuarterStartMonth;
getQuarterStartDate: _getQuarterStartDate;
getQuarterEndDate: _getQuarterEndDate;
getOffsetMonth: _getOffsetMonth;
getWeekStartDate: _getWeekStartDate;
getWeekEndDate: _getWeekEndDate;
print: _print;
};

36
dist/lib/core/func/function.d.ts vendored

@ -0,0 +1,36 @@
/**
*
* @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;
declare type _function = {
createDistinctName: _createDistinctName;
getSearchResult: _getSearchResult;
beforeFunc: _beforeFunc;
afterFunc: _afterFunc;
};
export default _function;

8
dist/lib/core/func/index.d.ts vendored

@ -0,0 +1,8 @@
import _array from "./array";
import _string from "./string";
import _number from "./number";
import _function from "./function";
import { _Date } from "./date";
export interface _func extends _array, _string, _number, _function {
Date: _Date;
}

35
dist/lib/core/func/number.d.ts vendored

@ -0,0 +1,35 @@
/**
*
* @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;
declare type _number = {
add: _add;
sub: _sub;
mul: _mul;
div: _div;
};
export default _number;

62
dist/lib/core/func/string.d.ts vendored

@ -0,0 +1,62 @@
/**
*
* @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[];
declare type _string = {
startWith: _startWith;
endWith: _endWith;
getQuery: _getQuery;
appendQuery: _appendQuery;
replaceAll: _replaceAll;
perfectStart: _perfectStart;
allIndexOf: _allIndexOf;
};
export default _string;

6
dist/lib/core/i18n.d.ts vendored

@ -0,0 +1,6 @@
export declare type _addI18n = (v: string | object) => string;
export declare type _i18nText = (key: string, ..._args: any[]) => string;
export declare type _i18n = {
addI18n: _addI18n;
i18nText: _i18nText;
};

35
dist/lib/core/ob.d.ts vendored

@ -0,0 +1,35 @@
export interface _OB {
props: Props | (<T>(config: T) => Props & T);
options: this["props"];
events?: {
[eventName: string]: Function[];
};
init?(): void;
destroyed?(): void;
_defaultConfig(..._args: any[]): {
[key: string]: any;
} | {};
_init(): void;
_initListeners(): void;
_getEvents(): {
[eventName: string]: Function[];
};
on(eventName: string, fn: Function): void;
once(eventName: string, fn: Function): void;
un(eName: string, fn: Function): void;
_initRef(): void;
_purgeRef(): void;
purgeListeners(): void;
fireEvent(eName: string, ...args: any[]): boolean | null;
destroy(): void;
}
interface Props {
listeners?: {
eventName: string;
action: (...args: any[]) => any;
target?: _OB;
once?: boolean;
}[];
[key: string]: any;
}
export {};

323
dist/lib/core/widget.d.ts vendored

@ -0,0 +1,323 @@
import { _OB } from "./ob";
export interface _WidgetStatic {
/**
*
* @param engine
*/
registerRenderEngine(engine: RenderEngine): void;
}
export interface _Widget extends _OB {
/**
* loading的锁
*/
__asking: boolean;
/**
*
*/
__async: boolean;
/**
* widget类标识符
*/
widgetName: string | null;
/**
*
*/
_isRoot: boolean;
/**
*
*/
_parent: _Widget | null;
/**
* dom的类jQuery对象
*/
element: any;
/**
*
*/
_children: {
[key: string]: _Widget;
};
/**
*
*/
_isMounted: boolean;
/**
* enable
*/
_manualSetEnable: boolean;
/**
* valid
*/
_manualSetValid: boolean;
/**
*
*/
_renderEngine: RenderEngine;
_store(): void;
/**
*
*/
beforeInit?(cb: Function): void;
/**
*
*/
beforeCreate?(): void;
/**
*
*/
created?(): void;
/**
*
*/
render?(): any;
/**
*
*/
beforeMount?(): void;
/**
*
*/
mounted?(): void;
/**
*
*/
shouldUpdate?(): void;
/**
*
*/
update?(...args: any[]): void;
/**
*
*/
beforeDestroy?(): void;
/**
*
*/
destroyed?(): void;
/**
* render函数
*/
_initRender: () => void;
/**
* render函数
*/
_render: () => void;
/**
*
*/
_initRoot: () => void;
/**
*
*/
_initElementWidth: () => void;
/**
*
*/
_initElementHeight: () => void;
/**
*
*/
_initVisual: () => void;
/**
*
*/
_initEffects: () => void;
/**
* mounted锁
*/
_initState: () => void;
/**
* dom
*/
_initElement: () => void;
/**
*
*/
_setParent: () => void;
/**
* @param force
* @param deep force处理
* @param lifeHook
* @param predicate widget的回调
*/
_mount(force?: boolean, deep?: boolean, lifeHook?: boolean, predicate?: Function): boolean;
/**
*
*/
_mountChildren?(): void;
/**
*
*/
isMounted(): boolean;
/**
*
*/
setWidth(w: number): void;
/**
*
*/
setHeight(h: number): void;
/**
*
*/
_setEnable(enable: boolean): void;
/**
*
*/
_setValid(valid: boolean): void;
/**
*
*/
_setVisible(visible: boolean): void;
/**
*
*/
setEnable(enable: boolean): void;
/**
*
*/
setVisible(visible: boolean): void;
/**
*
*/
setValid(valid: boolean): void;
/**
*
* @param args arguments参数
*/
doBehavior(...args: any[]): void;
/**
*
*/
getWidth(): number;
/**
*
*/
getHeight(): number;
/**
*
*/
isValid(): boolean;
/**
*
*/
addWidget(_name: any, _widget: _Widget): _Widget;
/**
* wigetname获取子元素实例
*/
getWidgetByName(_name: string): _Widget | undefined;
/**
*
* @param nameOrWidget widgetName或widget实例
*/
removeWidget(nameOrWidget: string | _Widget): void;
/**
*
*/
hasWidget(name: string): boolean;
/**
* widgetName
*/
getName(): string;
/**
* tag
* @param tag html tag
*/
setTag(tag: string): void;
/**
* tag
*/
getTag(): string;
/**
*
* @param key
* @param value
*/
attr(key: string | {
[key: string]: any;
}, value?: any): any;
/**
* text
*/
getText(): string;
/**
* text
*/
setText(text: string): void;
/**
*
*/
getValue(): any;
/**
*
*/
setValue(...args: any[]): void;
/**
* enable
*/
isEnabled(): boolean;
/**
*
*/
isVisible(): boolean;
/**
* disable元素
*/
disable(): void;
/**
* enable元素
*/
enable(): void;
/**
* widget合法
*/
valid(): void;
/**
* 使
*/
invalid(): void;
/**
* 使
*/
invisible(..._args: any[]): void;
/**
*
*/
visible(..._args: any[]): void;
/**
*
*/
__d(): void;
/**
*
*/
_unMount(): void;
/**
* hang元素
*/
isolate(): void;
/**
*
*/
empty(): void;
/**
* destory方法
*/
_destroy(): void;
/**
* destory元素
*/
destroy(): void;
}
interface RenderEngine {
/**
* jQuery对象
* @param widget widget对象
*/
createElement: (widget: any) => any;
/**
* DocumentFragment对象
*/
createFragment: () => DocumentFragment;
}
export {};

42
dist/lib/index.d.ts vendored

@ -0,0 +1,42 @@
import * as decorator from "./core/decorator/decorator";
import { _i18n } from "./core/i18n";
import { _OB } from "./core/ob";
import { _func } from "./core/func";
import { _Widget, _WidgetStatic } from "./core/widget";
import { _Single } from "./base/single/single";
import { _base } from "./core/base";
import { _BasicButton } from "./base/single/button/button.basic";
import { _Trigger } from "./base/single/trigger/trigger";
import { _Action, _ActionFactory } from "./core/action/action";
import { _ShowAction } from "./core/action/action.show";
import { _Behavior, _BehaviorFactory } from "./core/behavior/behavior";
import { _HighlightBehavior } from "./core/behavior/behavior.highlight";
import { _RedMarkBehavior } from "./core/behavior/behavior.redmark";
import { _Pane, _PaneStatic } from "./base/pane";
import { _LoadingPane } from "./case/loading/loading_pane";
declare type ClassConstructor<T extends {}> = T & {
new (config: any): T;
(config: any): T;
readonly prototype: T;
};
export interface BI extends _func, _i18n, _base {
OB: ClassConstructor<_OB>;
Widget: ClassConstructor<_Widget> & _WidgetStatic;
Single: ClassConstructor<_Single>;
BasicButton: ClassConstructor<_BasicButton>;
Trigger: ClassConstructor<_Trigger>;
Action: ClassConstructor<_Action>;
ActionFactory: ClassConstructor<_ActionFactory>;
ShowAction: ClassConstructor<_ShowAction>;
Behavior: ClassConstructor<_Behavior>;
BehaviorFactory: ClassConstructor<_BehaviorFactory>;
HighlightBehavior: ClassConstructor<_HighlightBehavior>;
RedMarkBehavior: ClassConstructor<_RedMarkBehavior>;
Pane: ClassConstructor<_Pane> & _PaneStatic;
LoadingPane: ClassConstructor<_LoadingPane>;
Decorators: typeof decorator;
}
declare const _default: {
Decorators: typeof decorator;
};
export default _default;
Loading…
Cancel
Save