Skip to main content

Class: UserTextMarkupRepository

Defined in: Data/Repositories/UserTextMarkupRepository.ts:10

Repository interface for user text markup (highlights, underlines, etc.)

Implements

Constructors

Constructor

new UserTextMarkupRepository(sql): UserTextMarkupRepository

Defined in: Data/Repositories/UserTextMarkupRepository.ts:11

Parameters

sql

ISql

Returns

UserTextMarkupRepository

Methods

countForModule()

countForModule(moduleId): Promise<number>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:186

Count total markups for a module

Parameters

moduleId

number

Returns

Promise<number>

Implementation of

IUserTextMarkupRepository.countForModule


create()

create(markup): Promise<UserTextMarkup>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:13

Create a new markup Automatically resolves overlaps before inserting

Parameters

markup

UserTextMarkup

Returns

Promise<UserTextMarkup>

Implementation of

IUserTextMarkupRepository.create


delete()

delete(markupId): Promise<void>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:71

Delete a markup by ID

Parameters

markupId

number

Returns

Promise<void>

Implementation of

IUserTextMarkupRepository.delete


deleteForVerse()

deleteForVerse(verseId, moduleId): Promise<void>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:162

Delete all markups for a specific verse

Parameters

verseId

number

moduleId

number

Returns

Promise<void>

Implementation of

IUserTextMarkupRepository.deleteForVerse


deleteForVerseRange()

deleteForVerseRange(startVerseId, endVerseId, moduleId): Promise<void>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:172

Delete all markups in a verse range (e.g., entire chapter)

Parameters

startVerseId

number

endVerseId

number

moduleId

number

Returns

Promise<void>

Implementation of

IUserTextMarkupRepository.deleteForVerseRange


findOverlapping()

findOverlapping(verseIdStart, verseIdEnd, moduleId): Promise<UserTextMarkup[]>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:195

Find overlapping markups (for conflict resolution)

Parameters

verseIdStart

number

verseIdEnd

number | null

moduleId

number

Returns

Promise<UserTextMarkup[]>

Implementation of

IUserTextMarkupRepository.findOverlapping


getByColor()

getByColor(color, moduleId?): Promise<UserTextMarkup[]>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:137

Find markup by colour.

WS-7 v1 COMPAT: matches BOTH encodings — the canonical hex and the legacy palette name — because live user data holds a mixture until a user-database migration rewrites it. The palette name is derived from the resolved colour, so callers get the same rows whether they pass 'yellow' or '#FFF3A3'. Pass-2 deletion point: match on hex alone.

Parameters

color

string

moduleId?

number

Returns

Promise<UserTextMarkup[]>

Implementation of

IUserTextMarkupRepository.getByColor


getById()

getById(markupId): Promise<UserTextMarkup | null>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:78

Get a markup by ID

Parameters

markupId

number

Returns

Promise<UserTextMarkup | null>

Implementation of

IUserTextMarkupRepository.getById


getByNote()

getByNote(noteId): Promise<UserTextMarkup[]>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:153

Get all markups linked to a specific note

Parameters

noteId

number

Returns

Promise<UserTextMarkup[]>

Implementation of

IUserTextMarkupRepository.getByNote


getForModule()

getForModule(moduleId): Promise<UserTextMarkup[]>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:117

Get all markups in a specific module

Parameters

moduleId

number

Returns

Promise<UserTextMarkup[]>

Implementation of

IUserTextMarkupRepository.getForModule


getForVerse()

getForVerse(verseId, moduleId): Promise<UserTextMarkup[]>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:87

Get all markups for a specific verse in a specific module

Parameters

verseId

number

moduleId

number

Returns

Promise<UserTextMarkup[]>

Implementation of

IUserTextMarkupRepository.getForVerse


getForVerseRange()

getForVerseRange(startVerseId, endVerseId, moduleId): Promise<UserTextMarkup[]>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:100

Get all markups for a verse range in a specific module Useful for loading highlights for a chapter

Parameters

startVerseId

number

endVerseId

number

moduleId

number

Returns

Promise<UserTextMarkup[]>

Implementation of

IUserTextMarkupRepository.getForVerseRange


update()

update(markup): Promise<void>

Defined in: Data/Repositories/UserTextMarkupRepository.ts:40

Update an existing markup

Parameters

markup

UserTextMarkup

Returns

Promise<void>

Implementation of

IUserTextMarkupRepository.update