refactor: prefer type imports and sort imports
This commit is contained in:
parent
8d2cff77d7
commit
9cffa4df04
49 changed files with 124 additions and 105 deletions
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
|
@ -6,5 +6,11 @@
|
||||||
"eslint.nodePath": ".yarn/sdks",
|
"eslint.nodePath": ".yarn/sdks",
|
||||||
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
|
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
|
||||||
"typescript.tsdk": ".yarn/sdks/typescript/lib",
|
"typescript.tsdk": ".yarn/sdks/typescript/lib",
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
"typescript.enablePromptUseWorkspaceTsdk": true,
|
||||||
|
"importSorter.generalConfiguration.sortOnBeforeSave": true,
|
||||||
|
"importSorter.importStringConfiguration.maximumNumberOfImportExpressionsPerLine.type": "newLineEachExpressionAfterCountLimitExceptIfOnlyOne",
|
||||||
|
"importSorter.importStringConfiguration.maximumNumberOfImportExpressionsPerLine.count": 120,
|
||||||
|
"importSorter.importStringConfiguration.tabSize": 4,
|
||||||
|
"importSorter.importStringConfiguration.quoteMark": "double",
|
||||||
|
"importSorter.importStringConfiguration.trailingComma": "multiLine"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { CooldownDuration, DS4SpellDataSourceData } from "../../../src/item/spell/spell-data-source";
|
|
||||||
import { calculateSpellPrice } from "../../../src/item/spell/calculate-spell-price";
|
import { calculateSpellPrice } from "../../../src/item/spell/calculate-spell-price";
|
||||||
|
|
||||||
|
import type { CooldownDuration, DS4SpellDataSourceData } from "../../../src/item/spell/spell-data-source";
|
||||||
|
|
||||||
const defaultData: DS4SpellDataSourceData = {
|
const defaultData: DS4SpellDataSourceData = {
|
||||||
description: "",
|
description: "",
|
||||||
equipped: false,
|
equipped: false,
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
import { DS4Actor } from "./actor/actor";
|
import { DS4Actor } from "./actor/actor";
|
||||||
import { getGame } from "./helpers";
|
import { getGame } from "./helpers";
|
||||||
import { DS4Item } from "./item/item";
|
|
||||||
|
import type { DS4Item } from "./item/item";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface DocumentClassConfig {
|
interface DocumentClassConfig {
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { ModifiableDataBaseTotal, ResourceDataBaseTotalMax } from "../common/common-data";
|
|
||||||
import { DS4 } from "../config";
|
import { DS4 } from "../config";
|
||||||
|
|
||||||
|
import type { ModifiableDataBaseTotal, ResourceDataBaseTotalMax } from "../common/common-data";
|
||||||
|
|
||||||
export interface DS4ActorDataPropertiesDataBase {
|
export interface DS4ActorDataPropertiesDataBase {
|
||||||
attributes: DS4ActorDataPropertiesDataAttributes;
|
attributes: DS4ActorDataPropertiesDataAttributes;
|
||||||
traits: DS4ActorDataPropertiesDataTraits;
|
traits: DS4ActorDataPropertiesDataTraits;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4CharacterDataProperties } from "./character/character-data-properties";
|
import type { DS4CharacterDataProperties } from "./character/character-data-properties";
|
||||||
import { DS4CreatureDataProperties } from "./creature/creature-data-properties";
|
import type { DS4CreatureDataProperties } from "./creature/creature-data-properties";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface DataConfig {
|
interface DataConfig {
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { ModifiableData, ModifiableDataBase, ResourceData } from "../common/common-data";
|
|
||||||
import { DS4 } from "../config";
|
import { DS4 } from "../config";
|
||||||
|
|
||||||
|
import type { ModifiableData, ModifiableDataBase, ResourceData } from "../common/common-data";
|
||||||
|
|
||||||
export interface DS4ActorDataSourceDataBase {
|
export interface DS4ActorDataSourceDataBase {
|
||||||
attributes: DS4ActorDataSourceDataAttributes;
|
attributes: DS4ActorDataSourceDataAttributes;
|
||||||
traits: DS4ActorDataSourceDataTraits;
|
traits: DS4ActorDataSourceDataTraits;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4CharacterDataSource } from "./character/character-data-source";
|
import type { DS4CharacterDataSource } from "./character/character-data-source";
|
||||||
import { DS4CreatureDataSource } from "./creature/creature-data-source";
|
import type { DS4CreatureDataSource } from "./creature/creature-data-source";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface SourceConfig {
|
interface SourceConfig {
|
||||||
|
|
|
@ -6,15 +6,17 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ActiveEffect } from "../active-effect";
|
import { DS4ActiveEffect } from "../active-effect";
|
||||||
import { ModifiableDataBaseTotal } from "../common/common-data";
|
|
||||||
import { DS4 } from "../config";
|
import { DS4 } from "../config";
|
||||||
import { getCanvas, getGame } from "../helpers";
|
import { getCanvas, getGame } from "../helpers";
|
||||||
import { DS4Settings, getDS4Settings } from "../settings";
|
import { getDS4Settings } from "../settings";
|
||||||
import notifications from "../ui/notifications";
|
import notifications from "../ui/notifications";
|
||||||
import { enforce } from "../utils";
|
import { enforce } from "../utils";
|
||||||
import { isCheck } from "./actor-data-properties-base";
|
import { isCheck } from "./actor-data-properties-base";
|
||||||
|
|
||||||
|
import type { ModifiableDataBaseTotal } from "../common/common-data";
|
||||||
|
import type { DS4Settings } from "../settings";
|
||||||
import type { DS4Item } from "../item/item";
|
import type { DS4Item } from "../item/item";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base sheet class for all {@link DS4Actor}s.
|
* The base sheet class for all {@link DS4Actor}s.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,17 +3,18 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { ModifiableDataBaseTotal } from "../common/common-data";
|
|
||||||
import { DS4 } from "../config";
|
import { DS4 } from "../config";
|
||||||
import { getGame } from "../helpers";
|
import { getGame } from "../helpers";
|
||||||
import { DS4ArmorDataProperties } from "../item/armor/armor-data-properties";
|
|
||||||
import { DS4Item } from "../item/item";
|
|
||||||
import { ItemType } from "../item/item-data-source";
|
|
||||||
import { DS4ShieldDataProperties } from "../item/shield/shield-data-properties";
|
|
||||||
import { createCheckRoll } from "../rolls/check-factory";
|
import { createCheckRoll } from "../rolls/check-factory";
|
||||||
import { Check } from "./actor-data-properties-base";
|
|
||||||
import { isAttribute, isTrait } from "./actor-data-source-base";
|
import { isAttribute, isTrait } from "./actor-data-source-base";
|
||||||
|
|
||||||
|
import type { ModifiableDataBaseTotal } from "../common/common-data";
|
||||||
|
import type { DS4ArmorDataProperties } from "../item/armor/armor-data-properties";
|
||||||
|
import type { DS4Item } from "../item/item";
|
||||||
|
import type { ItemType } from "../item/item-data-source";
|
||||||
|
import type { DS4ShieldDataProperties } from "../item/shield/shield-data-properties";
|
||||||
|
import type { Check } from "./actor-data-properties-base";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface DocumentClassConfig {
|
interface DocumentClassConfig {
|
||||||
Actor: typeof DS4Actor;
|
Actor: typeof DS4Actor;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base";
|
import type { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base";
|
||||||
import {
|
import type {
|
||||||
DS4CharacterDataSourceDataBaseInfo,
|
DS4CharacterDataSourceDataBaseInfo,
|
||||||
DS4CharacterDataSourceDataCurrency,
|
DS4CharacterDataSourceDataCurrency,
|
||||||
DS4CharacterDataSourceDataProfile,
|
DS4CharacterDataSourceDataProfile,
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { UsableResource } from "../../common/common-data";
|
import type { UsableResource } from "../../common/common-data";
|
||||||
import { DS4ActorDataSourceDataBase } from "../actor-data-source-base";
|
import type { DS4ActorDataSourceDataBase } from "../actor-data-source-base";
|
||||||
|
|
||||||
export interface DS4CharacterDataSource {
|
export interface DS4CharacterDataSource {
|
||||||
type: "character";
|
type: "character";
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { ItemType } from "../../item/item-data-source";
|
|
||||||
import { DS4Actor } from "../actor";
|
import { DS4Actor } from "../actor";
|
||||||
|
|
||||||
|
import type { ItemType } from "../../item/item-data-source";
|
||||||
|
|
||||||
export class DS4Character extends DS4Actor {
|
export class DS4Character extends DS4Actor {
|
||||||
/** @override */
|
/** @override */
|
||||||
prepareFinalDerivedData(): void {
|
prepareFinalDerivedData(): void {
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base";
|
import type { DS4ActorDataPropertiesDataBase } from "../actor-data-properties-base";
|
||||||
import { DS4CreatureDataSourceDataBaseInfo } from "./creature-data-source";
|
import type { DS4CreatureDataSourceDataBaseInfo } from "./creature-data-source";
|
||||||
|
|
||||||
export interface DS4CreatureDataProperties {
|
export interface DS4CreatureDataProperties {
|
||||||
type: "creature";
|
type: "creature";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4 } from "../../config";
|
import type { DS4 } from "../../config";
|
||||||
import { DS4ActorDataSourceDataBase } from "../actor-data-source-base";
|
import type { DS4ActorDataSourceDataBase } from "../actor-data-source-base";
|
||||||
|
|
||||||
export interface DS4CreatureDataSource {
|
export interface DS4CreatureDataSource {
|
||||||
type: "creature";
|
type: "creature";
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { ItemType } from "../../item/item-data-source";
|
|
||||||
import { DS4Actor } from "../actor";
|
import { DS4Actor } from "../actor";
|
||||||
|
|
||||||
|
import type { ItemType } from "../../item/item-data-source";
|
||||||
|
|
||||||
export class DS4Creature extends DS4Actor {
|
export class DS4Creature extends DS4Actor {
|
||||||
/** @override */
|
/** @override */
|
||||||
get ownableItemTypes(): Array<ItemType> {
|
get ownableItemTypes(): Array<ItemType> {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import "../scss/ds4.scss";
|
import "../scss/ds4.scss";
|
||||||
|
|
||||||
import registerForHooks from "./hooks/hooks";
|
import registerForHooks from "./hooks/hooks";
|
||||||
|
|
||||||
registerForHooks();
|
registerForHooks();
|
||||||
|
|
|
@ -5,18 +5,17 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ActiveEffect } from "../active-effect";
|
import { DS4ActiveEffect } from "../active-effect";
|
||||||
import { DS4Actor } from "../actor/actor";
|
|
||||||
import { DS4ActorProxy } from "../actor/proxy";
|
|
||||||
import { DS4CharacterActorSheet } from "../actor/character/character-sheet";
|
import { DS4CharacterActorSheet } from "../actor/character/character-sheet";
|
||||||
import { DS4CreatureActorSheet } from "../actor/creature/creature-sheet";
|
import { DS4CreatureActorSheet } from "../actor/creature/creature-sheet";
|
||||||
|
import { DS4ActorProxy } from "../actor/proxy";
|
||||||
import { DS4ChatMessage } from "../chat-message";
|
import { DS4ChatMessage } from "../chat-message";
|
||||||
import { DS4 } from "../config";
|
import { DS4 } from "../config";
|
||||||
import { preloadFonts as preloadFonts } from "../fonts";
|
import { preloadFonts } from "../fonts";
|
||||||
import registerHandlebarsHelpers from "../handlebars/handlebars-helpers";
|
import registerHandlebarsHelpers from "../handlebars/handlebars-helpers";
|
||||||
import registerHandlebarsPartials from "../handlebars/handlebars-partials";
|
import registerHandlebarsPartials from "../handlebars/handlebars-partials";
|
||||||
import { getGame } from "../helpers";
|
import { getGame } from "../helpers";
|
||||||
import { DS4Item } from "../item/item";
|
|
||||||
import { DS4ItemSheet } from "../item/item-sheet";
|
import { DS4ItemSheet } from "../item/item-sheet";
|
||||||
|
import { DS4ItemProxy } from "../item/proxy";
|
||||||
import logger from "../logger";
|
import logger from "../logger";
|
||||||
import { macros } from "../macros/macros";
|
import { macros } from "../macros/macros";
|
||||||
import { migration } from "../migrations";
|
import { migration } from "../migrations";
|
||||||
|
@ -26,7 +25,9 @@ import { DS4Roll } from "../rolls/roll";
|
||||||
import registerSlayingDiceModifier from "../rolls/slaying-dice-modifier";
|
import registerSlayingDiceModifier from "../rolls/slaying-dice-modifier";
|
||||||
import { registerSystemSettings } from "../settings";
|
import { registerSystemSettings } from "../settings";
|
||||||
import { DS4TokenDocument } from "../token-document";
|
import { DS4TokenDocument } from "../token-document";
|
||||||
import { DS4ItemProxy } from "../item/proxy";
|
|
||||||
|
import type { DS4Actor } from "../actor/actor";
|
||||||
|
import type { DS4Item } from "../item/item";
|
||||||
|
|
||||||
export default function registerForInitHook(): void {
|
export default function registerForInitHook(): void {
|
||||||
Hooks.once("init", init);
|
Hooks.once("init", init);
|
||||||
|
|
|
@ -20,9 +20,7 @@ export default function registerForRenderHooks(): void {
|
||||||
* @param html - The {@link JQuery} representing the HTML of the application.
|
* @param html - The {@link JQuery} representing the HTML of the application.
|
||||||
*/
|
*/
|
||||||
function selectTargetInputOnFocus(app: Application, html: JQuery) {
|
function selectTargetInputOnFocus(app: Application, html: JQuery) {
|
||||||
$(html)
|
html.find("input").on("focus", (ev: JQuery.FocusEvent<HTMLInputElement>) => {
|
||||||
.find("input")
|
|
||||||
.on("focus", (ev: JQuery.FocusEvent<HTMLInputElement>) => {
|
|
||||||
ev.currentTarget.select();
|
ev.currentTarget.select();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4AlphabetDataSourceData } from "./alphabet-data-source";
|
import type { DS4AlphabetDataSourceData } from "./alphabet-data-source";
|
||||||
|
|
||||||
export interface DS4AlphabetDataProperties {
|
export interface DS4AlphabetDataProperties {
|
||||||
type: "alphabet";
|
type: "alphabet";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
import type { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
||||||
|
|
||||||
export interface DS4AlphabetDataSource {
|
export interface DS4AlphabetDataSource {
|
||||||
type: "alphabet";
|
type: "alphabet";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4ArmorDataSourceData } from "./armor-data-source";
|
import type { DS4ArmorDataSourceData } from "./armor-data-source";
|
||||||
|
|
||||||
export interface DS4ArmorDataProperties {
|
export interface DS4ArmorDataProperties {
|
||||||
type: "armor";
|
type: "armor";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4 } from "../../config";
|
import type { DS4 } from "../../config";
|
||||||
import {
|
import type {
|
||||||
DS4ItemDataSourceDataBase,
|
DS4ItemDataSourceDataBase,
|
||||||
DS4ItemDataSourceDataEquipable,
|
DS4ItemDataSourceDataEquipable,
|
||||||
DS4ItemDataSourceDataPhysical,
|
DS4ItemDataSourceDataPhysical,
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4EquipmentDataSourceData } from "./equipment-data-source";
|
import type { DS4EquipmentDataSourceData } from "./equipment-data-source";
|
||||||
|
|
||||||
export interface DS4EquipmentDataProperties {
|
export interface DS4EquipmentDataProperties {
|
||||||
type: "equipment";
|
type: "equipment";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import {
|
import type {
|
||||||
DS4ItemDataSourceDataBase,
|
DS4ItemDataSourceDataBase,
|
||||||
DS4ItemDataSourceDataEquipable,
|
DS4ItemDataSourceDataEquipable,
|
||||||
DS4ItemDataSourceDataPhysical,
|
DS4ItemDataSourceDataPhysical,
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4AlphabetDataProperties } from "./alphabet/alphabet-data-properties";
|
import type { DS4AlphabetDataProperties } from "./alphabet/alphabet-data-properties";
|
||||||
import { DS4ArmorDataProperties } from "./armor/armor-data-properties";
|
import type { DS4ArmorDataProperties } from "./armor/armor-data-properties";
|
||||||
import { DS4EquipmentDataProperties } from "./equipment/equipment-data-properties";
|
import type { DS4EquipmentDataProperties } from "./equipment/equipment-data-properties";
|
||||||
import { DS4LanguageDataProperties } from "./language/language-data-properties";
|
import type { DS4LanguageDataProperties } from "./language/language-data-properties";
|
||||||
import { DS4LootDataProperties } from "./loot/loot-data-properties";
|
import type { DS4LootDataProperties } from "./loot/loot-data-properties";
|
||||||
import { DS4RacialAbilityDataProperties } from "./racial-ability/racial-ability-data-properties";
|
import type { DS4RacialAbilityDataProperties } from "./racial-ability/racial-ability-data-properties";
|
||||||
import { DS4ShieldDataProperties } from "./shield/shield-data-properties";
|
import type { DS4ShieldDataProperties } from "./shield/shield-data-properties";
|
||||||
import { DS4SpecialCreatureAbilityDataProperties } from "./special-creature-ability/special-creature-ability-data-properties";
|
import type { DS4SpecialCreatureAbilityDataProperties } from "./special-creature-ability/special-creature-ability-data-properties";
|
||||||
import { DS4SpellDataProperties } from "./spell/spell-data-properties";
|
import type { DS4SpellDataProperties } from "./spell/spell-data-properties";
|
||||||
import { DS4TalentDataProperties } from "./talent/talent-data-properties";
|
import type { DS4TalentDataProperties } from "./talent/talent-data-properties";
|
||||||
import { DS4WeaponDataProperties } from "./weapon/weapon-data-properties";
|
import type { DS4WeaponDataProperties } from "./weapon/weapon-data-properties";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface DataConfig {
|
interface DataConfig {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4 } from "../config";
|
import type { DS4 } from "../config";
|
||||||
|
|
||||||
export interface DS4ItemDataSourceDataBase {
|
export interface DS4ItemDataSourceDataBase {
|
||||||
description: string;
|
description: string;
|
||||||
|
|
|
@ -2,18 +2,18 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4 } from "../config";
|
import type { DS4 } from "../config";
|
||||||
import { DS4AlphabetDataSource } from "./alphabet/alphabet-data-source";
|
import type { DS4AlphabetDataSource } from "./alphabet/alphabet-data-source";
|
||||||
import { DS4ArmorDataSource } from "./armor/armor-data-source";
|
import type { DS4ArmorDataSource } from "./armor/armor-data-source";
|
||||||
import { DS4EquipmentDataSource } from "./equipment/equipment-data-source";
|
import type { DS4EquipmentDataSource } from "./equipment/equipment-data-source";
|
||||||
import { DS4LanguageDataSource } from "./language/language-data-source";
|
import type { DS4LanguageDataSource } from "./language/language-data-source";
|
||||||
import { DS4LootDataSource } from "./loot/loot-data-source";
|
import type { DS4LootDataSource } from "./loot/loot-data-source";
|
||||||
import { DS4RacialAbilityDataSource } from "./racial-ability/racial-ability-data-source";
|
import type { DS4RacialAbilityDataSource } from "./racial-ability/racial-ability-data-source";
|
||||||
import { DS4ShieldDataSource } from "./shield/shield-data-source";
|
import type { DS4ShieldDataSource } from "./shield/shield-data-source";
|
||||||
import { DS4SpecialCreatureAbilityDataSource } from "./special-creature-ability/special-creature-ability-data-source";
|
import type { DS4SpecialCreatureAbilityDataSource } from "./special-creature-ability/special-creature-ability-data-source";
|
||||||
import { DS4SpellDataSource } from "./spell/spell-data-source";
|
import type { DS4SpellDataSource } from "./spell/spell-data-source";
|
||||||
import { DS4TalentDataSource } from "./talent/talent-data-source";
|
import type { DS4TalentDataSource } from "./talent/talent-data-source";
|
||||||
import { DS4WeaponDataSource } from "./weapon/weapon-data-source";
|
import type { DS4WeaponDataSource } from "./weapon/weapon-data-source";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface SourceConfig {
|
interface SourceConfig {
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { getGame } from "../helpers";
|
import { getGame } from "../helpers";
|
||||||
import { ItemType } from "./item-data-source";
|
|
||||||
|
import type { ItemType } from "./item-data-source";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface DocumentClassConfig {
|
interface DocumentClassConfig {
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4LanguageDataSourceData } from "./language-data-source";
|
import type { DS4LanguageDataSourceData } from "./language-data-source";
|
||||||
|
|
||||||
export interface DS4LanguageDataProperties {
|
export interface DS4LanguageDataProperties {
|
||||||
type: "language";
|
type: "language";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
import type { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
||||||
|
|
||||||
export interface DS4LanguageDataSource {
|
export interface DS4LanguageDataSource {
|
||||||
type: "language";
|
type: "language";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4LootDataSourceData } from "./loot-data-source";
|
import type { DS4LootDataSourceData } from "./loot-data-source";
|
||||||
|
|
||||||
export interface DS4LootDataProperties {
|
export interface DS4LootDataProperties {
|
||||||
type: "loot";
|
type: "loot";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataPhysical } from "../item-data-source-base";
|
import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataPhysical } from "../item-data-source-base";
|
||||||
|
|
||||||
export interface DS4LootDataSource {
|
export interface DS4LootDataSource {
|
||||||
type: "loot";
|
type: "loot";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4RacialAbilityDataSourceData } from "./racial-ability-data-source";
|
import type { DS4RacialAbilityDataSourceData } from "./racial-ability-data-source";
|
||||||
|
|
||||||
export interface DS4RacialAbilityDataProperties {
|
export interface DS4RacialAbilityDataProperties {
|
||||||
type: "racialAbility";
|
type: "racialAbility";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
import type { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
||||||
|
|
||||||
export interface DS4RacialAbilityDataSource {
|
export interface DS4RacialAbilityDataSource {
|
||||||
type: "racialAbility";
|
type: "racialAbility";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4ShieldDataSourceData } from "./shield-data-source";
|
import type { DS4ShieldDataSourceData } from "./shield-data-source";
|
||||||
|
|
||||||
export interface DS4ShieldDataProperties {
|
export interface DS4ShieldDataProperties {
|
||||||
type: "shield";
|
type: "shield";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import {
|
import type {
|
||||||
DS4ItemDataSourceDataBase,
|
DS4ItemDataSourceDataBase,
|
||||||
DS4ItemDataSourceDataEquipable,
|
DS4ItemDataSourceDataEquipable,
|
||||||
DS4ItemDataSourceDataPhysical,
|
DS4ItemDataSourceDataPhysical,
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4SpecialCreatureAbilityDataSourceData } from "./special-creature-ability-data-source";
|
import type { DS4SpecialCreatureAbilityDataSourceData } from "./special-creature-ability-data-source";
|
||||||
|
|
||||||
export interface DS4SpecialCreatureAbilityDataProperties {
|
export interface DS4SpecialCreatureAbilityDataProperties {
|
||||||
type: "specialCreatureAbility";
|
type: "specialCreatureAbility";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
import type { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
||||||
|
|
||||||
export interface DS4SpecialCreatureAbilityDataSource {
|
export interface DS4SpecialCreatureAbilityDataSource {
|
||||||
type: "specialCreatureAbility";
|
type: "specialCreatureAbility";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { CooldownDuration, DS4SpellDataSourceData } from "./spell-data-source";
|
import type { CooldownDuration, DS4SpellDataSourceData } from "./spell-data-source";
|
||||||
|
|
||||||
export function calculateSpellPrice(data: DS4SpellDataSourceData): number | null {
|
export function calculateSpellPrice(data: DS4SpellDataSourceData): number | null {
|
||||||
const spellPriceFactor = calculateSpellPriceFactor(data.cooldownDuration);
|
const spellPriceFactor = calculateSpellPriceFactor(data.cooldownDuration);
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4SpellDataSourceData } from "./spell-data-source";
|
import type { DS4SpellDataSourceData } from "./spell-data-source";
|
||||||
|
|
||||||
export interface DS4SpellDataProperties {
|
export interface DS4SpellDataProperties {
|
||||||
type: "spell";
|
type: "spell";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4 } from "../../config";
|
import type { DS4 } from "../../config";
|
||||||
import { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable } from "../item-data-source-base";
|
import type { DS4ItemDataSourceDataBase, DS4ItemDataSourceDataEquipable } from "../item-data-source-base";
|
||||||
|
|
||||||
export interface DS4SpellDataSource {
|
export interface DS4SpellDataSource {
|
||||||
type: "spell";
|
type: "spell";
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { ModifiableDataBaseTotalMax } from "../../common/common-data";
|
import type { ModifiableDataBaseTotalMax } from "../../common/common-data";
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4TalentDataSourceData } from "./talent-data-source";
|
import type { DS4TalentDataSourceData } from "./talent-data-source";
|
||||||
|
|
||||||
export interface DS4TalentDataProperties {
|
export interface DS4TalentDataProperties {
|
||||||
type: "talent";
|
type: "talent";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { ModifiableDataBaseMax } from "../../common/common-data";
|
import type { ModifiableDataBaseMax } from "../../common/common-data";
|
||||||
import { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
import type { DS4ItemDataSourceDataBase } from "../item-data-source-base";
|
||||||
|
|
||||||
export interface DS4TalentDataSource {
|
export interface DS4TalentDataSource {
|
||||||
type: "talent";
|
type: "talent";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
import type { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||||
import { DS4WeaponDataSourceData } from "./weapon-data-source";
|
import type { DS4WeaponDataSourceData } from "./weapon-data-source";
|
||||||
|
|
||||||
interface DS4WeaponDataPropertiesData extends DS4WeaponDataSourceData, DS4ItemDataPropertiesDataRollable {}
|
interface DS4WeaponDataPropertiesData extends DS4WeaponDataSourceData, DS4ItemDataPropertiesDataRollable {}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4 } from "../../config";
|
import type { DS4 } from "../../config";
|
||||||
import {
|
import type {
|
||||||
DS4ItemDataSourceDataBase,
|
DS4ItemDataSourceDataBase,
|
||||||
DS4ItemDataSourceDataEquipable,
|
DS4ItemDataSourceDataEquipable,
|
||||||
DS4ItemDataSourceDataPhysical,
|
DS4ItemDataSourceDataPhysical,
|
||||||
|
|
|
@ -7,7 +7,8 @@ import { getGame } from "../../helpers";
|
||||||
import { createCheckRoll } from "../../rolls/check-factory";
|
import { createCheckRoll } from "../../rolls/check-factory";
|
||||||
import notifications from "../../ui/notifications";
|
import notifications from "../../ui/notifications";
|
||||||
import { DS4Item } from "../item";
|
import { DS4Item } from "../item";
|
||||||
import { AttackType } from "./weapon-data-source";
|
|
||||||
|
import type { AttackType } from "./weapon-data-source";
|
||||||
|
|
||||||
export class DS4Weapon extends DS4Item {
|
export class DS4Weapon extends DS4Item {
|
||||||
/** @override */
|
/** @override */
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { DS4Actor } from "../actor/actor";
|
|
||||||
import { getCanvas, getGame } from "../helpers";
|
import { getCanvas, getGame } from "../helpers";
|
||||||
|
|
||||||
|
import type { DS4Actor } from "../actor/actor";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the currently active actor and token based on how {@link ChatMessage}
|
* Gets the currently active actor and token based on how {@link ChatMessage}
|
||||||
* determines the current speaker.
|
* determines the current speaker.
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import { Check } from "../actor/actor-data-properties-base";
|
|
||||||
import { DS4 } from "../config";
|
import { DS4 } from "../config";
|
||||||
import { getGame } from "../helpers";
|
import { getGame } from "../helpers";
|
||||||
import notifications from "../ui/notifications";
|
import notifications from "../ui/notifications";
|
||||||
import { getActiveActorAndToken } from "./helpers";
|
import { getActiveActorAndToken } from "./helpers";
|
||||||
|
|
||||||
|
import type { Check } from "../actor/actor-data-properties-base";
|
||||||
/**
|
/**
|
||||||
* Creates a macro from a check drop.
|
* Creates a macro from a check drop.
|
||||||
* Get an existing roll check macro if one exists, otherwise create a new one.
|
* Get an existing roll check macro if one exists, otherwise create a new one.
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"resolveJsonModule": true
|
"resolveJsonModule": true,
|
||||||
|
"importsNotUsedAsValues": "error"
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue