InternalModels

Builds domain models for the previews and tests of lib/ui.

The models' own constructors are internal, which is what stops anyone outside lib/core from building one and lets the SDK add fields to them without breaking callers. internal is module-scoped, though, so lib/ui cannot reach them either, and its previews and tests have to build fixtures somehow. lib/core's own tests are inside that scope and could call the constructors directly; they come through here for the defaults below.

This lives in the debug source set rather than being public: a marker would only ask callers not to look, while a debug-only declaration is absent from the release artifact, so a consumer cannot reach it at all. It stays public because lib/ui resolves lib/core's debug variant and would not see it otherwise.

Every parameter that can carry a neutral default does, so a caller states only what its case is about. That also means adding a property to a model costs one defaulted parameter here rather than a signature every caller has to migrate.

Consumers face the same wall with no equivalent escape hatch, which is what the planned cgs-core-testing artifact is for.

Functions

Link copied to clipboard
fun article(id: <Error class: unknown class> = ArticleId(""), primeImage: <Error class: unknown class>? = null, title: String = "", surTitle: String? = null, subTitle: String? = null, author: String? = null, theme: String? = null, subTheme: String? = null, elements: List<<Error class: unknown class>> = emptyList(), preview: String? = null, wordCount: Long = 0, abstractLayout: String? = null, templateId: <Error class: unknown class> = TemplateId(0), issueId: <Error class: unknown class>? = null, articleNumber: Int? = null, pages: List<Int>? = null, themeTags: List<String> = emptyList(), publicationId: <Error class: unknown class>? = null, formattedUrl: String? = null, language: String? = null, mediaTrackId: <Error class: unknown class>? = null, isAdvertisement: Boolean = false, articlePath: String? = null, isDigitalArticle: Boolean = false, readingTime: Int = 0): <Error class: unknown class>
Link copied to clipboard
fun articleImage(type: String = "image", url: String = "", caption: String? = null, width: Int = 0, height: Int = 0): <Error class: unknown class>
Link copied to clipboard
fun edition(id: <Error class: unknown class> = PublicationId(""), name: String = ""): <Error class: unknown class>
Link copied to clipboard
fun enrichmentArticle(issueId: <Error class: unknown class> = IssueId(""), page: Int = 0, width: Double = 0.0, height: Double = 0.0, top: Double = 0.0, left: Double = 0.0, target: String = ""): <Error class: unknown class>
Link copied to clipboard
fun enrichmentLink(issueId: <Error class: unknown class> = IssueId(""), page: Int = 0, width: Double = 0.0, height: Double = 0.0, top: Double = 0.0, left: Double = 0.0, target: String = ""): <Error class: unknown class>
Link copied to clipboard
fun enrichmentUnknown(issueId: <Error class: unknown class> = IssueId(""), page: Int = 0, width: Double = 0.0, height: Double = 0.0, top: Double = 0.0, left: Double = 0.0, target: String = ""): <Error class: unknown class>
Link copied to clipboard
fun issueShort(id: <Error class: unknown class> = IssueId(""), title: String = "", publicationId: <Error class: unknown class> = PublicationId(""), publication: <Error class: unknown class>? = null, releaseDate: Instant = Instant.fromEpochMilliseconds(0), issueNumber: Int? = null, cover: String? = null): <Error class: unknown class>
Link copied to clipboard
fun publication(id: <Error class: unknown class> = PublicationId(""), title: String = "", releaseFrequencyId: <Error class: unknown class> = ReleaseFrequencyId(""), mediaId: <Error class: unknown class>? = null, topicIds: List<<Error class: unknown class>> = emptyList(), type: <Error class: unknown class> = ContentType.PDF, source: <Error class: unknown class> = ContentSource.MAGAZINE, lastIssue: <Error class: unknown class>? = null, langIds: List<<Error class: unknown class>> = emptyList(), availableYears: List<Int> = emptyList(), multiEdition: <Error class: unknown class>? = null): <Error class: unknown class>
Link copied to clipboard
fun publicationReference(id: <Error class: unknown class> = PublicationId(""), title: String = "", releaseFrequencyId: <Error class: unknown class> = ReleaseFrequencyId(""), mediaId: <Error class: unknown class>? = null, topicIds: List<<Error class: unknown class>> = emptyList(), type: <Error class: unknown class> = ContentType.PDF, source: <Error class: unknown class> = ContentSource.MAGAZINE): <Error class: unknown class>