remove all existing @ts-expect-error?
remove all existing @ts-expect-error?
11 Replies
or sprinkle them in to a reasonable degree
The latter
then yeah you probably can
at least at your current rate
no (circularity) errors & a performant intellisense is my goal :LaughingSor:
I'll try my best on the circularity errors
you seem to have ~25 right now
Tomorrow I'm planning on doing the remaining data models, I've still got about a dozen of embedded ones to go, when that's done it's basically the circularities + sheets
I'll admit this one is forboding:
it probably has to do with all your mixins?
stack depth is a very rare type of circularity for fvtt-types to run into
in the grand scheme of things
probably your mixins
or that other absolutely massive error
src/module/combat/document.ts(67,19): error TS2321: Excessive stack depth comparing types '(a: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }, b: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }) => number' and '(a: CombatantPTR2e, b: CombatantPTR2e) => number'.
src/module/combat/document.ts(67,19): error TS2321: Excessive stack depth comparing types '(a: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }, b: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }) => number' and '(a: CombatantPTR2e, b: CombatantPTR2e) => number'.
which one is that? xD
like in what file/class?
the one on
_onUpdate
Ah, is that a wrong override typing one?
src/module/actor/base.ts(1844,22): error TS2416: Property '_onUpdate' in type 'ActorPTR2e' is not assignable to the same property in base type 'Actor'.
Type '(changed: DeepPartial<AssignmentType<Schema, DefaultOptions>>, options: OnUpdateOptions<any>, userId: string) => void' is not assignable to type '((changed: RemoveIndexSignatures<{}>, options: OnUpdateOptions<any>, userId: string) => void) & ((changed: RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseActor, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseActor, DefaultOptions>; prototypeToken?: AssignmentType<typeof PrototypeToken, DefaultOptions>; items?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseItem, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseItem, DefaultOptions>; effects?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; label: "EFFECT.Label"; }>; img?: AssignmentType<{ categories: "IMAGE"[]; label: "EFFECT.Image"; }>; type?: AssignmentType<typeof BaseActiveEffect, { initial: "base"; }>; system?: AssignmentType<typeof BaseActiveEffect, DefaultOptions>; changes?: AssignmentType<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>, string, string>; mode: NumberField<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }, AssignmentType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>>; priority: NumberField<DefaultOptions, AssignmentType<DefaultOptions>, InitializedType<DefaultOptions>, InitializedType<DefaultOptions>>; }, SimpleMerge<DefaultOptions, DefaultOptions>>, DefaultOptions<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>,
src/module/actor/base.ts(1844,22): error TS2416: Property '_onUpdate' in type 'ActorPTR2e' is not assignable to the same property in base type 'Actor'.
Type '(changed: DeepPartial<AssignmentType<Schema, DefaultOptions>>, options: OnUpdateOptions<any>, userId: string) => void' is not assignable to type '((changed: RemoveIndexSignatures<{}>, options: OnUpdateOptions<any>, userId: string) => void) & ((changed: RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseActor, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseActor, DefaultOptions>; prototypeToken?: AssignmentType<typeof PrototypeToken, DefaultOptions>; items?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseItem, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseItem, DefaultOptions>; effects?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; label: "EFFECT.Label"; }>; img?: AssignmentType<{ categories: "IMAGE"[]; label: "EFFECT.Image"; }>; type?: AssignmentType<typeof BaseActiveEffect, { initial: "base"; }>; system?: AssignmentType<typeof BaseActiveEffect, DefaultOptions>; changes?: AssignmentType<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>, string, string>; mode: NumberField<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }, AssignmentType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>>; priority: NumberField<DefaultOptions, AssignmentType<DefaultOptions>, InitializedType<DefaultOptions>, InitializedType<DefaultOptions>>; }, SimpleMerge<DefaultOptions, DefaultOptions>>, DefaultOptions<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>,