Skip to content

Reference

tilttek/journal

Every public type of the package, with its role. The types marked internal may change in any version.

The journal

TypeRole
JournalThe service: draft, assemble, get, list, retitle, write, accept, publish, withdraw and remove entries; read and timeline for a reader.
EntryAn entry of a journal: its genre, author, title, blocks, audience, subject, state, time of publication and version.
GenreSession, character, solo or play; whether a genre needs a subject.
EntryStateDraft or published.
AudienceEveryone, the game master and the author, or the author alone.
BlockA block of an entry: its text, kind, audience, secret, origin, source and mentions.
BlockKindText, roll, oracle, prompt or event.
BlockOriginWritten, assembled or proposed.
SessionEventSomething that happened in a session, summed up for a draft.
WriterRotationNames the next writer of a session's summary.
MentionA page named in a text: the name, the text shown and its source.
MentionsReads the mentions of a text, in one pass.

An entry as a reader sees it

TypeRole
ReaderWho reads: a person and a snapshot of what they know.
EntryViewAn entry as one reader sees it, and its arrays for JSON.
BlockViewA block as one reader sees it: its segments and its plain text.
SegmentA piece of a block: text, or a link to a page.
SegmentKindText or link.
Export\MarkdownExportWrites entries as one Markdown document.

Ports and stores

TypeRole
Contract\JournalStoreInterfaceKeeps the entries at a version.
Contract\PageDirectoryInterfaceSays which page each name leads to, for one reader.
Contract\SessionEventSourceInterfaceGives what happened in a session.
Contract\JournalObserverInterfaceTold of the events of a journal.
Store\InMemoryJournalStoreThe entries in memory, for tests.

Events

TypeRole
Event\JournalEventInterfaceEvery event.
Event\EntryDraftedAn entry was drafted.
Event\EntryChangedAn entry changed.
Event\EntryPublishedAn entry was published, with its genre and author.
Event\EntryWithdrawnA published entry went back to a draft.
Event\EntryRemovedAn entry was erased.

Exceptions

TypeRole
Exception\JournalExceptionInterfaceEvery exception of the library.
Exception\InvalidJournalA value out of its shape or its bounds.
Exception\JournalRefusedA call well formed but not allowed.
Exception\EntryNotFoundNo entry, or one the reader may not read.
Exception\JournalConflictThe entry changed since it was read.

Internal

TypeRole
Internal\IdentifierThe shape of an identifier.
Internal\TextThe shapes of a title, a name and the text of a block.