/** * The Mango Annotation Profile. * * The parser decides whether a document is structurally valid. This file * decides which of the valid constructs Mango authors, and how a user chooses * between them. Keeping that in one place is what stops an application concept * reaching a standards field again: the vocabulary the inspector offers and the * vocabulary export validation enforces are read from the same list, so they * cannot drift the way a dropdown and a serializer did. */ import { ALL_MOTIVATIONS, PURPOSES, isKnownMotivation, isKnownPurpose, type ValidationProfile } from '@mango-iiif/w3c-parser'; /** * A task-oriented authoring choice. * * Users pick what they are doing, not a term from a vocabulary. The mapping to * a motivation and a body purpose is the profile's job, which is why the raw * motivation dropdown is now an expert-mode control rather than the only way to * set one. */ export type MotivationPreset = { /** Stable id, used as the i18n key suffix and the select value. */ id: string; motivation: string; /** Purpose applied to the body this preset authors, when it authors one. */ bodyPurpose?: string; /** True when the preset may only be chosen in expert content-authoring mode. */ expertOnly?: boolean; }; export declare const DEFAULT_MOTIVATION = "commenting"; export declare const DEFAULT_BODY_PURPOSE = "commenting"; export declare const isExpertMotivation: (value: string) => boolean; export declare const authoringMotivations: (expert?: boolean) => readonly string[]; export declare const motivationPresets: (expert?: boolean) => readonly MotivationPreset[]; export declare const presetForMotivation: (motivation: string) => MotivationPreset | undefined; /** Body purposes the inspector offers. A subset of the W3C purpose vocabulary. */ export declare const AUTHORING_PURPOSES: readonly string[]; /** Re-exported so callers validate against the parser's list, not a copy. */ export { ALL_MOTIVATIONS, PURPOSES, isKnownMotivation, isKnownPurpose }; /** * Prefix for annotations that have no server-assigned identity yet. * * A URN rather than an invented HTTP URL: a draft id must be impossible to * mistake for a resolvable one, because the whole point of marking it is that * something has to replace it before the document is published. */ export declare const DRAFT_ID_PREFIX = "urn:mango:draft:annotation/"; export declare const DRAFT_PAGE_ID_PREFIX = "urn:mango:draft:page/"; export declare const isDraftId: (id: string | undefined) => boolean; export declare const isHttpId: (id: string | undefined) => boolean; /** * Mints a draft identifier. * * Deliberately not random-only: a monotonic component keeps ids stable in test * order and readable in a diff, and the random component keeps two viewers on * the same page from colliding. */ export declare const mintDraftId: () => string; /** * Annotation-level extension keys Mango writes. * * `mango:note` is the private note. Modelling it as an application field rather * than a `describing` body is the whole of the privacy guarantee: a body is * publishable content by construction, so a private note stored as one is a * private note that will be published the first time someone exports. */ export declare const MANGO_NOTE_KEY = "mango:note"; /** Extension keys removed from any export not explicitly marked private. */ export declare const PRIVATE_EXTENSION_KEYS: readonly string[]; /** * Extension keys that carry Mango application state rather than user content. * * Excluded from standards-shaped output because they mean nothing outside * Mango, but not *private* — they are omitted for tidiness, not confidentiality, * and saying so keeps the privacy report honest about what it protects. */ export declare const APPLICATION_EXTENSION_KEYS: readonly string[]; export type MangoProfileOptions = { /** Permit the expert-only motivations. */ expert?: boolean; /** Require resolvable HTTP(S) ids. Off while a document is still a draft. */ requireHttpIds?: boolean; }; /** The full profile set for a Mango export: structure, IIIF, then Mango. */ export declare const mangoProfiles: (options?: MangoProfileOptions) => ValidationProfile[];