generated from zhouhua/obsidian-markdown-media-card
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtype.d.ts
56 lines (52 loc) · 1.41 KB
/
type.d.ts
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
declare interface IExplosion {
maxExplosions: number;
size: number;
frequency: number;
explosionOrder: 'random' | 'sequential' | number;
gifMode: 'continue' | 'restart';
duration: number;
offset: number;
backgroundMode: 'mask' | 'image';
imageList: string[];
customStyle?: Partial<CSSStyleDeclaration>;
}
declare interface ISetting {
shakeScreen: {
enable: boolean;
intensity: number;
recoverTime: number;
shakeWindow?: boolean;
};
combo: {
enable: boolean;
timeout: number;
showExclamation: boolean;
precisionInput: boolean;
};
explosion: {
enable: boolean;
} & IExplosion;
explosionPreset: number;
useCustom: boolean;
customEffect?: Partial<IExplosion>;
}
declare type ConditionType<T> =
| { flag: number | string | boolean; path: string; }
| ((data: T) => boolean);
interface IAbstractField<T> {
label: string;
path: string;
when?: ConditionType<T>;
desc?: string;
beforeChange?: (value: unknown, data: T) => unknown;
afterChange?: (value: unknown, data: T) => unknown;
}
interface BaseFieldSchema<T> extends IAbstractField<T> {
type: 'number' | 'string' | 'boolean' | 'text' | 'imageList' | 'json';
}
interface SelectFieldSchema<T> extends IAbstractField<T> {
type: 'select';
options: { text: string; value: string; }[];
}
declare type FieldSchema<T> = BaseFieldSchema<T> | SelectFieldSchema<T>;
declare type FormSchema<T> = FieldSchema<T>[];