Skip to main content
Home

Système de gestion des ressources de cohabit.

This package works with Deno
This package works with Deno
JSR Score
52%
Published
a year ago (0.2.1)
class Ref
extends String

Constructors

new
Ref(unnamed 0: { uuid: UUID; type: T["type"]; })

Type Parameters

T extends Resource

Properties

readonly
type: T["type"]
readonly
uuid: UUID

Methods

ref(resolver: RefResolver<T>): T | Promise<T>
toJSON(): `@ref/${T["type"]}#${UUID}`
toString(): `@ref/${T["type"]}#${UUID}`

Static Methods

dbResolver(db: Db): <T extends Resource>(ref: RefString<T>) => Promise<T>
fromResource<T extends Resource>(resource: T): Ref<T>
fromString<T extends Resource>(string: RefString<T>): Ref<T>
parse<T extends Resource>(string: RefString<T>): { type: T["type"]; uuid: UUID; }
restResolver(endpoint: string | URL): <T extends Resource>(ref: RefString<T>) => Promise<T>

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@cohabit/resources-manager

Import symbol

import { Ref } from "@cohabit/resources-manager/models";
or

Import directly with a jsr specifier

import { Ref } from "jsr:@cohabit/resources-manager/models";