@league-of-foundry-developers/foundry-vtt-types 9.249.0 → 9.249.4
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.
- package/package.json +2 -2
- package/src/foundry/common/abstract/data.mjs.d.ts +2 -2
- package/src/foundry/common/abstract/document.mjs.d.ts +20 -9
- package/src/foundry/common/config.mjs/releaseData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/actorData.d.ts +1 -1
- package/src/foundry/common/data/data.mjs/adventureData.d.ts +14 -12
- package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +5 -3
- package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +62 -16
- package/src/foundry/common/data/data.mjs/animationData.d.ts +13 -5
- package/src/foundry/common/data/data.mjs/cardData.d.ts +4 -4
- package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +5 -3
- package/src/foundry/common/data/data.mjs/cardsData.d.ts +3 -3
- package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/combatData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/combatantData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/drawingData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/folderData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/lightData.d.ts +7 -5
- package/src/foundry/common/data/data.mjs/macroData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/noteData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/playlistData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +6 -4
- package/src/foundry/common/data/data.mjs/rollTableData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/sceneData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/settingData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/tableResultData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/tileData.d.ts +4 -2
- package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +4 -2
- package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +4 -2
- package/src/foundry/common/data/data.mjs/tokenData.d.ts +5 -3
- package/src/foundry/common/data/data.mjs/userData.d.ts +3 -1
- package/src/foundry/common/data/data.mjs/videoData.d.ts +4 -2
- package/src/foundry/common/data/data.mjs/wallData.d.ts +4 -2
- package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +15 -12
- package/src/foundry/common/documents.mjs/baseActor.d.ts +24 -21
- package/src/foundry/common/documents.mjs/baseAdventure.d.ts +14 -12
- package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +14 -11
- package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +14 -11
- package/src/foundry/common/documents.mjs/baseCard.d.ts +27 -28
- package/src/foundry/common/documents.mjs/baseCards.d.ts +18 -16
- package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +24 -17
- package/src/foundry/common/documents.mjs/baseCombat.d.ts +21 -20
- package/src/foundry/common/documents.mjs/baseCombatant.d.ts +25 -18
- package/src/foundry/common/documents.mjs/baseDrawing.d.ts +26 -23
- package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +19 -17
- package/src/foundry/common/documents.mjs/baseFolder.d.ts +14 -12
- package/src/foundry/common/documents.mjs/baseItem.d.ts +25 -19
- package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +16 -14
- package/src/foundry/common/documents.mjs/baseMacro.d.ts +21 -18
- package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +34 -18
- package/src/foundry/common/documents.mjs/baseNote.d.ts +20 -14
- package/src/foundry/common/documents.mjs/basePlaylist.d.ts +16 -14
- package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +14 -11
- package/src/foundry/common/documents.mjs/baseRollTable.d.ts +16 -14
- package/src/foundry/common/documents.mjs/baseScene.d.ts +23 -21
- package/src/foundry/common/documents.mjs/baseSetting.d.ts +18 -16
- package/src/foundry/common/documents.mjs/baseTableResult.d.ts +27 -19
- package/src/foundry/common/documents.mjs/baseTile.d.ts +17 -11
- package/src/foundry/common/documents.mjs/baseToken.d.ts +20 -16
- package/src/foundry/common/documents.mjs/baseUser.d.ts +45 -11
- package/src/foundry/common/documents.mjs/baseWall.d.ts +17 -15
- package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +3 -1
- package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +4 -2
- package/src/foundry/common/packages.mjs/packageData.d.ts +3 -4
- package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +3 -1
- package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +3 -1
- package/src/foundry/common/utils/primitives.mjs.d.ts +1 -1
- package/src/foundry/foundry.js/application.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +1 -1
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +1 -1
- package/src/foundry/foundry.js/avSettings.d.ts +11 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +36 -34
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/combat.d.ts +5 -5
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +2 -2
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +39 -38
- package/src/foundry/foundry.js/clientDocuments/user.d.ts +27 -35
- package/src/foundry/foundry.js/clientSettings.d.ts +1 -1
- package/src/foundry/foundry.js/collections/documentCollection.d.ts +65 -11
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +78 -67
- package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +73 -32
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/actors.d.ts +3 -37
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/combatEncounters.d.ts +5 -2
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/fogExplorations.d.ts +0 -2
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/folders.d.ts +1 -1
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/items.d.ts +1 -22
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/journal.d.ts +1 -1
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/macros.d.ts +3 -8
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/messages.d.ts +7 -2
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +5 -5
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/rollTables.d.ts +1 -1
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/scenes.d.ts +3 -2
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/users.d.ts +7 -4
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/worldSettings.d.ts +2 -2
- package/src/foundry/foundry.js/hooks.d.ts +3 -3
- package/src/foundry/foundry.js/pixi/containers/ruler.d.ts +18 -7
- package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +1 -1
- package/src/foundry/foundry.js/pointSources/lightSource.d.ts +1 -1
- package/src/foundry/foundry.js/pointSources/soundSource.d.ts +1 -1
- package/src/foundry/foundry.js/pointSources/visionSource.d.ts +1 -1
- package/src/foundry/foundry.js/polygonEdge.d.ts +1 -1
- package/src/foundry/foundry.js/ray.d.ts +1 -1
- package/src/types/helperTypes.d.ts +31 -13
@@ -4,25 +4,28 @@ import { Document } from '../abstract/module.mjs';
|
|
4
4
|
import * as data from '../data/data.mjs';
|
5
5
|
import { BaseScene } from './baseScene';
|
6
6
|
|
7
|
+
type AmbientSoundMetadata = Merge<
|
8
|
+
DocumentMetadata,
|
9
|
+
{
|
10
|
+
name: 'AmbientSound';
|
11
|
+
collection: 'sounds';
|
12
|
+
label: 'DOCUMENT.AmbientSound';
|
13
|
+
labelPlural: 'DOCUMENT.AmbientSounds';
|
14
|
+
isEmbedded: true;
|
15
|
+
}
|
16
|
+
>;
|
17
|
+
|
7
18
|
/**
|
8
19
|
* The base AmbientSound model definition which defines common behavior of an AmbientSound document between both client and server.
|
9
20
|
*/
|
10
21
|
export declare class BaseAmbientSound extends Document<
|
11
22
|
data.AmbientSoundData,
|
12
|
-
InstanceType<ConfiguredDocumentClass<typeof BaseScene
|
23
|
+
InstanceType<ConfiguredDocumentClass<typeof BaseScene>>,
|
24
|
+
AmbientSoundMetadata
|
13
25
|
> {
|
14
26
|
/** @override */
|
15
27
|
static get schema(): typeof data.AmbientSoundData;
|
16
28
|
|
17
29
|
/** @override */
|
18
|
-
static get metadata():
|
19
|
-
DocumentMetadata,
|
20
|
-
{
|
21
|
-
name: 'AmbientSound';
|
22
|
-
collection: 'sounds';
|
23
|
-
label: 'DOCUMENT.AmbientSound';
|
24
|
-
labelPlural: 'DOCUMENT.AmbientSounds';
|
25
|
-
isEmbedded: true;
|
26
|
-
}
|
27
|
-
>;
|
30
|
+
static get metadata(): AmbientSoundMetadata;
|
28
31
|
}
|
@@ -1,57 +1,56 @@
|
|
1
1
|
import { ConfiguredDocumentClass } from '../../../types/helperTypes';
|
2
|
-
import { DocumentMetadata
|
2
|
+
import { DocumentMetadata } from '../abstract/document.mjs';
|
3
3
|
import { Document } from '../abstract/module.mjs';
|
4
4
|
import * as data from '../data/data.mjs';
|
5
|
-
import type { CardDataConstructorData } from '../data/data.mjs/cardData
|
5
|
+
import type { CardDataConstructorData, CardDataSource } from '../data/data.mjs/cardData';
|
6
6
|
import { BaseCards } from './baseCards';
|
7
7
|
import { BaseUser } from './baseUser';
|
8
8
|
|
9
|
+
type CardMetadata = Merge<
|
10
|
+
DocumentMetadata,
|
11
|
+
{
|
12
|
+
name: 'Card';
|
13
|
+
collection: 'cards';
|
14
|
+
label: 'DOCUMENT.Card';
|
15
|
+
labelPlural: 'DOCUMENT.Cards';
|
16
|
+
isEmbedded: true;
|
17
|
+
types: string[];
|
18
|
+
hasSystemData: true;
|
19
|
+
permissions: {
|
20
|
+
create: (user: BaseUser, doc: BaseCard, data: CardDataSource) => boolean;
|
21
|
+
update: (user: BaseUser, doc: BaseCard, data: DeepPartial<CardDataConstructorData>) => boolean;
|
22
|
+
};
|
23
|
+
}
|
24
|
+
>;
|
25
|
+
|
9
26
|
/**
|
10
27
|
* The base Card definition which defines common behavior of an embedded Card document shared by both client and server.
|
11
28
|
*/
|
12
|
-
export declare class BaseCard extends Document<
|
29
|
+
export declare class BaseCard extends Document<
|
30
|
+
data.CardData,
|
31
|
+
InstanceType<ConfiguredDocumentClass<typeof BaseCards>>,
|
32
|
+
CardMetadata
|
33
|
+
> {
|
13
34
|
/** @override */
|
14
35
|
static get schema(): typeof data.CardData;
|
15
36
|
|
16
37
|
/** @override */
|
17
|
-
static get metadata():
|
18
|
-
DocumentMetadata,
|
19
|
-
{
|
20
|
-
name: 'Card';
|
21
|
-
collection: 'cards';
|
22
|
-
label: 'DOCUMENT.Card';
|
23
|
-
labelPlural: 'DOCUMENT.Cards';
|
24
|
-
isEmbedded: true;
|
25
|
-
types: string[];
|
26
|
-
hasSystemData: true;
|
27
|
-
permissions: {
|
28
|
-
create: typeof BaseCard['_canCreate'];
|
29
|
-
update: typeof BaseCard['_canUpdate'];
|
30
|
-
};
|
31
|
-
}
|
32
|
-
>;
|
38
|
+
static get metadata(): CardMetadata;
|
33
39
|
|
34
40
|
/**
|
35
41
|
* The sub-type of Card.
|
36
42
|
*/
|
37
43
|
get type(): data.CardData['type'];
|
38
44
|
|
39
|
-
/** @override */
|
40
|
-
protected _preCreate(
|
41
|
-
data: CardDataConstructorData,
|
42
|
-
options: DocumentModificationOptions,
|
43
|
-
user: BaseUser
|
44
|
-
): Promise<void>;
|
45
|
-
|
46
45
|
/**
|
47
46
|
* Is a User able to create a new embedded Card document within this parent?
|
48
47
|
*/
|
49
|
-
protected static _canCreate(user: BaseUser, doc: BaseCard, data
|
48
|
+
protected static _canCreate(user: BaseUser, doc: BaseCard, data: CardDataSource): boolean;
|
50
49
|
|
51
50
|
/**
|
52
51
|
* Is a user able to update an existing Card?
|
53
52
|
*/
|
54
|
-
protected static _canUpdate(user: BaseUser, doc: BaseCard, data
|
53
|
+
protected static _canUpdate(user: BaseUser, doc: BaseCard, data: DeepPartial<CardDataConstructorData>): boolean;
|
55
54
|
|
56
55
|
/** @override */
|
57
56
|
testUserPermission(
|
@@ -3,29 +3,31 @@ import { Document } from '../abstract/module.mjs';
|
|
3
3
|
import * as data from '../data/data.mjs';
|
4
4
|
import { BaseCard } from './baseCard';
|
5
5
|
|
6
|
+
type CardsMetadata = Merge<
|
7
|
+
DocumentMetadata,
|
8
|
+
{
|
9
|
+
name: 'Cards';
|
10
|
+
collection: 'cards';
|
11
|
+
label: 'DOCUMENT.Cards';
|
12
|
+
labelPlural: 'DOCUMENT.CardsPlural';
|
13
|
+
isPrimary: true;
|
14
|
+
types: string[];
|
15
|
+
hasSystemData: true;
|
16
|
+
embedded: {
|
17
|
+
Card: typeof BaseCard;
|
18
|
+
};
|
19
|
+
}
|
20
|
+
>;
|
21
|
+
|
6
22
|
/**
|
7
23
|
* The base Cards definition which defines common behavior of an Cards document shared by both client and server.
|
8
24
|
*/
|
9
|
-
export declare class BaseCards extends Document<data.CardsData> {
|
25
|
+
export declare class BaseCards extends Document<data.CardsData, null, CardsMetadata> {
|
10
26
|
/** @override */
|
11
27
|
static get schema(): typeof data.CardsData;
|
12
28
|
|
13
29
|
/** @override */
|
14
|
-
static get metadata():
|
15
|
-
DocumentMetadata,
|
16
|
-
{
|
17
|
-
name: 'Cards';
|
18
|
-
collection: 'cards';
|
19
|
-
label: 'DOCUMENT.Cards';
|
20
|
-
labelPlural: 'DOCUMENT.CardsPlural';
|
21
|
-
isPrimary: true;
|
22
|
-
types: string[];
|
23
|
-
hasSystemData: true;
|
24
|
-
embedded: {
|
25
|
-
Card: typeof BaseCard;
|
26
|
-
};
|
27
|
-
}
|
28
|
-
>;
|
30
|
+
static get metadata(): CardsMetadata;
|
29
31
|
|
30
32
|
/**
|
31
33
|
* A reference to the Collection of Card documents contained within this Cards stack, indexed by _id.
|
@@ -2,30 +2,33 @@ import { DocumentMetadata } from '../abstract/document.mjs';
|
|
2
2
|
import { Document } from '../abstract/module.mjs';
|
3
3
|
import { BaseUser } from './baseUser';
|
4
4
|
import * as data from '../data/data.mjs';
|
5
|
+
import type { ChatMessageDataConstructorData } from '../data/data.mjs/chatMessageData';
|
6
|
+
|
7
|
+
type ChatMessageMetadata = Merge<
|
8
|
+
DocumentMetadata,
|
9
|
+
{
|
10
|
+
name: 'ChatMessage';
|
11
|
+
collection: 'messages';
|
12
|
+
label: 'DOCUMENT.ChatMessage';
|
13
|
+
labelPlural: 'DOCUMENT.ChatMessages';
|
14
|
+
isPrimary: true;
|
15
|
+
permissions: {
|
16
|
+
create: (user: BaseUser, doc: BaseChatMessage) => boolean;
|
17
|
+
update: (user: BaseUser, doc: BaseChatMessage, data?: object) => boolean;
|
18
|
+
delete: (user: BaseUser, doc: BaseChatMessage) => boolean;
|
19
|
+
};
|
20
|
+
}
|
21
|
+
>;
|
5
22
|
|
6
23
|
/**
|
7
24
|
* The base ChatMessage model definition which defines common behavior of an ChatMessage document between both client and server.
|
8
25
|
*/
|
9
|
-
export declare class BaseChatMessage extends Document<data.ChatMessageData, null> {
|
26
|
+
export declare class BaseChatMessage extends Document<data.ChatMessageData, null, ChatMessageMetadata> {
|
10
27
|
/** @override */
|
11
28
|
static get schema(): typeof data.ChatMessageData;
|
12
29
|
|
13
30
|
/** @override */
|
14
|
-
static get metadata():
|
15
|
-
DocumentMetadata,
|
16
|
-
{
|
17
|
-
name: 'ChatMessage';
|
18
|
-
collection: 'messages';
|
19
|
-
label: 'DOCUMENT.ChatMessage';
|
20
|
-
labelPlural: 'DOCUMENT.ChatMessages';
|
21
|
-
isPrimary: true;
|
22
|
-
permissions: {
|
23
|
-
create: (user: BaseUser, doc: BaseChatMessage) => boolean;
|
24
|
-
update: (user: BaseUser, doc: BaseChatMessage, data?: object) => boolean;
|
25
|
-
delete: (user: BaseUser, doc: BaseChatMessage) => boolean;
|
26
|
-
};
|
27
|
-
}
|
28
|
-
>;
|
31
|
+
static get metadata(): ChatMessageMetadata;
|
29
32
|
|
30
33
|
/**
|
31
34
|
* Is a user able to create a new chat message?
|
@@ -35,7 +38,11 @@ export declare class BaseChatMessage extends Document<data.ChatMessageData, null
|
|
35
38
|
/**
|
36
39
|
* Is a user able to update an existing chat message?
|
37
40
|
*/
|
38
|
-
protected static _canUpdate(
|
41
|
+
protected static _canUpdate(
|
42
|
+
user: BaseUser,
|
43
|
+
doc: BaseChatMessage,
|
44
|
+
data: DeepPartial<ChatMessageDataConstructorData>
|
45
|
+
): boolean;
|
39
46
|
|
40
47
|
/**
|
41
48
|
* Is a user able to delete an existing chat message?
|
@@ -1,41 +1,42 @@
|
|
1
1
|
import { DocumentMetadata } from '../abstract/document.mjs';
|
2
2
|
import { Document } from '../abstract/module.mjs';
|
3
|
-
import type { CombatDataConstructorData } from '../data/data.mjs/combatData
|
3
|
+
import type { CombatDataConstructorData } from '../data/data.mjs/combatData';
|
4
4
|
import { data } from '../module.mjs';
|
5
5
|
import { BaseCombatant } from './baseCombatant';
|
6
6
|
import { BaseUser } from './baseUser';
|
7
7
|
|
8
|
+
type CombatMetadata = Merge<
|
9
|
+
DocumentMetadata,
|
10
|
+
{
|
11
|
+
name: 'Combat';
|
12
|
+
collection: 'combats';
|
13
|
+
label: 'DOCUMENT.Combat';
|
14
|
+
labelPlural: 'DOCUMENT.Combats';
|
15
|
+
embedded: {
|
16
|
+
Combatant: typeof BaseCombatant;
|
17
|
+
};
|
18
|
+
isPrimary: true;
|
19
|
+
permissions: {
|
20
|
+
update: (user: BaseUser, doc: BaseCombat, data: DeepPartial<CombatDataConstructorData>) => boolean;
|
21
|
+
};
|
22
|
+
}
|
23
|
+
>;
|
24
|
+
|
8
25
|
/**
|
9
26
|
* The base Combat model definition which defines common behavior of an Combat document between both client and server.
|
10
27
|
*/
|
11
|
-
export declare class BaseCombat extends Document<data.CombatData> {
|
28
|
+
export declare class BaseCombat extends Document<data.CombatData, null, CombatMetadata> {
|
12
29
|
/** @override */
|
13
30
|
static get schema(): typeof data.CombatData;
|
14
31
|
|
15
32
|
/** @override */
|
16
|
-
static get metadata():
|
17
|
-
DocumentMetadata,
|
18
|
-
{
|
19
|
-
name: 'Combat';
|
20
|
-
collection: 'combats';
|
21
|
-
label: 'DOCUMENT.Combat';
|
22
|
-
labelPlural: 'DOCUMENT.Combats';
|
23
|
-
embedded: {
|
24
|
-
Combatant: typeof BaseCombatant;
|
25
|
-
};
|
26
|
-
isPrimary: true;
|
27
|
-
permissions: {
|
28
|
-
update: typeof BaseCombat._canUpdate;
|
29
|
-
};
|
30
|
-
}
|
31
|
-
>;
|
33
|
+
static get metadata(): CombatMetadata;
|
32
34
|
|
33
35
|
/** A reference to the Collection of Combatant instances in the Combat document, indexed by id. */
|
34
36
|
get combatants(): this['data']['combatants'];
|
35
37
|
|
36
38
|
/**
|
37
39
|
* Is a user able to update an existing Combat?
|
38
|
-
* @param doc - (unused)
|
39
40
|
*/
|
40
|
-
protected static _canUpdate(user: BaseUser, doc: BaseCombat, data
|
41
|
+
protected static _canUpdate(user: BaseUser, doc: BaseCombat, data: DeepPartial<CombatDataConstructorData>): boolean;
|
41
42
|
}
|
@@ -1,43 +1,50 @@
|
|
1
1
|
import { ConfiguredDocumentClass } from '../../../types/helperTypes';
|
2
2
|
import { DocumentMetadata } from '../abstract/document.mjs';
|
3
3
|
import { Document } from '../abstract/module.mjs';
|
4
|
-
import type { CombatantDataConstructorData } from '../data/data.mjs/combatantData
|
4
|
+
import type { CombatantDataConstructorData, CombatantDataSource } from '../data/data.mjs/combatantData';
|
5
5
|
import { data } from '../module.mjs';
|
6
6
|
import { BaseCombat } from './baseCombat';
|
7
7
|
import { BaseUser } from './baseUser';
|
8
8
|
|
9
|
+
type CombatantMetadata = Merge<
|
10
|
+
DocumentMetadata,
|
11
|
+
{
|
12
|
+
name: 'Combatant';
|
13
|
+
collection: 'combatants';
|
14
|
+
label: 'DOCUMENT.Combatant';
|
15
|
+
isEmbedded: true;
|
16
|
+
labelPlural: 'DOCUMENT.Combatants';
|
17
|
+
permissions: {
|
18
|
+
create: (user: BaseUser, doc: BaseCombatant, data: CombatantDataSource) => boolean;
|
19
|
+
update: (user: BaseUser, doc: BaseCombatant, data: DeepPartial<CombatantDataConstructorData>) => boolean;
|
20
|
+
};
|
21
|
+
}
|
22
|
+
>;
|
23
|
+
|
9
24
|
/**
|
10
25
|
* The base Combatant model definition which defines common behavior of an Combatant document between both client and server.
|
11
26
|
*/
|
12
27
|
export declare class BaseCombatant extends Document<
|
13
28
|
data.CombatantData,
|
14
|
-
InstanceType<ConfiguredDocumentClass<typeof BaseCombat
|
29
|
+
InstanceType<ConfiguredDocumentClass<typeof BaseCombat>>,
|
30
|
+
CombatantMetadata
|
15
31
|
> {
|
16
32
|
/** @override */
|
17
33
|
static get schema(): typeof data.CombatantData;
|
18
34
|
|
19
35
|
/** @override */
|
20
|
-
static get metadata():
|
21
|
-
DocumentMetadata,
|
22
|
-
{
|
23
|
-
name: 'Combatant';
|
24
|
-
collection: 'combatants';
|
25
|
-
label: 'DOCUMENT.Combatant';
|
26
|
-
isEmbedded: true;
|
27
|
-
labelPlural: 'DOCUMENT.Combatants';
|
28
|
-
permissions: {
|
29
|
-
create: typeof BaseCombatant._canCreate;
|
30
|
-
update: typeof BaseCombatant._canUpdate;
|
31
|
-
};
|
32
|
-
}
|
33
|
-
>;
|
36
|
+
static get metadata(): CombatantMetadata;
|
34
37
|
|
35
38
|
/**
|
36
39
|
* Is a user able to update an existing Combatant?
|
37
40
|
* @remarks doc seems unused
|
38
41
|
*/
|
39
|
-
protected static _canUpdate(
|
42
|
+
protected static _canUpdate(
|
43
|
+
user: BaseUser,
|
44
|
+
doc: BaseCombatant,
|
45
|
+
data: DeepPartial<CombatantDataConstructorData>
|
46
|
+
): boolean;
|
40
47
|
|
41
48
|
/** Is a user able to create this Combatant? */
|
42
|
-
protected static _canCreate(user: BaseUser, doc: BaseCombatant, data
|
49
|
+
protected static _canCreate(user: BaseUser, doc: BaseCombatant, data: CombatantDataSource): boolean;
|
43
50
|
}
|
@@ -6,39 +6,42 @@ import type { CONST } from '../module.mjs';
|
|
6
6
|
import { BaseScene } from './baseScene';
|
7
7
|
import { BaseUser } from './baseUser';
|
8
8
|
|
9
|
+
type DrawingMetadata = Merge<
|
10
|
+
DocumentMetadata,
|
11
|
+
{
|
12
|
+
name: 'Drawing';
|
13
|
+
collection: 'drawings';
|
14
|
+
label: 'DOCUMENT.Drawing';
|
15
|
+
labelPlural: 'DOCUMENT.Drawings';
|
16
|
+
isEmbedded: true;
|
17
|
+
types: [
|
18
|
+
typeof CONST.DRAWING_TYPES.RECTANGLE,
|
19
|
+
typeof CONST.DRAWING_TYPES.ELLIPSE,
|
20
|
+
typeof CONST.DRAWING_TYPES.TEXT,
|
21
|
+
typeof CONST.DRAWING_TYPES.POLYGON,
|
22
|
+
typeof CONST.DRAWING_TYPES.FREEHAND
|
23
|
+
];
|
24
|
+
permissions: {
|
25
|
+
create: 'DRAWING_CREATE';
|
26
|
+
update: (user: BaseUser, doc: BaseDrawing, data?: object) => boolean;
|
27
|
+
delete: (user: BaseUser, doc: BaseDrawing, data?: object) => boolean;
|
28
|
+
};
|
29
|
+
}
|
30
|
+
>;
|
31
|
+
|
9
32
|
/**
|
10
33
|
* The base Drawing model definition which defines common behavior of an Drawing document between both client and server.
|
11
34
|
*/
|
12
35
|
export declare class BaseDrawing extends Document<
|
13
36
|
data.DrawingData,
|
14
|
-
InstanceType<ConfiguredDocumentClass<typeof BaseScene
|
37
|
+
InstanceType<ConfiguredDocumentClass<typeof BaseScene>>,
|
38
|
+
DrawingMetadata
|
15
39
|
> {
|
16
40
|
/** @override */
|
17
41
|
static get schema(): typeof data.DrawingData;
|
18
42
|
|
19
43
|
/** @override */
|
20
|
-
static get metadata():
|
21
|
-
DocumentMetadata,
|
22
|
-
{
|
23
|
-
name: 'Drawing';
|
24
|
-
collection: 'drawings';
|
25
|
-
label: 'DOCUMENT.Drawing';
|
26
|
-
labelPlural: 'DOCUMENT.Drawings';
|
27
|
-
isEmbedded: true;
|
28
|
-
types: [
|
29
|
-
typeof CONST.DRAWING_TYPES.RECTANGLE,
|
30
|
-
typeof CONST.DRAWING_TYPES.ELLIPSE,
|
31
|
-
typeof CONST.DRAWING_TYPES.TEXT,
|
32
|
-
typeof CONST.DRAWING_TYPES.POLYGON,
|
33
|
-
typeof CONST.DRAWING_TYPES.FREEHAND
|
34
|
-
];
|
35
|
-
permissions: {
|
36
|
-
create: 'DRAWING_CREATE';
|
37
|
-
update: (user: BaseUser, doc: BaseDrawing, data?: object) => boolean;
|
38
|
-
delete: (user: BaseUser, doc: BaseDrawing, data?: object) => boolean;
|
39
|
-
};
|
40
|
-
}
|
41
|
-
>;
|
44
|
+
static get metadata(): DrawingMetadata;
|
42
45
|
|
43
46
|
/** @override */
|
44
47
|
testUserPermission(
|
@@ -1,32 +1,34 @@
|
|
1
1
|
import { DocumentMetadata, DocumentModificationOptions } from '../abstract/document.mjs';
|
2
2
|
import { Document } from '../abstract/module.mjs';
|
3
3
|
import * as data from '../data/data.mjs';
|
4
|
-
import type { FogExplorationDataConstructorData } from '../data/data.mjs/fogExplorationData
|
4
|
+
import type { FogExplorationDataConstructorData } from '../data/data.mjs/fogExplorationData';
|
5
5
|
import { BaseUser } from './baseUser';
|
6
6
|
|
7
|
+
type FogExplorationMetadata = Merge<
|
8
|
+
DocumentMetadata,
|
9
|
+
{
|
10
|
+
name: 'FogExploration';
|
11
|
+
collection: 'fog';
|
12
|
+
label: 'DOCUMENT.FogExploration';
|
13
|
+
labelPlural: 'DOCUMENT.FogExplorations';
|
14
|
+
isPrimary: true;
|
15
|
+
permissions: {
|
16
|
+
create: 'PLAYER';
|
17
|
+
update: (user: BaseUser, doc: BaseFogExploration) => boolean;
|
18
|
+
delete: (user: BaseUser, doc: BaseFogExploration) => boolean;
|
19
|
+
};
|
20
|
+
}
|
21
|
+
>;
|
22
|
+
|
7
23
|
/**
|
8
24
|
* The base FogExploration model definition which defines common behavior of an FogExploration document between both client and server.
|
9
25
|
*/
|
10
|
-
export declare class BaseFogExploration extends Document<data.FogExplorationData> {
|
26
|
+
export declare class BaseFogExploration extends Document<data.FogExplorationData, null, FogExplorationMetadata> {
|
11
27
|
/** @override */
|
12
28
|
static get schema(): typeof data.FogExplorationData;
|
13
29
|
|
14
30
|
/** @override */
|
15
|
-
static get metadata():
|
16
|
-
DocumentMetadata,
|
17
|
-
{
|
18
|
-
name: 'FogExploration';
|
19
|
-
collection: 'fog';
|
20
|
-
label: 'DOCUMENT.FogExploration';
|
21
|
-
labelPlural: 'DOCUMENT.FogExplorations';
|
22
|
-
isPrimary: true;
|
23
|
-
permissions: {
|
24
|
-
create: 'PLAYER';
|
25
|
-
update: typeof BaseFogExploration._canUserModify;
|
26
|
-
delete: typeof BaseFogExploration._canUserModify;
|
27
|
-
};
|
28
|
-
}
|
29
|
-
>;
|
31
|
+
static get metadata(): FogExplorationMetadata;
|
30
32
|
|
31
33
|
/** @override */
|
32
34
|
protected _preUpdate(
|
@@ -3,25 +3,27 @@ import { Document } from '../abstract/module.mjs';
|
|
3
3
|
import { DocumentMetadata } from '../abstract/document.mjs';
|
4
4
|
import * as CONST from '../constants.mjs';
|
5
5
|
|
6
|
+
type FolderMetadata = Merge<
|
7
|
+
DocumentMetadata,
|
8
|
+
{
|
9
|
+
name: 'Folder';
|
10
|
+
collection: 'folders';
|
11
|
+
label: 'DOCUMENT.Folder';
|
12
|
+
labelPlural: 'DOCUMENT.Folders';
|
13
|
+
isPrimary: true;
|
14
|
+
types: typeof CONST.FOLDER_DOCUMENT_TYPES;
|
15
|
+
}
|
16
|
+
>;
|
17
|
+
|
6
18
|
/**
|
7
19
|
* The base Folder model definition which defines common behavior of an Folder document between both client and server.
|
8
20
|
*/
|
9
|
-
export declare class BaseFolder extends Document<data.FolderData, BaseFolder> {
|
21
|
+
export declare class BaseFolder extends Document<data.FolderData, BaseFolder, FolderMetadata> {
|
10
22
|
/** @override */
|
11
23
|
static get schema(): typeof data.FolderData;
|
12
24
|
|
13
25
|
/** @override */
|
14
|
-
static get metadata():
|
15
|
-
DocumentMetadata,
|
16
|
-
{
|
17
|
-
name: 'Folder';
|
18
|
-
collection: 'folders';
|
19
|
-
label: 'DOCUMENT.Folder';
|
20
|
-
labelPlural: 'DOCUMENT.Folders';
|
21
|
-
isPrimary: true;
|
22
|
-
types: typeof CONST.FOLDER_DOCUMENT_TYPES;
|
23
|
-
}
|
24
|
-
>;
|
26
|
+
static get metadata(): FolderMetadata;
|
25
27
|
|
26
28
|
/**
|
27
29
|
* The type of Document contained within this Folder.
|
@@ -6,32 +6,38 @@ import { BaseActiveEffect } from './baseActiveEffect';
|
|
6
6
|
import { BaseUser } from './baseUser';
|
7
7
|
import { ConfiguredDocumentClass } from '../../../types/helperTypes';
|
8
8
|
|
9
|
+
type ItemMetadata = Merge<
|
10
|
+
DocumentMetadata,
|
11
|
+
{
|
12
|
+
name: 'Item';
|
13
|
+
collection: 'items';
|
14
|
+
label: 'DOCUMENT.Item';
|
15
|
+
labelPlural: 'DOCUMENT.Items';
|
16
|
+
embedded: {
|
17
|
+
ActiveEffect: typeof BaseActiveEffect;
|
18
|
+
};
|
19
|
+
isPrimary: true;
|
20
|
+
hasSystemData: true;
|
21
|
+
types: string[];
|
22
|
+
permissions: {
|
23
|
+
create: 'ITEM_CREATE';
|
24
|
+
};
|
25
|
+
}
|
26
|
+
>;
|
27
|
+
|
9
28
|
/**
|
10
29
|
* The base Item model definition which defines common behavior of an Item document between both client and server.
|
11
30
|
*/
|
12
|
-
export declare class BaseItem extends Document<
|
31
|
+
export declare class BaseItem extends Document<
|
32
|
+
data.ItemData,
|
33
|
+
InstanceType<ConfiguredDocumentClass<typeof BaseActor>>,
|
34
|
+
ItemMetadata
|
35
|
+
> {
|
13
36
|
/** @override */
|
14
37
|
static get schema(): typeof data.ItemData;
|
15
38
|
|
16
39
|
/** @override */
|
17
|
-
static get metadata():
|
18
|
-
DocumentMetadata,
|
19
|
-
{
|
20
|
-
name: 'Item';
|
21
|
-
collection: 'items';
|
22
|
-
label: 'DOCUMENT.Item';
|
23
|
-
labelPlural: 'DOCUMENT.Items';
|
24
|
-
embedded: {
|
25
|
-
ActiveEffect: typeof BaseActiveEffect;
|
26
|
-
};
|
27
|
-
isPrimary: true;
|
28
|
-
hasSystemData: true;
|
29
|
-
types: string[];
|
30
|
-
permissions: {
|
31
|
-
create: 'ITEM_CREATE';
|
32
|
-
};
|
33
|
-
}
|
34
|
-
>;
|
40
|
+
static get metadata(): ItemMetadata;
|
35
41
|
|
36
42
|
/**
|
37
43
|
* A reference to the Collection of ActiveEffect instances in the Item document, indexed by _id.
|
@@ -2,25 +2,27 @@ import * as data from '../data/data.mjs';
|
|
2
2
|
import { Document } from '../abstract/module.mjs';
|
3
3
|
import { DocumentMetadata } from '../abstract/document.mjs';
|
4
4
|
|
5
|
+
type JournalEntryMetadata = Merge<
|
6
|
+
DocumentMetadata,
|
7
|
+
{
|
8
|
+
name: 'JournalEntry';
|
9
|
+
collection: 'journal';
|
10
|
+
label: 'DOCUMENT.JournalEntry';
|
11
|
+
labelPlural: 'DOCUMENT.JournalEntries';
|
12
|
+
isPrimary: true;
|
13
|
+
permissions: {
|
14
|
+
create: 'JOURNAL_CREATE';
|
15
|
+
};
|
16
|
+
}
|
17
|
+
>;
|
18
|
+
|
5
19
|
/**
|
6
20
|
* The base JournalEntry model definition which defines common behavior of an JournalEntry document between both client and server.
|
7
21
|
*/
|
8
|
-
export declare class BaseJournalEntry extends Document<data.JournalEntryData> {
|
22
|
+
export declare class BaseJournalEntry extends Document<data.JournalEntryData, null, JournalEntryMetadata> {
|
9
23
|
/** @override */
|
10
24
|
static get schema(): typeof data.JournalEntryData;
|
11
25
|
|
12
26
|
/** @override */
|
13
|
-
static get metadata():
|
14
|
-
DocumentMetadata,
|
15
|
-
{
|
16
|
-
name: 'JournalEntry';
|
17
|
-
collection: 'journal';
|
18
|
-
label: 'DOCUMENT.JournalEntry';
|
19
|
-
labelPlural: 'DOCUMENT.JournalEntries';
|
20
|
-
isPrimary: true;
|
21
|
-
permissions: {
|
22
|
-
create: 'JOURNAL_CREATE';
|
23
|
-
};
|
24
|
-
}
|
25
|
-
>;
|
27
|
+
static get metadata(): JournalEntryMetadata;
|
26
28
|
}
|
@@ -2,33 +2,36 @@ import { DocumentMetadata, DocumentModificationOptions } from '../abstract/docum
|
|
2
2
|
import { Document } from '../abstract/module.mjs';
|
3
3
|
import * as CONST from '../constants.mjs';
|
4
4
|
import * as data from '../data/data.mjs';
|
5
|
-
import type { MacroDataConstructorData } from '../data/data.mjs/macroData
|
5
|
+
import type { MacroDataConstructorData } from '../data/data.mjs/macroData';
|
6
6
|
import { BaseUser } from './baseUser';
|
7
7
|
|
8
|
+
type MacroMetadata = Merge<
|
9
|
+
DocumentMetadata,
|
10
|
+
{
|
11
|
+
name: 'Macro';
|
12
|
+
collection: 'macros';
|
13
|
+
label: 'DOCUMENT.Macro';
|
14
|
+
labelPlural: 'DOCUMENT.Macros';
|
15
|
+
isPrimary: true;
|
16
|
+
types: [typeof CONST.MACRO_TYPES.SCRIPT, typeof CONST.MACRO_TYPES.CHAT];
|
17
|
+
permissions: {
|
18
|
+
create: 'PLAYER';
|
19
|
+
// TODO: fix when fixed by foundry (https://gitlab.com/foundrynet/foundryvtt/-/issues/6694)
|
20
|
+
// update: undefined;
|
21
|
+
// delete: undefined;
|
22
|
+
};
|
23
|
+
}
|
24
|
+
>;
|
25
|
+
|
8
26
|
/**
|
9
27
|
* The base Macro model definition which defines common behavior of an Macro document between both client and server.
|
10
28
|
*/
|
11
|
-
export declare class BaseMacro extends Document<data.MacroData> {
|
29
|
+
export declare class BaseMacro extends Document<data.MacroData, null, MacroMetadata> {
|
12
30
|
/** @override */
|
13
31
|
static get schema(): typeof data.MacroData;
|
14
32
|
|
15
33
|
/** @override */
|
16
|
-
static get metadata():
|
17
|
-
DocumentMetadata,
|
18
|
-
{
|
19
|
-
name: 'Macro';
|
20
|
-
collection: 'macros';
|
21
|
-
label: 'DOCUMENT.Macro';
|
22
|
-
labelPlural: 'DOCUMENT.Macros';
|
23
|
-
isPrimary: true;
|
24
|
-
types: [typeof CONST.MACRO_TYPES.SCRIPT, typeof CONST.MACRO_TYPES.CHAT];
|
25
|
-
permissions: {
|
26
|
-
create: 'PLAYER';
|
27
|
-
update: (user: BaseUser, doc: BaseMacro, data?: object) => boolean;
|
28
|
-
delete: (user: BaseUser, doc: BaseMacro) => boolean;
|
29
|
-
};
|
30
|
-
}
|
31
|
-
>;
|
34
|
+
static get metadata(): MacroMetadata;
|
32
35
|
|
33
36
|
/** @override */
|
34
37
|
protected _preCreate(
|