Reference
tilttek/journalEvery public type of the package, with its role. The types marked internal may change in any version.
The journal
| Type | Role |
|---|---|
Journal | The service: draft, assemble, get, list, retitle, write, accept, publish, withdraw and remove entries; read and timeline for a reader. |
Entry | An entry of a journal: its genre, author, title, blocks, audience, subject, state, time of publication and version. |
Genre | Session, character, solo or play; whether a genre needs a subject. |
EntryState | Draft or published. |
Audience | Everyone, the game master and the author, or the author alone. |
Block | A block of an entry: its text, kind, audience, secret, origin, source and mentions. |
BlockKind | Text, roll, oracle, prompt or event. |
BlockOrigin | Written, assembled or proposed. |
SessionEvent | Something that happened in a session, summed up for a draft. |
WriterRotation | Names the next writer of a session's summary. |
Mention | A page named in a text: the name, the text shown and its source. |
Mentions | Reads the mentions of a text, in one pass. |
An entry as a reader sees it
| Type | Role |
|---|---|
Reader | Who reads: a person and a snapshot of what they know. |
EntryView | An entry as one reader sees it, and its arrays for JSON. |
BlockView | A block as one reader sees it: its segments and its plain text. |
Segment | A piece of a block: text, or a link to a page. |
SegmentKind | Text or link. |
Export\MarkdownExport | Writes entries as one Markdown document. |
Ports and stores
| Type | Role |
|---|---|
Contract\JournalStoreInterface | Keeps the entries at a version. |
Contract\PageDirectoryInterface | Says which page each name leads to, for one reader. |
Contract\SessionEventSourceInterface | Gives what happened in a session. |
Contract\JournalObserverInterface | Told of the events of a journal. |
Store\InMemoryJournalStore | The entries in memory, for tests. |
Events
| Type | Role |
|---|---|
Event\JournalEventInterface | Every event. |
Event\EntryDrafted | An entry was drafted. |
Event\EntryChanged | An entry changed. |
Event\EntryPublished | An entry was published, with its genre and author. |
Event\EntryWithdrawn | A published entry went back to a draft. |
Event\EntryRemoved | An entry was erased. |
Exceptions
| Type | Role |
|---|---|
Exception\JournalExceptionInterface | Every exception of the library. |
Exception\InvalidJournal | A value out of its shape or its bounds. |
Exception\JournalRefused | A call well formed but not allowed. |
Exception\EntryNotFound | No entry, or one the reader may not read. |
Exception\JournalConflict | The entry changed since it was read. |
Internal
| Type | Role |
|---|---|
Internal\Identifier | The shape of an identifier. |
Internal\Text | The shapes of a title, a name and the text of a block. |