Enable no unused vars and add more types

This commit is contained in:
Carlos Fernandez 2026-06-14 15:12:47 -04:00
parent af49c1f4c8
commit ba11651b0c
20 changed files with 141 additions and 31 deletions

14
module/data/actor/_types.d.ts vendored Normal file
View file

@ -0,0 +1,14 @@
import DhpActor from '../../documents/actor.mjs'
import DhCharacter from './character.mjs';
declare module './base.mjs' {
export default interface BaseDataActor {
parent: DhpActor<this>;
}
}
declare module './companion.mjs' {
export default interface DhCompanion {
partner: DhpActor<DhCharacter>;
}
}

View file

@ -1,9 +1,13 @@
import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs';
import DHItem from '../../documents/item.mjs';
import { createShallowProxy, getScrollTextData } from '../../helpers/utils.mjs';
const fields = foundry.data.fields;
/**
* @import DHItem from '../../documents/item.mjs';
* @import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs';
*/
/** Function to generate resistance fields for damage types */
const resistanceField = (resistanceLabel, immunityLabel, reductionLabel) =>
new fields.SchemaField({
resistance: new fields.BooleanField({
@ -96,6 +100,8 @@ export const commonActorRules = (extendedData = { damageReduction: {}, attack: {
* @property {Boolean} isNPC - This data model represents a NPC?
* @property {typeof DHBaseActorSettings} settingSheet - The sheet class used to render the settings UI for this actor type.
*/
/** Base actor type data model for all actors in Daggerheart */
export default class BaseDataActor extends foundry.abstract.TypeDataModel {
/** @returns {ActorDataModelMetadata}*/
static get metadata() {