UNPKG

ts-japi

Version:

A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification

17 lines 781 B
import type Link from "../models/link.model"; import type { Dictionary, nullish } from "../types/global.types"; import type Relationship from "./relationship.model"; import ResourceIdentifier, { type ResourceIdentifierOptions } from "./resource-identifier.model"; /** @internal */ export interface ResourceOptions<T> extends ResourceIdentifierOptions { attributes?: Partial<T>; links?: Dictionary<Link>; relationships?: Record<string, Relationship>; } export default class Resource<T = Dictionary<any>> extends ResourceIdentifier { attributes?: Partial<T>; links?: Dictionary<Link | nullish>; relationships?: Record<string, Relationship>; constructor(id: string, type: string, options: ResourceOptions<T>); } //# sourceMappingURL=resource.model.d.ts.map