Skip to content

Commit cbccd81

Browse files
committed
chore: @gkd-kit/[email protected]
1 parent 08d6db4 commit cbccd81

File tree

2 files changed

+71
-3
lines changed

2 files changed

+71
-3
lines changed

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gkd-kit/api",
3-
"version": "0.7.3",
3+
"version": "0.8.0",
44
"description": "a typescript kit for gkd",
55
"type": "module",
66
"main": "./src/index.ts",

api/src/index.ts

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export interface RawCommonProps {
331331
* @example
332332
* 'match'
333333
* // 在应用内由不匹配界面切换为匹配界面时, 重置规则
334-
*
334+
*
335335
* @example
336336
* 'app'
337337
* // 重新进入 app 时, 重置规则
@@ -491,6 +491,10 @@ export interface RawRuleProps extends RawCommonProps {
491491
* @example
492492
* `longClickCenter`
493493
* // 与 clickCenter 类似, 长按时间为 400 毫秒
494+
*
495+
* @example
496+
* `none`
497+
* // 什么都不做, 仅作为匹配标记使用
494498
*/
495499
action?:
496500
| 'click'
@@ -499,7 +503,8 @@ export interface RawRuleProps extends RawCommonProps {
499503
| 'back'
500504
| 'longClick'
501505
| 'longClickNode'
502-
| 'longClickCenter';
506+
| 'longClickCenter'
507+
| 'none';
503508

504509
/**
505510
* 在使用 clickCenter/longClickCenter 时的自定义点击位置
@@ -613,26 +618,40 @@ export interface RawAppRuleProps {
613618
/**
614619
* 如果应用版本名称包含在此列表中, 则匹配
615620
*
621+
* @deprecated {@link versionName}
616622
*/
617623
versionNames?: IArray<string>;
618624

619625
/**
620626
* 如果应用版本名称包含在此列表中, 则排除匹配, 优先级高于 versionNames
621627
*
628+
* @deprecated {@link versionName}
622629
*/
623630
excludeVersionNames?: IArray<string>;
624631

625632
/**
626633
* 如果应用版本代码包含在此列表中, 则匹配
627634
*
635+
* @deprecated {@link versionCode}
628636
*/
629637
versionCodes?: IArray<Integer>;
630638

631639
/**
632640
* 如果应用版本代码包含在此列表中, 则排除匹配, 优先级高于 versionCodes
633641
*
642+
* @deprecated {@link versionCode}
634643
*/
635644
excludeVersionCodes?: IArray<Integer>;
645+
646+
/**
647+
* 应用版本代码(整数)匹配规则
648+
*/
649+
versionCode?: IntegerMatcher;
650+
651+
/**
652+
* 应用版本名称(字符串)匹配规则
653+
*/
654+
versionName?: StringMatcher;
636655
}
637656

638657
/**
@@ -670,6 +689,55 @@ export interface RawGlobalRuleProps {
670689
apps?: RawGlobalApp[];
671690
}
672691

692+
/**
693+
* 整数匹配规则
694+
*
695+
* 优先级: exclude > include > (minimum/maximum)
696+
*/
697+
export type IntegerMatcher = {
698+
/**
699+
* 如果在此列表中, 则排除匹配
700+
*/
701+
exclude?: IArray<Integer>;
702+
703+
/**
704+
* 如果不在此列表中, 则排除匹配
705+
*/
706+
include?: IArray<Integer>;
707+
708+
/**
709+
* 如果小于此值, 则排除匹配
710+
*/
711+
minimum?: Integer;
712+
713+
/**
714+
* 如果大于此值, 则排除匹配
715+
*/
716+
maximum?: Integer;
717+
};
718+
719+
/**
720+
* 字符串匹配规则
721+
*
722+
* 优先级: exclude > include > pattern
723+
*/
724+
export type StringMatcher = {
725+
/**
726+
* 如果在此列表中, 则排除匹配
727+
*/
728+
exclude?: IArray<string>;
729+
730+
/**
731+
* 如果不在此列表中, 则排除匹配
732+
*/
733+
include?: IArray<string>;
734+
735+
/**
736+
* 如果匹配此正则表达式, 则匹配
737+
*/
738+
pattern?: string;
739+
};
740+
673741
/**
674742
* 位置类型, 用以描述自定义点击位置
675743
*

0 commit comments

Comments
 (0)