@datasworn/core
Version:
Typings and JSON schema common to Datasworn. This is a pre-release package, provided for developer feedback. It will almost certainly receive breaking changes.
1,563 lines • 132 kB
TypeScript
/**
* Describes game rules compatible with the Ironsworn tabletop role-playing game by Shawn Tomkin.
* @remarks Deserialize as a discriminated union/polymorphic object type, using the `type` property as a discriminator.
*/
export type RulesPackage = Ruleset | Expansion;
/**
* A standalone Datasworn package that describes its own ruleset.
*/
export interface Ruleset {
_id: RulesetId;
type: 'ruleset';
/**
* The version of the Datasworn format used by this data.
* @pattern ```javascript
* /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
* ```
*/
datasworn_version: '0.0.10';
description?: MarkdownString;
title: SourceTitle;
/**
* Lists authors credited by the source material.
*/
authors: AuthorInfo[];
/**
* The date of the source documents's last update, formatted YYYY-MM-DD. Required because it's used to determine whether the data needs updating.
*/
date: Date;
/**
* A URL where the source document is available.
* @example "https://ironswornrpg.com"
*/
url: WebUrl;
license: License;
rules: Rules;
/**
* A dictionary object containing oracle collections, which may contain oracle tables and/or oracle collections.
* @remarks Deserialize as a dictionary object.
*/
oracles: Record<DictKey, OracleTablesCollection>;
/**
* A dictionary object containing move categories, which contain moves.
* @remarks Deserialize as a dictionary object.
*/
moves: Record<DictKey, MoveCategory>;
/**
* A dictionary object containing asset collections, which contain assets.
* @remarks Deserialize as a dictionary object.
*/
assets: Record<DictKey, AssetCollection>;
/**
* A dictionary object containing atlas collections, which contain atlas entries.
* @remarks Deserialize as a dictionary object.
*/
atlas?: Record<DictKey, AtlasCollection>;
/**
* A dictionary object containing NPC collections, which contain NPCs.
* @remarks Deserialize as a dictionary object.
*/
npcs?: Record<DictKey, NpcCollection>;
/**
* A dictionary object of truth categories.
* @remarks Deserialize as a dictionary object.
*/
truths?: Record<DictKey, Truth>;
/**
* A dictionary object containing rarities, like those presented in Ironsworn: Delve.
* @remarks Deserialize as a dictionary object.
*/
rarities?: Record<DictKey, Rarity>;
/**
* A dictionary object of delve sites, like the premade delve sites presented in Ironsworn: Delve
* @remarks Deserialize as a dictionary object.
*/
delve_sites?: Record<DictKey, DelveSite>;
/**
* A dictionary object containing delve site themes.
* @remarks Deserialize as a dictionary object.
*/
site_themes?: Record<DictKey, DelveSiteTheme>;
/**
* A dictionary object containing delve site domains.
* @remarks Deserialize as a dictionary object.
*/
site_domains?: Record<DictKey, DelveSiteDomain>;
}
/**
* A Datasworn package that relies on an external package to provide its ruleset.
*/
export interface Expansion {
description?: MarkdownString;
title?: SourceTitle;
/**
* Lists authors credited by the source material.
*/
authors?: AuthorInfo[];
/**
* The date of the source documents's last update, formatted YYYY-MM-DD. Required because it's used to determine whether the data needs updating.
*/
date?: Date;
/**
* A URL where the source document is available.
* @example "https://ironswornrpg.com"
*/
url?: WebUrl;
license?: License;
/**
* A dictionary object containing oracle collections, which may contain oracle tables and/or oracle collections.
* @remarks Deserialize as a dictionary object.
*/
oracles?: Record<DictKey, OracleTablesCollection>;
/**
* A dictionary object containing move categories, which contain moves.
* @remarks Deserialize as a dictionary object.
*/
moves?: Record<DictKey, MoveCategory>;
/**
* A dictionary object containing asset collections, which contain assets.
* @remarks Deserialize as a dictionary object.
*/
assets?: Record<DictKey, AssetCollection>;
/**
* A dictionary object containing atlas collections, which contain atlas entries.
* @remarks Deserialize as a dictionary object.
*/
atlas?: Record<DictKey, AtlasCollection>;
/**
* A dictionary object containing NPC collections, which contain NPCs.
* @remarks Deserialize as a dictionary object.
*/
npcs?: Record<DictKey, NpcCollection>;
/**
* A dictionary object of truth categories.
* @remarks Deserialize as a dictionary object.
*/
truths?: Record<DictKey, Truth>;
/**
* A dictionary object containing rarities, like those presented in Ironsworn: Delve.
* @remarks Deserialize as a dictionary object.
*/
rarities?: Record<DictKey, Rarity>;
/**
* A dictionary object of delve sites, like the premade delve sites presented in Ironsworn: Delve
* @remarks Deserialize as a dictionary object.
*/
delve_sites?: Record<DictKey, DelveSite>;
/**
* A dictionary object containing delve site themes.
* @remarks Deserialize as a dictionary object.
*/
site_themes?: Record<DictKey, DelveSiteTheme>;
/**
* A dictionary object containing delve site domains.
* @remarks Deserialize as a dictionary object.
*/
site_domains?: Record<DictKey, DelveSiteDomain>;
_id: ExpansionId;
type: 'expansion';
/**
* The version of the Datasworn format used by this data.
* @pattern ```javascript
* /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
* ```
*/
datasworn_version: '0.0.10';
ruleset: RulesetId;
rules?: RulesExpansion;
}
/**
* A unique ID for an AssetAbility.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/assets\/([a-z][a-z_]*)\/([a-z][a-z_]*)\/abilities\/(0|[1-9][0-9]*)$/
* ```
*/
export type AssetAbilityId = string;
/**
* A unique ID for an AssetCollection.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/collections\/assets\/([a-z][a-z_]*)$/
* ```
*/
export type AssetCollectionId = string;
/**
* A wildcarded ID that can be used to match multiple AssetCollections.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/collections\/assets\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type AssetCollectionIdWildcard = string;
/**
* A unique ID for an Asset.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/assets\/([a-z][a-z_]*)\/([a-z][a-z_]*)$/
* ```
*/
export type AssetId = string;
/**
* A wildcarded ID that can be used to match multiple Assets.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/assets\/(\*|([a-z][a-z_]*))\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type AssetIdWildcard = string;
/**
* A unique ID for an AtlasCollection.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/collections\/atlas\/([a-z][a-z_]*)$/
* ```
* @example "classic/collections/atlas/ironlands"
*/
export type AtlasCollectionId = string;
/**
* A wildcarded ID that can be used to match multiple AtlasCollections.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/collections\/atlas\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type AtlasCollectionIdWildcard = string;
/**
* A unique ID for an AtlasEntry.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/atlas\/([a-z][a-z_]*)\/([a-z][a-z_]*)$/
* ```
* @example "classic/atlas/ironlands/hinterlands"
*/
export type AtlasEntryId = string;
/**
* A wildcarded ID that can be used to match multiple AtlasEntrys.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/atlas\/(\*|([a-z][a-z_]*))\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type AtlasEntryIdWildcard = string;
/**
* A unique ID for a ConditionMeterRule.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/rules\/condition_meters\/([a-z][a-z_]*)$/
* ```
* @example "classic/rules/condition_meters/health"
* @example "starforged/rules/condition_meters/spirit"
*/
export type ConditionMeterRuleId = string;
/**
* A unique ID for a DelveSiteDomain.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/site_domains\/([a-z][a-z_]*)$/
* ```
* @example "delve/site_domains/shadowfen"
*/
export type DelveSiteDomainId = string;
/**
* A wildcarded ID that can be used to match multiple DelveSiteDomains.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/site_domains\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type DelveSiteDomainIdWildcard = string;
/**
* A unique ID for a DelveSite.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/delve_sites\/([a-z][a-z_]*)$/
* ```
* @example "delve/delve_sites/alvas_rest"
*/
export type DelveSiteId = string;
/**
* A wildcarded ID that can be used to match multiple DelveSites.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/delve_sites\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type DelveSiteIdWildcard = string;
/**
* A unique ID for a DelveSiteTheme.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/site_themes\/([a-z][a-z_]*)$/
* ```
* @example "delve/site_themes/hallowed"
*/
export type DelveSiteThemeId = string;
/**
* A wildcarded ID that can be used to match multiple DelveSiteThemes.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/site_themes\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type DelveSiteThemeIdWildcard = string;
/**
* A `snake_case` key used in a Datasworn dictionary object.
* @remarks If you need to generate a key from a user-provided label, it's recommended to use a 'slugify' function/library, e.g. https://www.npmjs.com/package/slugify for NodeJS.
* @pattern ```javascript
* /^([a-z][a-z_]*)$/
* ```
*/
export type DictKey = string;
/**
* The ID of a Datasworn package that relies on an external package to provide its ruleset.
* @pattern ```javascript
* /^([a-z0-9_]{3,})$/
* ```
* @example "delve"
*/
export type ExpansionId = string;
/**
* A unique ID for an ImpactRuleCollection.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/collections\/rules\/impacts\/([a-z][a-z_]*)$/
* ```
* @example "classic/collections/rules/impacts/conditions"
* @example "starforged/collections/rules/impacts/vehicle_troubles"
*/
export type ImpactRuleCollectionId = string;
/**
* A unique ID for an ImpactRule.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/rules\/impacts\/([a-z][a-z_]*)\/([a-z][a-z_]*)$/
* ```
* @example "classic/rules/impacts/conditions/wounded"
* @example "starforged/rules/impacts/vehicle_troubles/battered"
*/
export type ImpactRuleId = string;
/**
* A unique ID for a MoveCategory.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/collections\/moves\/([a-z][a-z_]*)$/
* ```
* @example "starforged/collections/moves/adventure"
*/
export type MoveCategoryId = string;
/**
* A wildcarded ID that can be used to match multiple MoveCategorys.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/collections\/moves\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type MoveCategoryIdWildcard = string;
/**
* A move ID, for a standard move or a unique asset move
* @example "classic/moves/combat/strike"
* @example "starforged/assets/module/grappler/abilities/0/moves/ready_grappler"
*/
export type MoveId = string;
/**
* A move ID with wildcards.
*/
export type MoveIdWildcard = string;
/**
* A unique ID for a NpcCollection.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/collections\/npcs\/([a-z][a-z_]*)$/
* ```
* @example "classic/collections/npcs/firstborn"
* @example "starforged/collections/npcs/sample_npcs"
*/
export type NpcCollectionId = string;
/**
* A wildcarded ID that can be used to match multiple NpcCollections.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/collections\/npcs\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type NpcCollectionIdWildcard = string;
/**
* A unique ID for a Npc.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/npcs\/([a-z][a-z_]*)\/([a-z][a-z_]*)$/
* ```
* @example "classic/npcs/firstborn/elf"
* @example "starforged/npcs/sample_npcs/chiton"
*/
export type NpcId = string;
/**
* A wildcarded ID that can be used to match multiple Npcs.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/npcs\/(\*|([a-z][a-z_]*))\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type NpcIdWildcard = string;
/**
* A unique ID for a NpcVariant.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/npcs\/([a-z][a-z_]*)\/([a-z][a-z_]*)\/variants\/([a-z][a-z_]*)$/
* ```
* @example "starforged/npcs/sample_npcs/chiton/variants/chiton_drone_pack"
*/
export type NpcVariantId = string;
/**
* A unique ID for an OracleCollection.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/collections\/oracles(\/([a-z][a-z_]*)){1,3}$/
* ```
* @example "starforged/collections/oracles/core"
* @example "starforged/collections/oracles/character/names"
* @example "starforged/collections/oracles/planets/furnace/settlements"
*/
export type OracleCollectionId = string;
/**
* A wildcarded ID that can be used to match multiple OracleCollections.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/collections\/oracles((\/([a-z][a-z_]*)){1,3}|\/\*\*|\/\*\*\/([a-z][a-z_]*)|\/([a-z][a-z_]*)\/\*\*)$/
* ```
*/
export type OracleCollectionIdWildcard = string;
/**
* A unique ID for an OracleRollable.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/oracles(\/([a-z][a-z_]*)){1,3}\/([a-z][a-z_]*)$/
* ```
* @example "starforged/oracles/core/action"
* @example "starforged/oracles/character/names/given"
* @example "starforged/oracles/planets/furnace/settlements/terminus"
*/
export type OracleRollableId = string;
/**
* Oracle table wildcards can also use '**' to represent any number of collection levels in the oracle tree.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/oracles((\/([a-z][a-z_]*)){1,3}|\/\*\*|\/\*\*\/([a-z][a-z_]*)|\/([a-z][a-z_]*)\/\*\*)\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type OracleRollableIdWildcard = string;
/**
* A unique ID for a Rarity.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/rarities\/([a-z][a-z_]*)$/
* ```
* @example "classic/rarities/ayethins_journal"
*/
export type RarityId = string;
/**
* A wildcarded ID that can be used to match multiple Raritys.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/rarities\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type RarityIdWildcard = string;
/**
* The ID of standalone Datasworn package that describes its own ruleset.
* @pattern ```javascript
* /^([a-z0-9_]{3,})$/
* ```
* @example "classic"
* @example "starforged"
* @example "sundered_isles"
*/
export type RulesetId = string;
/**
* A unique ID for a SpecialTrackRule.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/rules\/special_tracks\/([a-z][a-z_]*)$/
* ```
* @example "classic/rules/special_tracks/bonds"
* @example "delve/rules/special_tracks/failure"
* @example "starforged/rules/special_tracks/bonds_legacy"
*/
export type SpecialTrackRuleId = string;
/**
* A unique ID for a StatRule.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/rules\/stats\/([a-z][a-z_]*)$/
* ```
*/
export type StatRuleId = string;
/**
* A unique ID for a Truth.
* @pattern ```javascript
* /^([a-z0-9_]{3,})\/truths\/([a-z][a-z_]*)$/
* ```
* @example "classic/truths/iron"
* @example "starforged/truths/iron"
*/
export type TruthId = string;
/**
* A wildcarded ID that can be used to match multiple Truths.
* @pattern ```javascript
* /^(\*|([a-z0-9_]{3,}))\/truths\/(\*|([a-z][a-z_]*))$/
* ```
*/
export type TruthIdWildcard = string;
/**
* Information on the original creator of this material.
* @example {}
*/
export interface AuthorInfo {
/**
* @example "Shawn Tomkin"
*/
name: string;
/**
* An optional email contact for the author
*/
email?: string;
/**
* An optional URL for the author's website.
*/
url?: string;
}
/**
* A CSS color value.
* @remarks See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
*/
export type CssColor = string;
/**
* A date formatted YYYY-MM-DD.
* @remarks You may prefer to deserialize this as a Date object.
* @pattern ```javascript
* /[0-9]{4}-((0[0-9])|(1[0-2]))-(([0-2][0-9])|(3[0-1]))/
* ```
*/
export type Date = string;
/**
* An URL pointing to the location where this element's license can be found.
*
* A `null` here indicates that the content provides __no__ license, and is not intended for redistribution.
* @example "https://creativecommons.org/licenses/by/4.0"
* @example "https://creativecommons.org/licenses/by-nc-sa/4.0"
*/
export type License = WebUrl | null;
/**
* Represents a page number in a book.
* @minimum 1
*/
export type PageNumber = number;
/**
* Metadata describing the original source of this item
*/
export interface SourceInfo {
title: SourceTitle;
/**
* The page number where this item is described in full.
*/
page?: PageNumber;
/**
* Lists authors credited by the source material.
*/
authors: AuthorInfo[];
/**
* The date of the source documents's last update, formatted YYYY-MM-DD. Required because it's used to determine whether the data needs updating.
*/
date: Date;
/**
* A URL where the source document is available.
* @example "https://ironswornrpg.com"
*/
url: WebUrl;
license: License;
}
/**
* The title of the source document.
* @example "Ironsworn Rulebook"
* @example "Ironsworn Assets Master Set"
* @example "Ironsworn: Delve"
* @example "Ironsworn: Starforged Rulebook"
* @example "Ironsworn: Starforged Assets"
* @example "Sundered Isles"
*/
export type SourceTitle = string;
/**
* @experimental
*/
export interface Suggestions {
oracles?: OracleRollableId[];
assets?: AssetId[];
moves?: MoveId[];
site_domains?: DelveSiteDomainId[];
site_themes?: DelveSiteThemeId[];
npcs?: NpcId[];
atlas?: AtlasEntryId[];
rarities?: RarityId[];
}
/**
* A relative (local) URL pointing to a vector image in the SVG format.
* @pattern ```javascript
* /\.svg$/
* ```
*/
export type SvgImageUrl = string;
/**
* An absolute URL pointing to a website.
*/
export type WebUrl = string;
/**
* A relative (local) URL pointing to a raster image in the WEBP format.
* @pattern ```javascript
* /\.webp$/
* ```
*/
export type WebpImageUrl = string;
/**
* @experimental
*/
export interface I18nHint {
/**
* The part of speech for this string.
*/
part_of_speech?: PartOfSpeech;
}
/**
* Internationalization/localization hints for the text content of this object.
* @experimental
*/
export interface I18nHints {
text?: I18nHint;
text2?: I18nHint;
text3?: I18nHint;
template?: {
text?: I18nHint;
text2?: I18nHint;
text3?: I18nHint;
};
}
/**
* A localized label for an input. In some contexts it may be undesirable to render this text, but it should always be exposed to assistive technology (e.g. with `aria-label` in HTML).
* @pattern ```javascript
* /^[^A-Z]+$/
* ```
* @i18n
*/
export type InputLabel = string;
/**
* A localized plain text name or label.
* @i18n
*/
export type Label = string;
/**
* Localized text, formatted in Markdown.
*
* It uses some custom syntax; e.g. `{{table:some_oracle_table_id}}` indicates that the referenced oracle table is rendered there in the source material.
* @i18n
*/
export type MarkdownString = string;
/**
* - `common_noun`: A common noun.
* - `proper_noun`: A proper noun.
* - `adjunct_common_noun`: A common noun used as an adjective, to modify another noun.
* - `adjunct_proper_noun`: A proper noun used as an adjective, to modify another noun.
* - `verb`: A verb in present tense
* - `gerund`: Gerund or present participle of a verb, e.g. "going", "seeing", "waving". Can function as a noun, an adjective, or a progressive verb.
* - `adjective`: An adjective.
* - `attributive_verb`: A verb used as an adjective, to modify a noun.
* - `adjective_as_proper_noun`: An adjective used as a proper noun.
* - `common_noun_as_proper_noun`: An common noun used as a proper noun.
*/
export type PartOfSpeech = 'common_noun' | 'proper_noun' | 'adjunct_common_noun' | 'adjunct_proper_noun' | 'verb' | 'gerund' | 'adjective' | 'attributive_verb' | 'adjective_as_proper_noun' | 'common_noun_as_proper_noun';
/**
* A rich text string in Markdown with replaced values from oracle roll results.
*
* The custom syntax `{{some_row_key:some_oracle_table_id}}` should be replaced by the `some_row_key` string of a rolled oracle table. This is usually the `result` key, for example `{{result:starforged/oracles/core/action}}`
*
* @i18n
* @experimental
*/
export type TemplateString = string;
export type CollectableType = 'oracle_rollable' | 'move' | 'asset' | 'atlas_entry' | 'npc';
export type CollectionType = 'oracle_collection' | 'move_category' | 'asset_collection' | 'atlas_collection' | 'npc_collection';
/**
* Describes a standard player character condition meter.
*/
export interface ConditionMeterRule {
/**
* A description of this condition meter.
*/
description: MarkdownString;
/**
* Is this condition meter shared by all players?
* @default false
*/
shared: boolean;
label: InputLabel;
/**
* The current value of this meter.
* @default 0
*/
value: number;
/**
* The minimum value of this meter.
* @default 0
*/
min: number;
/**
* The maximum value of this meter.
*/
max: number;
/**
* Is this meter's `value` usable as a stat in an action roll?
*/
rollable: true;
}
/**
* Describes a category of standard impacts/debilities.
*/
export interface ImpactCategory {
/**
* A label for this impact category.
*/
label: InputLabel;
/**
* A description of this impact category.
*/
description: MarkdownString;
/**
* A dictionary object of the Impacts in this category.
* @remarks Deserialize as a dictionary object.
*/
contents: Record<DictKey, ImpactRule>;
}
/**
* Describes a standard impact/debility.
*/
export interface ImpactRule {
/**
* The label for this impact.
*/
label: InputLabel;
/**
* A description of this impact.
*/
description: MarkdownString;
/**
* Is this impact applied to all players at once?
* @default false
*/
shared: boolean;
/**
* Any ruleset condition meters that can't recover when this impact is active.
* @default []
*/
prevents_recovery: ConditionMeterKey[];
/**
* Is this impact permanent?
* @default false
*/
permanent: boolean;
}
export type NonCollectableType = 'delve_site' | 'delve_site_theme' | 'delve_site_domain' | 'truth' | 'rarity';
export type ObjectType = CollectableType | NonCollectableType | CollectionType;
/**
* Describes rules for player characters in this ruleset, such as stats and condition meters.
* @experimental
*/
export interface Rules {
/**
* Describes the standard stats used by player characters in this ruleset.
* @remarks Deserialize as a dictionary object.
*/
stats: Record<DictKey, StatRule>;
/**
* Describes the standard condition meters used by player characters in this ruleset.
* @remarks Deserialize as a dictionary object.
*/
condition_meters: Record<DictKey, ConditionMeterRule>;
/**
* Describes the standard impacts/debilities used by player characters in this ruleset.
* @remarks Deserialize as a dictionary object.
*/
impacts: Record<DictKey, ImpactCategory>;
/**
* Describes the special tracks used by player characters in this ruleset, like Bonds (classic Ironsworn), Failure (Delve), or Legacies (Starforged).
* @remarks Deserialize as a dictionary object.
*/
special_tracks: Record<DictKey, SpecialTrackRule>;
/**
* @remarks Deserialize as a dictionary object.
* @default
* ```javascript
* {
*
* }
* ```
* @experimental
*/
tags: Record<DictKey, TagRule>;
}
/**
* Describes rules for player characters in this ruleset, such as stats and condition meters.
* @experimental
*/
export interface RulesExpansion {
/**
* Describes the standard stats used by player characters in this ruleset.
* @remarks Deserialize as a dictionary object.
*/
stats?: Record<DictKey, StatRule>;
/**
* Describes the standard condition meters used by player characters in this ruleset.
* @remarks Deserialize as a dictionary object.
*/
condition_meters?: Record<DictKey, ConditionMeterRule>;
/**
* Describes the standard impacts/debilities used by player characters in this ruleset.
* @remarks Deserialize as a dictionary object.
*/
impacts?: Record<DictKey, ImpactCategory>;
/**
* Describes the special tracks used by player characters in this ruleset, like Bonds (classic Ironsworn), Failure (Delve), or Legacies (Starforged).
* @remarks Deserialize as a dictionary object.
*/
special_tracks?: Record<DictKey, SpecialTrackRule>;
/**
* @remarks Deserialize as a dictionary object.
* @default
* ```javascript
* {
*
* }
* ```
* @experimental
*/
tags?: Record<DictKey, TagRule>;
}
/**
* Describes a special track like Bonds (classic Ironsworn), Failure (Delve), or Legacies (Starforged).
*/
export interface SpecialTrackRule {
/**
* A label for this special track.
*/
label: InputLabel;
/**
* A description of this special track.
*/
description: MarkdownString;
/**
* Is this track shared by all players?
* @default false
*/
shared: boolean;
/**
* Is this track an optional rule?
* @default false
*/
optional: boolean;
}
/**
* Describes a standard player character stat.
*/
export interface StatRule {
/**
* A label for this stat.
* @example "edge"
*/
label: InputLabel;
/**
* A description of this stat.
* @example "Quickness, agility, and prowess when fighting at a distance."
*/
description: MarkdownString;
}
export type Tag = boolean | number | DictKey | DiceExpression | OracleRollableId | MoveId | AssetId | AtlasEntryId | NpcId | OracleCollectionId | MoveCategoryId | AssetCollectionId | AtlasCollectionId | NpcCollectionId | DelveSiteId | DelveSiteThemeId | DelveSiteDomainId | TruthId | RarityId | Array<OracleRollableIdWildcard | MoveIdWildcard | AssetIdWildcard | AtlasEntryIdWildcard | NpcIdWildcard | OracleCollectionIdWildcard | MoveCategoryIdWildcard | AssetCollectionIdWildcard | AtlasCollectionIdWildcard | NpcCollectionIdWildcard | DelveSiteIdWildcard | DelveSiteThemeIdWildcard | DelveSiteDomainIdWildcard | TruthIdWildcard | RarityIdWildcard>;
/**
* @remarks Deserialize as a discriminated union/polymorphic object type, using the `value_type` property as a discriminator.
*/
export type TagRule = {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* @default false
*/
array: boolean;
value_type: 'boolean';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* @default false
*/
array: boolean;
value_type: 'integer';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'oracle_rollable';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'move';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'asset';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'atlas_entry';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'npc';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'oracle_collection';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'move_category';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'asset_collection';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'atlas_collection';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'npc_collection';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'delve_site';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'delve_site_theme';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'delve_site_domain';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'truth';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* If `true`, this field accepts an array of wildcard IDs. If `false`, this field accepts a single non-wildcard ID.
* @default false
*/
wildcard: boolean;
value_type: 'rarity';
} | {
/**
* Types of object that can receive this tag, or `null` if any type of object accepts it.
* @default null
*/
applies_to: ObjectType[] | null;
description: MarkdownString;
/**
* @default false
*/
array: boolean;
value_type: 'enum';
enum: DictKey[];
};
/**
* Challenge rank, represented as an integer from 1 (troublesome) to 5 (epic).
*
* - `1`: Troublesome
* - `2`: Dangerous
* - `3`: Formidable
* - `4`: Extreme
* - `5`: Epic
*/
export type ChallengeRank = 1 | 2 | 3 | 4 | 5;
/**
* Describes the features of a type of progress track.
*/
export interface ProgressTrackTypeInfo {
/**
* A category label for progress tracks of this type.
* @example "Vow"
* @example "Journey"
* @example "Combat"
* @example "Scene Challenge"
* @example "Expedition"
* @example "Connection"
* @example "Delve"
*/
category: Label;
/**
* @remarks Deserialize as a dictionary object.
*/
controls?: Record<DictKey, {}>;
}
/**
* Special, ruleset-specific progress tracks. Usually, one exists per player character, and they persist through the life of the player character.
* 'Canonical' examples:
* * `bonds_track`, described in the Ironsworn Rulebook. For the Starforged legacy track, use `bonds_legacy` instead.
* * `failure_track`, described in Ironsworn: Delve
* * `quests_legacy`, `bonds_legacy`, and `discoveries_legacy`, described Ironsworn: Starforged
*
*
* @example "bonds_track"
* @example "failure_track"
* @example "quests_legacy"
* @example "bonds_legacy"
* @example "discoveries_legacy"
*/
export type SpecialTrackType = DictKey;
/**
* A reference to the value of an asset control.
*/
export interface AssetControlValueRef {
/**
* Asset IDs (which may be wildcarded) that may provide the control field. For asset ability enhancements, `null` is used to represent the asset's own control fields.
* @default null
*/
assets: AssetIdWildcard[] | null;
/**
* The dictionary key of the asset control field.
* @example "health"
* @example "integrity"
*/
control: DictKey;
/**
* A reference to the value of an asset control.
*/
using: 'asset_control';
}
/**
* A reference to the value of an asset option.
*/
export interface AssetOptionValueRef {
/**
* Asset IDs (which may be wildcarded) that may provide the option field. For asset ability enhancements, `null` is used to represent the asset's own option fields.
* @default null
*/
assets: AssetIdWildcard[] | null;
/**
* The dictionary key of the asset option field.
*/
option: DictKey;
/**
* A reference to the value of an asset option.
*/
using: 'asset_option';
}
/**
* A reference to the value of an attached asset control. For example, a Module asset could use this to roll using the `integrity` control of an attached Vehicle.
*/
export interface AttachedAssetControlValueRef {
/**
* The dictionary key of the asset control field.
* @example "health"
* @example "integrity"
*/
control: DictKey;
/**
* A reference to the value of an attached asset control. For example, a Module asset could use this to roll using the `integrity` control of an attached Vehicle.
*/
using: 'attached_asset_control';
}
/**
* A reference to the value of an attached asset option.
*/
export interface AttachedAssetOptionValueRef {
/**
* The dictionary key of the asset option field.
*/
option: DictKey;
/**
* A reference to the value of an attached asset option.
*/
using: 'attached_asset_option';
}
/**
* A reference to the value of a standard player condition meter.
*/
export interface ConditionMeterValueRef {
condition_meter: ConditionMeterKey;
/**
* A reference to the value of a standard player condition meter.
*/
using: 'condition_meter';
}
/**
* An arbitrary static integer value with a label.
*/
export interface CustomValue {
label: InputLabel;
value: number;
/**
* An arbitrary static integer value with a label.
*/
using: 'custom';
}
/**
* Provides a value like a stat, condition meter, or other number (usually for use in an action roll). The expected value is an integer, or null.
* @remarks Deserialize as a discriminated union/polymorphic object type, using the `using` property as a discriminator.
*/
export type RollableValue = StatValueRef | ConditionMeterValueRef | AssetControlValueRef | AssetOptionValueRef | AttachedAssetControlValueRef | AttachedAssetOptionValueRef | CustomValue;
/**
* A reference to the value of a standard player character stat.
*/
export interface StatValueRef {
stat: StatKey;
/**
* A reference to the value of a standard player character stat.
*/
using: 'stat';
}
/**
* A non-player character entry, similar to those in Chapter 5 of the Ironsworn Rulebook, or Chapter 4 of Starforged.
*/
export interface Npc {
/**
* The unique Datasworn ID for this item.
*/
_id: NpcId;
/**
* Any implementation hints or other developer-facing comments on this object. These should be omitted when presenting the object for gameplay.
*/
_comment?: string;
/**
* The primary name/label for this item.
*/
name: Label;
/**
* The name of this item as it appears on the page in the book, if it's different from `name`.
*/
canonical_name?: Label;
/**
* Attribution for the original source (such as a book or website) of this item, including the author and licensing information.
*/
_source: SourceInfo;
suggestions?: Suggestions;
/**
* @experimental
*/
tags?: Record<DictKey, Record<DictKey, Tag>>;
features: MarkdownString[];
summary?: MarkdownString;
description: MarkdownString;
quest_starter?: MarkdownString;
your_truth?: MarkdownString;
/**
* The suggested challenge rank for this NPC.
*/
rank: ChallengeRank;
nature: NpcNature;
drives: MarkdownString[];
tactics: MarkdownString[];
/**
* @remarks Deserialize as a dictionary object.
*/
variants?: Record<DictKey, NpcVariant>;
type: 'npc';
}
export interface NpcCollection {
/**
* The unique Datasworn ID for this item.
*/
_id: NpcCollectionId;
/**
* Any implementation hints or other developer-facing comments on this object. These should be omitted when presenting the object for gameplay.
*/
_comment?: string;
/**
* The primary name/label for this item.
*/
name: Label;
/**
* The name of this item as it appears on the page in the book, if it's different from `name`.
*/
canonical_name?: Label;
/**
* Attribution for the original source (such as a book or website) of this item, including the author and licensing information.
*/
_source: SourceInfo;
suggestions?: Suggestions;
/**
* @experimental
*/
tags?: Record<DictKey, Record<DictKey, Tag>>;
/**
* A thematic color associated with this collection.
*/
color?: CssColor;
/**
* A brief summary of this collection, no more than a few sentences in length. This is intended for use in application tooltips and similar sorts of hints. Longer text should use the "description" key instead.
*/
summary?: MarkdownString;
/**
* A longer description of this collection, which might include multiple paragraphs. If it's only a couple sentences, use the `summary` key instead.
*/
description?: MarkdownString;
images?: WebpImageUrl[];
/**
* An SVG icon associated with this collection.
*/
icon?: SvgImageUrl;
type: 'npc_collection';
/**
* This collection's content enhances the identified collection, rather than being a standalone collection of its own.
*/
enhances?: NpcCollectionId;
/**
* This collection replaces the identified collection. References to the replaced collection can be considered equivalent to this collection.
*/
replaces?: NpcCollectionId;
/**
* @remarks Deserialize as a dictionary object.
*/
contents?: Record<DictKey, Npc>;
}
/**
* A localized category label describing the nature of this NPC.
*
* In Ironsworn classic, this is probably the singular form of the parent collection's name.
*
* For Starforged, see the table on p. 258 for examples.
* @example "Ironlander"
* @example "Firstborn"
* @example "Animal"
* @example "Beast"
* @example "Horror"
* @example "Anomaly"
* @example "Creature"
* @example "Human"
* @example "Machine"
* @example "Monster"
* @example "Vehicle"
*/
export type NpcNature = Label;
export interface NpcVariant {
/**
* The unique Datasworn ID for this item.
*/
_id: NpcVariantId;
/**
* Any implementation hints or other developer-facing comments on this object. These should be omitted when presenting the object for gameplay.
*/
_comment?: string;
name: Label;
/**
* The suggested challenge rank for this NPC.
*/
rank: ChallengeRank;
nature: NpcNature;
summary?: MarkdownString;
description: MarkdownString;
}
/**
* A simple dice roll expression with an optional modifer.
* @pattern ```javascript
* /([1-9][0-9]*)d([1-9][0-9]*)([+-]([1-9][0-9]*))?/
* ```
* @example "1d100"
* @example "1d6+2"
*/
export type DiceExpression = string;
/**
* Special roll instructions to use when rolling multiple times on a single oracle.
*
* - `reroll`: Duplicate results should be re-rolled.
* - `keep`: Duplicates results should be kept.
* - `make_it_worse`: Duplicate results should be kept, and they compound to make things worse.
*/
export type OracleDuplicateBehavior = 'reroll' | 'keep' | 'make_it_worse';
export interface OracleMatchBehavior {
text: MarkdownString;
}
export interface OracleRoll {
/**
* The ID of the oracle to be rolled. A `null` value indicates that it's a roll on the same table.
* @default null
*/
oracle: OracleRollableId | null;
/**
* Both Ironsworn and Starforged explicitly recommend *against* rolling all details at once. That said, some oracle results only provide useful information once a secondary roll occurs, such as "Action + Theme" or "Roll twice".
* @default false
*/
auto: boolean;
/**
* Special rules on how to handle duplicate results, when rolling multiple times.
* @default "reroll"
*/
duplicates: OracleDuplicateBehavior;
/**
* The dice roll to make on the oracle table. Set it to `null` if you just want the table's default.
* @default null
*/
dice: DiceExpression | null;
/**
* The number of times to roll.
* @default 1
* @minimum 1
*/
number_of_rolls: number;
}
/**
* Provides string templates that may be used in place of the static row text from `OracleTableRow#text`, `OracleTableRow#text2`, and `OracleTableRow#text3`.
*
* These strings are formatted in Markdown, but use a special syntax for their placeholders: `{{text:some_oracle_table_id}}`. The placeholder should be replaced with the value of a rolled (or selected) `OracleTableRow#text` from the target oracle table ID.
* @experimental
*/
export interface OracleRollTemplate {
/**
* A string template that may be used in place of OracleTableRow#text.
* @example "{{text:starforged/oracles/factions/affiliation}} of the {{text:starforged/oracles/factions/legacy}} {{text:starforged/oracles/factions/identity}}"
*/
text?: TemplateString;
/**
* A string template that may be used in place of OracleTableRow#text2.
*/
text2?: TemplateString;
/**
* A string template that may be used in place of OracleTableRow#text3.
*/
text3?: TemplateString;
}
/**
* @remarks Deserialize as a discriminated union/polymorphic object type, using the `oracle_type` property as a discriminator.
*/
export type OracleCollection = OracleTablesCollection | OracleTableSharedRolls | OracleTableSharedText | OracleTableSharedText2 | OracleTableSharedText3;
/**
* Represents a single column in an OracleCollection.
*/
export interface OracleColumnText {
/**
* The unique Datasworn ID for this item.
*/
_id: OracleRollableId;
/**
* Any implementation hints or other developer-facing comments on this object. These should be omitted when presenting the object for gameplay.
*/
_comment?: string;
/**
* The primary label at the head of this column.
*/
name: Label;
/**
* Optional secondary text at the head of this column. For best results, this should be no more than a few words in length.
*/
summary?: MarkdownString;
/**
* An optional thematic color for this column. For an example, see "Basic Creature Form" (Starforged p. 337)
*/
color?: CssColor;
/**
* An optional icon for this column.
*/
icon?: SvgImageUrl;
/**
* Indicates that this object replaces the identified OracleRollable. References to the replaced object can be considered equivalent to this object.
*/
replaces?: OracleRollableId;
/**
* The roll used to select a result on this oracle.
* @default "1d100"
*/
dice: DiceExpression;
/**
* Most oracle tables are insensitive to matches, but a few define special match behavior.
*/
match?: OracleMatchBehavior;
/**
* @experimental
*/
tags?: Record<DictKey, Record<DictKey, Tag>>;
suggestions?: Suggestions;
type: 'oracle_rollable';
/**
* An array of objects, each representing a single row of the table.
*/
rows: OracleTableRowText[];
oracle_type: 'column_text';
}
export interface OracleColumnText2 {
/**
* The unique Datasworn ID for this item.
*/
_id: OracleRollableId;
/**
* Any implementation hints or other developer-facing comments on this object. These should be omitted when presenting the object for gameplay.
*/
_comment?: string;
/**
* The primary label at the head of this column.
*/
name: Label;
/**
* Optional secondary text at the head of this column. For best results, this should be no more than a few words in length.
*/
summary?: MarkdownString;
/**
* An optional thematic color for this column. For an example, see "Basic Creature Form" (Starforged p. 337)
*/
color?: CssColor;
/**
* An optional icon for this column.
*/
icon?: SvgImageUrl;
/**
* Indicates that this object replaces the identified OracleRollable. References to the replaced object can be considered equivalent to this object.
*/
replaces?: OracleRollableId;
/**
* The roll used to select a result on this oracle.
* @default "1d100"
*/
dice: DiceExpression;
/**
* Most oracle tables are insensitive to matches, but a few define special match behavior.
*/
match?: OracleMatchBehavior;
/**
* @experimental
*/
tags?: Record<DictKey, Record<DictKey, Tag>>;
suggestions?: Suggestions;
type: 'oracle_rollable';
/**
* An array of objects, each representing a single row of the table.
*/
rows: Array<OracleTableRowText2>;
oracle_type: 'column_text2';
}
export interface OracleColumnText3 {
/**
* The unique Datasworn ID for this item.
*/
_id: OracleRollableId;
/**
* Any implementation hints or other developer-facing comments on this object. These should be omitted when presenting the object for gameplay.
*/
_comment?: string;
/**
* The primary label at the head of this column.
*/
name: Label;
/**
* Optional secondary text at the head of this column. For best results,