UNPKG

@siren-js/client

Version:
50 lines (49 loc) 1.68 kB
import { SirenElementVisitor } from '../visitor'; import { Action } from './action'; import { Link } from './link'; import { SirenElement } from './siren-element'; import { SubEntity } from './sub-entity'; /** * Represents an embedded URI-addressable resource */ export declare class EmbeddedEntity<T extends object = object> implements SirenElement { /** * Available behavior exposed by the `EmbeddedEntity` */ actions: Action[]; /** * List of strings describing the nature of the `EmbeddedEntity` based on the current representation. Possible values * are implementation-dependent and should be documented. */ class: string[]; /** * Related entities represented as embedded links or representations */ entities: SubEntity[]; /** * Navigation links that communicate ways to navigate outside the entity graph */ links: Link[]; /** * Key-value pairs describing the state of the `Entity` */ properties: T; /** * List of strings describing the relationship of the `EmbeddedEntity` to its parent, per [RFC 8288](https://tools.ietf.org/html/rfc8288). */ rel: string[]; /** * Descriptive text about the `Entity` */ title?: string; [extensions: string]: unknown; /** * Visits this entity's {@linkcode actions}, {@linkcode entities}, and * {@linkcode links}, followed by the entity itself. */ accept(visitor: SirenElementVisitor): Promise<void>; /** * Returns the `Action` in `actions` with the given `name`, if it exists. Otherwise, returns `undefined`. */ getAction(name: string): Action | undefined; }