File tree Expand file tree Collapse file tree 4 files changed +13
-14
lines changed Expand file tree Collapse file tree 4 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ interface RegisteredTargetAttributes {
2424 * An object that represents a link's target attributes.
2525 * @see {@link https://tools.ietf.org/html/draft-ietf-httpapi-linkset-00#section-4.2.4|draft-ietf-httpapi-linkset-00: Linkset §4.2.4 }
2626 */
27- interface TargetAttributes extends RegisteredTargetAttributes {
27+ export interface TargetAttributes extends RegisteredTargetAttributes {
2828 readonly [ name : string ] : string | string [ ] | InternationalizedValue [ ] ;
2929}
3030
Original file line number Diff line number Diff line change 1- import { LinkInterface , Link } from './link' ;
2- import { LinksetInterface as NormalizedLinksetInterface , TargetObject } from '../spec/linkset-json'
1+ import { Link } from './link' ;
2+ import type { LinkInterface } from './link' ;
3+ import type { LinksetInterface as NormalizedLinksetInterface , TargetObject } from '../spec/linkset-json'
34
45/**
56 * A set of links and useful link utilities.
@@ -72,14 +73,10 @@ export class Linkset implements NormalizableLinksetInterface<NormalizedLinksetIn
7273 * {@inheritDoc LinksetInterface.elements }
7374 */
7475 readonly elements : LinkInterface [ ] ;
76+ readonly size : number ;
7577 constructor ( links : LinkInterface [ ] ) {
7678 this . elements = links ;
77- }
78- /**
79- * {@inheritDoc LinksetInterface.size }
80- */
81- get size ( ) : number {
82- return this . elements . length ;
79+ this . size = links . length ;
8380 }
8481 /**
8582 * {@inheritDoc LinksetInterface.hasLinkTo }
Original file line number Diff line number Diff line change 1- import { LinksetInterface as NormalizedLinksetInterface } from './spec/linkset-json' ;
2- import { LinkInterface } from './core/link' ;
3- import { Linkset , LinksetInterface , NormalizableLinksetInterface } from './core/linkset' ;
1+ import { Linkset } from './core/linkset' ;
2+ import type { LinksetInterface as NormalizedLinksetInterface } from './spec/linkset-json' ;
3+ import type { LinkInterface } from './core/link' ;
4+ import type { LinksetInterface , NormalizableLinksetInterface } from './core/linkset' ;
45
56/**
67 * Denormalizes a set of links into an instance of a Linkset.
Original file line number Diff line number Diff line change 1- import { TargetAttributes } from './link' ;
1+ import type { TargetAttributes } from '../core /link' ;
22
33/**
44 * An object that represents a link target object from the linkset spec.
@@ -12,8 +12,9 @@ export interface TargetObject extends TargetAttributes {
1212 * An object that represents a link context object from the linkset spec.
1313 * @see {@link https://tools.ietf.org/html/draft-ietf-httpapi-linkset-00#section-4.2.2|draft-ietf-httpapi-linkset-00: Linkset §4.2.2 }
1414 */
15- interface ContextObject {
15+ type ContextObject = {
1616 anchor : string ;
17+ } & {
1718 [ rel : string ] : TargetObject [ ] ;
1819}
1920
You can’t perform that action at this time.
0 commit comments