Skip to main content

Class: ScriptureReference

Defined in: Data/Models/Book/ScriptureReference.ts:15

Universal scripture reference model for tracking Bible verse mentions across all content types (books, commentaries, dictionaries, user notes, etc.)

Each module database (book_.db, commentary_.db, etc.) will have its own scripture_reference table linking to its content entries.

This allows the application to find all places in the user's library where a particular verse is mentioned or discussed.

Constructors

Constructor

new ScriptureReference(data): ScriptureReference

Defined in: Data/Models/Book/ScriptureReference.ts:52

Parameters

data
contentId

number

context?

string

metadata?

Metadata

position?

number

referenceId?

number

verseIdEnd?

number | null

verseIdStart

number

Returns

ScriptureReference

Properties

contentId

contentId: number

Defined in: Data/Models/Book/ScriptureReference.ts:25

The ID of the content entry that contains this reference For books: sectionId For commentaries: entryId For dictionaries: entryId For user content: noteId or documentId


context?

optional context?: string

Defined in: Data/Models/Book/ScriptureReference.ts:42

The surrounding text or context where the reference appears Useful for showing preview snippets in search results


metadata?

optional metadata?: Metadata

Defined in: Data/Models/Book/ScriptureReference.ts:50

Extensible metadata


position?

optional position?: number

Defined in: Data/Models/Book/ScriptureReference.ts:45

Position within the source content entry, for ordering multiple references


referenceId?

optional referenceId?: number

Defined in: Data/Models/Book/ScriptureReference.ts:16


verseIdEnd?

optional verseIdEnd?: number

Defined in: Data/Models/Book/ScriptureReference.ts:36

End of the verse reference range (NULL for single verse) e.g., for "Romans 8:28-39", verseIdEnd would be Romans 8:39


verseIdStart

verseIdStart: number

Defined in: Data/Models/Book/ScriptureReference.ts:30

Start of the verse reference range

Methods

containsVerse()

containsVerse(verseId): boolean

Defined in: Data/Models/Book/ScriptureReference.ts:104

Check if this reference contains a specific verse

Parameters

verseId

number

Returns

boolean


effectiveEnd()

effectiveEnd(): number

Defined in: Data/Models/Book/ScriptureReference.ts:74

Inclusive end of the range, defaulting to the start for single verses.

Returns

number


getTruncatedContext()

getTruncatedContext(maxLength?): string | undefined

Defined in: Data/Models/Book/ScriptureReference.ts:95

Get truncated context for display

Parameters

maxLength?

number = 150

Returns

string | undefined


getVerseCount()

getVerseCount(): number

Defined in: Data/Models/Book/ScriptureReference.ts:111

Get the verse range as a count

Returns

number


isRange()

isRange(): boolean

Defined in: Data/Models/Book/ScriptureReference.ts:88

Check if this reference is a verse range

Returns

boolean


isSingleVerse()

isSingleVerse(): boolean

Defined in: Data/Models/Book/ScriptureReference.ts:81

Check if this is a single verse reference (not a range)

Returns

boolean