added type support
This commit is contained in:
1 parent
c8e576d44f
commit
d5362e71b9
11 files changed
+2409
-57
No files matched your search
+17
-12
@@ -1,13 +1,18 @@
|
||||
export class CharacterData extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
biography: new fields.HTMLField({ initial: "" }),
|
||||
attributes: new fields.SchemaField({
|
||||
strength: new fields.NumberField({ required: true, integer: true, initial: 10 }),
|
||||
agility: new fields.NumberField({ required: true, integer: true, initial: 10 }),
|
||||
spirit: new fields.NumberField({ required: true, integer: true, initial: 10 })
|
||||
})
|
||||
};
|
||||
}
|
||||
function defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
biography: new fields.HTMLField({ initial: "" }),
|
||||
attributes: new fields.SchemaField({
|
||||
strength: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10 }),
|
||||
agility: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10 }),
|
||||
spirit: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 10 })
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
export class CharacterData extends foundry.abstract.TypeDataModel<
|
||||
ReturnType<typeof defineSchema>,
|
||||
Actor.Implementation
|
||||
> {
|
||||
static defineSchema = defineSchema;
|
||||
}
|
||||
+13
-8
@@ -1,9 +1,14 @@
|
||||
export class ItemData extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
quantity: new fields.NumberField({ required: true, integer: true, initial: 1, min: 0 })
|
||||
};
|
||||
}
|
||||
function defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
quantity: new fields.NumberField({ required: true, nullable: false, integer: true, initial: 1, min: 0 })
|
||||
};
|
||||
}
|
||||
|
||||
export class ItemData extends foundry.abstract.TypeDataModel<
|
||||
ReturnType<typeof defineSchema>,
|
||||
Item.Implementation
|
||||
> {
|
||||
static defineSchema = defineSchema;
|
||||
}
|
||||
Reference in new issue
Block a user