-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathcommon.ts
More file actions
31 lines (27 loc) · 791 Bytes
/
common.ts
File metadata and controls
31 lines (27 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
export type LimitReason =
& Required<Pick<timer.limit.Rule, 'id' | 'cond'>>
& Pick<timer.limit.Item, 'allowDelay'>
& Partial<Pick<timer.limit.Item, 'delayCount'>>
& {
type: LimitType
getVisitTime?: () => number
}
export type LimitType =
| "DAILY"
| "WEEKLY"
| "VISIT"
| "PERIOD"
export interface MaskModal {
addReason(...reasons: LimitReason[]): void
removeReason(...reasons: LimitReason[]): void
removeReasonsByType(...types: LimitType[]): void
addDelayHandler(handler: () => void): void
}
export type ModalContext = {
url: string
modal: MaskModal
}
export interface Processor {
handleMsg(code: timer.mq.ReqCode, data: any): timer.mq.Response | Promise<timer.mq.Response>
init(): void | Promise<void>
}