Wiki source code of Front-End Model API
Last modified by Pierre Jeanjean on 2026/05/18 17:08
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | == Entity Types == | ||
| 2 | |||
| 3 | {{code language="typescript"}} | ||
| 4 | /** | ||
| 5 | * @since 18.0.0RC1 | ||
| 6 | */ | ||
| 7 | enum EntityType { | ||
| 8 | WIKI, | ||
| 9 | SPACE, | ||
| 10 | DOCUMENT, | ||
| 11 | ATTACHMENT, | ||
| 12 | } | ||
| 13 | {{/code}} | ||
| 14 | |||
| 15 | == Entities == | ||
| 16 | |||
| 17 | {{code language="typescript"}} | ||
| 18 | /** | ||
| 19 | * @since 18.0.0RC1 | ||
| 20 | */ | ||
| 21 | interface BaseEntityReference { | ||
| 22 | type: EntityType; | ||
| 23 | } | ||
| 24 | {{/code}} | ||
| 25 | |||
| 26 | === WikiReference === | ||
| 27 | |||
| 28 | {{code language="typescript"}} | ||
| 29 | /** | ||
| 30 | * @since 18.0.0RC1 | ||
| 31 | */ | ||
| 32 | class WikiReference implements BaseEntityReference { | ||
| 33 | type: EntityType.WIKI = EntityType.WIKI; | ||
| 34 | name: string; | ||
| 35 | } | ||
| 36 | {{/code}} | ||
| 37 | |||
| 38 | === SpaceReference === | ||
| 39 | |||
| 40 | {{code language="typescript"}} | ||
| 41 | /** | ||
| 42 | * @since 18.0.0RC1 | ||
| 43 | */ | ||
| 44 | class SpaceReference implements BaseEntityReference { | ||
| 45 | type: EntityType.SPACE = EntityType.SPACE; | ||
| 46 | wiki?: WikiReference; | ||
| 47 | names: string[]; | ||
| 48 | } | ||
| 49 | {{/code}} | ||
| 50 | |||
| 51 | === DocumentReference === | ||
| 52 | |||
| 53 | {{code language="typescript"}} | ||
| 54 | /** | ||
| 55 | * @since 18.0.0RC1 | ||
| 56 | */ | ||
| 57 | class DocumentReference implements BaseEntityReference { | ||
| 58 | type: EntityType.DOCUMENT = EntityType.DOCUMENT; | ||
| 59 | space?: SpaceReference; | ||
| 60 | name: string; | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Indicates whether the current document reference is terminal. | ||
| 64 | * @since 18.0.0RC1 | ||
| 65 | */ | ||
| 66 | terminal: boolean; | ||
| 67 | |||
| 68 | /** | ||
| 69 | * The locale of the referenced document. | ||
| 70 | * @since 18.4.0RC1 | ||
| 71 | */ | ||
| 72 | locale?: string; | ||
| 73 | } | ||
| 74 | {{/code}} | ||
| 75 | |||
| 76 | === AttachmentReference === | ||
| 77 | |||
| 78 | {{code language="typescript"}} | ||
| 79 | /** | ||
| 80 | * @since 18.0.0RC1 | ||
| 81 | */ | ||
| 82 | class AttachmentReference implements BaseEntityReference { | ||
| 83 | type: EntityType.ATTACHMENT = EntityType.ATTACHMENT; | ||
| 84 | name: string; | ||
| 85 | document: DocumentReference; | ||
| 86 | |||
| 87 | /** | ||
| 88 | * @since 18.0.0RC1 | ||
| 89 | */ | ||
| 90 | private readonly _metadata: Record<string, string>; | ||
| 91 | } | ||
| 92 | {{/code}} |