PackageReference
Document a library and its declared compatibility.
On this page
example-sdk
Compatibility
- Example: ES modules
| Name | Type | Required | Description |
|---|---|---|---|
Client | class | — | Example client. |
View code
import PackageReference from "@chitrank2050/monoline-docs/components/PackageReference.astro";
<PackageReference
name="example-sdk"
packageHref="<https://example.com/package"
> compatibility={["Example: ES modules"]}
exports={[
{
name: "Client",
type: "class",
description: "Example client.",
},
]}
/>Usage
Compatibility is authored by you and is not inferred from package metadata. The default slot holds examples or supporting content.
Source link and example
example-sdk1.0.0
Compatibility
- Example: Node.js
| Name | Type | Required | Description |
|---|---|---|---|
Client | class | — | Example client. |
import { Client } from 'example-sdk'View code
import CodeBlock from "@chitrank2050/monoline-docs/components/CodeBlock.astro";
import PackageReference from "@chitrank2050/monoline-docs/components/PackageReference.astro";
<PackageReference
name="example-sdk"
version="1.0.0"
packageHref="<https://example.com/package"
> sourceHref="<https://example.com/source"
> compatibility={["Example: Node.js"]}
exports={[
{
name: "Client",
type: "class",
description: "Example client.",
},
]}
>
<CodeBlock
code="import { Client } from 'example-sdk'"
language="js"
/>
</PackageReference>API reference
| Name | Type | Default | Description |
|---|---|---|---|
name | string | Required | Library name. |
version | string | — | Displayed version. |
packageHref | string | Required | Absolute HTTP(S) URL without credentials. |
sourceHref | string | — | Optional absolute source URL. |
compatibility | string[] | Required | Nonempty explicitly authored environments. |
exports | Row[] | Required | Export rows with name, type, description and optional required. |
Behavior and accessibility
Compatibility is declared by the author. Verify package links and supported environments before publishing the reference.