@scml-dol-maplebirch/types 5.1.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,8 @@ export interface MacroContext extends Omit<SugarCubeMacroContext, 'args' | 'crea
24
24
  selectedIdx: number;
25
25
  }>;
26
26
  }
27
+ export declare function parseLanguageArgs(args: MacroArgs): void;
28
+ /** Array labels contain literal [EN, CN] text, not translation segments. */
27
29
  export interface LinkArg {
28
30
  text: string | readonly string[];
29
31
  link?: string;
@@ -6,6 +6,7 @@ interface Part {
6
6
  name: string;
7
7
  tfRequired: number;
8
8
  default?: string;
9
+ label?: string | (() => string);
9
10
  [key: string]: any;
10
11
  }
11
12
  type TransformHook = (options: any, model?: CanvasModel) => void;
@@ -14,7 +15,18 @@ type TransformMessage = Record<string, {
14
15
  down: string[];
15
16
  }>;
16
17
  type TranslationInput = Record<string, Translation> | Map<string, Translation>;
17
- interface EntryOptions {
18
+ interface TransformationHooks {
19
+ pre?: TransformHook;
20
+ post?: TransformHook;
21
+ layers?: CanvasLayerMap | (() => CanvasLayerMap);
22
+ }
23
+ interface ChimeraOption {
24
+ name: string;
25
+ part: string;
26
+ sources: readonly string[];
27
+ label: string | (() => string);
28
+ }
29
+ interface EntryOptions extends TransformationHooks {
18
30
  build?: number;
19
31
  level?: number;
20
32
  update?: number[];
@@ -24,9 +36,8 @@ interface EntryOptions {
24
36
  decayConditions?: DecayCondition[];
25
37
  suppress?: boolean;
26
38
  suppressConditions?: SuppressCondition[];
27
- pre?: TransformHook;
28
- post?: TransformHook;
29
- layers?: CanvasLayerMap;
39
+ combat?: TransformationHooks;
40
+ chimeras?: ChimeraOption[];
30
41
  translations?: TranslationInput;
31
42
  }
32
43
  interface TransformationOption extends EntryOptions {
@@ -37,6 +48,7 @@ declare class Transformation {
37
48
  private manager;
38
49
  private get log();
39
50
  private config;
51
+ private readonly chimeraConfig;
40
52
  readonly decayConditions: Record<string, DecayCondition[]>;
41
53
  readonly suppressConditions: Record<string, SuppressCondition[]>;
42
54
  readonly buildUpdaters: Record<string, BuildUpdater>;
@@ -48,6 +60,14 @@ declare class Transformation {
48
60
  wikifier(widget: string, ...args: any[]): any;
49
61
  modifyEffect(manager: AddonPlugin): void;
50
62
  add(name: string, type: string, options: TransformationOption): this;
63
+ get chimeras(): {
64
+ name: string;
65
+ part: string;
66
+ sources: readonly string[];
67
+ label: string;
68
+ }[];
69
+ get chimeraDefaults(): Record<string, Record<string, boolean>>;
70
+ get chimeraOptions(): Record<string, boolean>;
51
71
  inject(): void;
52
72
  private _update;
53
73
  state(): void;
@@ -56,6 +76,7 @@ declare class Transformation {
56
76
  _transform(name: string, change: number): void;
57
77
  updateTransform(name: string): void;
58
78
  _updateParts(name: string, oldLevel: number, newLevel: number): void;
79
+ private traits;
59
80
  _transformationAlteration(): void;
60
81
  _transformationStateUpdate(): void;
61
82
  private handleHiddenTransformParts;
@@ -12,6 +12,6 @@ export declare const antiquesData: Record<string, AntiqueConfig>;
12
12
  declare class Antiques {
13
13
  static add(key: string, config: AntiqueConfig): void;
14
14
  static inject(data: Record<string, AntiqueConfig>): Record<string, AntiqueConfig>;
15
- static syncState(): void;
15
+ static syncState(data?: Record<string, AntiqueConfig>): void;
16
16
  }
17
17
  export default Antiques;
@@ -0,0 +1,20 @@
1
+ type Text = string | (() => string);
2
+ /** 手动服用的扩展药片。库存与药效归调用模组管理,框架只接入原版药柜。 */
3
+ export interface PillConfig {
4
+ cn_name?: Text;
5
+ description: Text;
6
+ warning_label: Text;
7
+ icon?: string;
8
+ indicators?: string[] | (() => string[]);
9
+ owned: () => number;
10
+ doseTaken: () => number;
11
+ canTake: () => boolean;
12
+ take: () => void;
13
+ }
14
+ export declare const pillsData: Record<string, PillConfig>;
15
+ declare class Pills {
16
+ private installed;
17
+ static add(name: string, config: PillConfig): void;
18
+ apply(): void;
19
+ }
20
+ export default Pills;
@@ -11,6 +11,7 @@ interface Trait {
11
11
  export interface TraitConfig {
12
12
  title: string;
13
13
  name: string | (() => string);
14
+ replace?: string | RegExp;
14
15
  colour: string | (() => string);
15
16
  has: boolean | (() => boolean);
16
17
  text: string | (() => string);
@@ -6,6 +6,7 @@ import Bodywriting from './Bodywriting.js';
6
6
  import Foodstuff from './Foodstuff.js';
7
7
  import Antiques from './Antiques.js';
8
8
  import Tips from './Tips.js';
9
+ import Pills from './Pills.js';
9
10
  import Fishing from './Fishing.js';
10
11
  declare function register(core: MaplebirchCore, patch: Patch): (Patch<Record<never, never>> & {
11
12
  traitsData: import("./Traits.js").TraitConfig[];
@@ -40,6 +41,9 @@ declare function register(core: MaplebirchCore, patch: Patch): (Patch<Record<nev
40
41
  addTips: typeof Tips.add;
41
42
  applyTips: typeof Tips.apply;
42
43
  injectTips: typeof Tips.inject;
44
+ } & {
45
+ data: Record<string, import("./Pills.js").PillConfig>;
46
+ add: typeof Pills.add;
43
47
  }) & {
44
48
  traits: {
45
49
  data: import("./Traits.js").TraitConfig[];
@@ -75,6 +79,10 @@ declare function register(core: MaplebirchCore, patch: Patch): (Patch<Record<nev
75
79
  add: typeof Antiques.add;
76
80
  inject: typeof Antiques.inject;
77
81
  };
82
+ pills: {
83
+ data: Record<string, import("./Pills.js").PillConfig>;
84
+ add: typeof Pills.add;
85
+ };
78
86
  tips: {
79
87
  data: Record<string, string[]>;
80
88
  add: typeof Tips.add;
@@ -18,17 +18,20 @@ declare const locationPassage: {
18
18
  src: string;
19
19
  applyafter: string;
20
20
  applybefore?: undefined;
21
- to?: undefined;
21
+ srcmatch?: undefined;
22
+ expected?: undefined;
22
23
  } | {
23
- applyafter?: undefined;
24
24
  src: string;
25
25
  applybefore: string;
26
- to?: undefined;
27
- } | {
26
+ srcmatch?: undefined;
28
27
  applyafter?: undefined;
28
+ expected?: undefined;
29
+ } | {
30
+ src?: undefined;
29
31
  applybefore?: undefined;
30
- src: string;
31
- to: string;
32
+ srcmatch: RegExp;
33
+ applyafter: string;
34
+ expected: number;
32
35
  })[];
33
36
  };
34
37
  declare const widgetPassage: {
@@ -78,42 +81,42 @@ declare const widgetPassage: {
78
81
  applyafter: string;
79
82
  })[];
80
83
  'Widgets Named Npcs': ({
84
+ src?: undefined;
81
85
  applybefore?: undefined;
82
86
  srcmatch: RegExp;
83
87
  to: string;
84
- src?: undefined;
85
88
  } | {
86
89
  applybefore?: undefined;
87
90
  srcmatch?: undefined;
88
91
  src: string;
89
92
  to: string;
90
93
  } | {
91
- to?: undefined;
92
94
  srcmatch?: undefined;
95
+ to?: undefined;
93
96
  src: string;
94
97
  applybefore: string;
95
98
  })[];
96
99
  'Widgets Settings': ({
97
- applyafter?: undefined;
98
100
  src?: undefined;
101
+ applyafter?: undefined;
99
102
  srcmatch: RegExp;
100
103
  to: string;
101
104
  srcmatchgroup?: undefined;
102
105
  } | {
103
- applyafter?: undefined;
104
- srcmatch?: undefined;
105
106
  src?: undefined;
107
+ srcmatch?: undefined;
108
+ applyafter?: undefined;
106
109
  srcmatchgroup: RegExp;
107
110
  to: string;
108
111
  } | {
109
- to?: undefined;
110
112
  src?: undefined;
113
+ to?: undefined;
111
114
  srcmatchgroup?: undefined;
112
115
  srcmatch: RegExp;
113
116
  applyafter: string;
114
117
  } | {
115
- to?: undefined;
116
118
  srcmatch?: undefined;
119
+ to?: undefined;
117
120
  srcmatchgroup?: undefined;
118
121
  src: string;
119
122
  applyafter: string;
@@ -124,8 +127,8 @@ declare const widgetPassage: {
124
127
  src: string;
125
128
  applybefore: string;
126
129
  } | {
127
- applybefore?: undefined;
128
130
  src?: undefined;
131
+ applybefore?: undefined;
129
132
  srcmatchgroup: RegExp;
130
133
  to: string;
131
134
  })[];
@@ -157,30 +160,50 @@ declare const widgetPassage: {
157
160
  src: string;
158
161
  applyafter: string;
159
162
  }[];
163
+ 'Widgets Abomination': {
164
+ src: string;
165
+ applyafter: string;
166
+ expected: number;
167
+ }[];
160
168
  Traits: {
161
169
  src: string;
162
170
  applybefore: string;
163
171
  }[];
164
172
  'Widgets Journal': ({
165
- applybefore?: undefined;
166
173
  src?: undefined;
174
+ applybefore?: undefined;
167
175
  srcmatch: RegExp;
168
176
  to: string;
169
177
  } | {
170
- to?: undefined;
171
178
  srcmatch?: undefined;
179
+ to?: undefined;
172
180
  src: string;
173
181
  applybefore: string;
174
182
  })[];
175
183
  'Widgets Mirror': ({
176
184
  src?: undefined;
185
+ applybefore?: undefined;
186
+ expected?: undefined;
177
187
  srcmatch: RegExp;
178
188
  to: string;
179
189
  } | {
190
+ applybefore?: undefined;
180
191
  srcmatch?: undefined;
192
+ expected?: undefined;
181
193
  src: string;
182
194
  to: string;
195
+ } | {
196
+ srcmatch?: undefined;
197
+ to?: undefined;
198
+ src: string;
199
+ applybefore: string;
200
+ expected: number;
183
201
  })[];
202
+ 'Transformation Widgets': {
203
+ src: string;
204
+ applybefore: string;
205
+ expected: number;
206
+ }[];
184
207
  'Widgets NPCs': {
185
208
  src: string;
186
209
  to: string;
@@ -118,6 +118,7 @@ export declare const NamedNPC: {
118
118
  };
119
119
  } & {
120
120
  add: (manager: NPCManager, npcData: NPCData, config?: NPCConfig, translationsData?: TranslationInput) => boolean;
121
+ apply: (manager: NPCManager, npc: NPCData) => void;
121
122
  get: (manager: NPCManager) => string[];
122
123
  clear: (manager: NPCManager) => boolean;
123
124
  update: (manager: NPCManager) => boolean;
@@ -131,6 +132,7 @@ declare class NPCManager {
131
132
  readonly data: Map<string, {
132
133
  Data: InstanceType<typeof NamedNPC>;
133
134
  Config: NPCConfig;
135
+ Patch: NPCData;
134
136
  }>;
135
137
  NPCNameList: string[];
136
138
  readonly Transformation: NPCTransformation;
@@ -32,6 +32,7 @@ declare class NPCOutfitSets {
32
32
  init(): void;
33
33
  add(...configs: OutfitSetConfig[]): void;
34
34
  get data(): OutfitSet[];
35
+ recover(): void;
35
36
  private create;
36
37
  private createPart;
37
38
  }
@@ -26,6 +26,8 @@ declare class StateEvent extends Event {
26
26
  constructor(id: string, type: 'gate' | 'append', options: StateEventOptions, log: Dynamic['log']);
27
27
  private checkPassage;
28
28
  tryRun(passageName?: string): StateEventResult | null;
29
+ matches(passageName?: string): boolean;
30
+ run(): StateEventResult;
29
31
  private match;
30
32
  private runAction;
31
33
  shouldForceExit(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scml-dol-maplebirch/types",
3
- "version": "5.1.2",
3
+ "version": "5.2.0",
4
4
  "description": "TypeScript definitions for maplebirchFramework.",
5
5
  "keywords": [
6
6
  "degrees-of-lewdity",
package/types/global.d.ts CHANGED
@@ -19,6 +19,12 @@ declare global {
19
19
  addonBeautySelectorAddon: BeautySelectorAddon;
20
20
  readonly Time: typeof Time;
21
21
  DateTime: typeof DateTime;
22
+ onTakeClick(name: string, type?: string): void;
23
+ onAutoTakeClick(name: string, type?: string): void;
24
+ initPillContextButtons(item: {
25
+ name: string;
26
+ type: string;
27
+ }): void;
22
28
  closeOverlay(): void;
23
29
  updateOptions(): void;
24
30
  lanSwitch: typeof _languageSwitch;