mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Enable no unused vars and add more types (#2005)
Some checks failed
Project CI / build (24.x) (push) Has been cancelled
Some checks failed
Project CI / build (24.x) (push) Has been cancelled
This commit is contained in:
parent
af49c1f4c8
commit
96f090bef5
20 changed files with 141 additions and 31 deletions
40
daggerheart.d.ts
vendored
40
daggerheart.d.ts
vendored
|
|
@ -2,6 +2,7 @@ import '@client/global.mjs';
|
|||
import '@common/global.mjs';
|
||||
import '@common/primitives/global.mjs';
|
||||
import Canvas from '@client/canvas/board.mjs';
|
||||
import { ResourceUpdateMap } from './module/data/action/baseAction.mjs';
|
||||
|
||||
// Foundry's use of `Object.assign(globalThis) means many globally available objects are not read as such
|
||||
// This declare global hopefully fixes that
|
||||
|
|
@ -39,4 +40,43 @@ declare global {
|
|||
const Collection: foundry.utils.Collection;
|
||||
const FormDataExtended: foundry.applications.ux.FormDataExtended;
|
||||
const TextEditor: foundry.applications.ux.TextEditor;
|
||||
|
||||
/**
|
||||
* Data used to build rolls such as duality rolls. The definition is incomplete and likely incorrect.
|
||||
* Objects will often accept a Partial<RollConfig> and spit out a non-partial. Those that are not guaranteed should be marked optional.
|
||||
*/
|
||||
interface RollConfig {
|
||||
// unverified, check which ones are used and optional/not optional
|
||||
event: Event;
|
||||
title: string;
|
||||
roll: {
|
||||
modifier: number;
|
||||
simple: boolean;
|
||||
type: string;
|
||||
difficulty: number;
|
||||
};
|
||||
hasDamage: boolean;
|
||||
hasEffect: boolean;
|
||||
hasRoll: boolean;
|
||||
chatMessage: {
|
||||
template: string;
|
||||
mute: boolean;
|
||||
};
|
||||
targets: object;
|
||||
costs: object;
|
||||
|
||||
// verified
|
||||
source?: {
|
||||
/** uuid of the actor this roll is coming from */
|
||||
actor: string;
|
||||
};
|
||||
/** Roll data associated with the actor or item */
|
||||
data: object;
|
||||
resourceUpdates: ResourceUpdateMap;
|
||||
hooks: string[];
|
||||
dialog: {
|
||||
configure: boolean;
|
||||
};
|
||||
damageOptions: object;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue