Options: ConstructorParameters<typeof foundry.data.fields.StringField>[0] & {
    scope?: string;
}

Construction options: every foundry.data.fields.StringField option — required, nullable, blank, trim, initial, choices, label, hint, validate, readonly, … — plus scope, the only one this field adds.

The options are inherited by intersection rather than re-declared, so the base set never drifts from Foundry's. Four of them carry different defaults here (nullable, blank, trim, initial); see the table on SafeExpressionField for those and when overriding is reasonable.

Type declaration

  • Optionalscope?: string

    Id of the sohl.entity.expr.ExpressionScope declaring which identifiers this field's expression may use (e.g. "skill.base") — the scope the value will be evaluated against at its call site.

    Drives the editor's autocomplete and its live out-of-scope check, and reaches the sheet as data-expr-scope via the expressionField partial. Resolved eagerly at construction, so an unknown or renamed id throws while the schema is being built rather than yielding a field that silently validates nothing.

    Optional: omit it only when the field has no single fixed call site — an expression stored without a scope accepts any identifier.