studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
46 lines (45 loc) • 1.7 kB
TypeScript
import { Effect, HTTPClient, Platform, Schema } from '../../../effect.js';
declare const NpmVersion_base: Schema.Class<NpmVersion, {
version: typeof Schema.String;
}, Schema.Struct.Encoded<{
version: typeof Schema.String;
}>, never, {
readonly version: string;
}, {}, {}>;
/**
* Represents the version information retrieved from NPM.
*
* @extends Schema.Class<NpmVersion>
* @property version - The version string of the NPM package.
*/
export declare class NpmVersion extends NpmVersion_base {
}
declare const GetVersionFromNPM_base: Effect.Service.Class<GetVersionFromNPM, "studiocms/sdk/effect/GetVersionFromNPM", {
readonly effect: Effect.Effect<{
get: (pkg: string, ver?: string) => Effect.Effect<string, Platform.HttpClientError.HttpClientError | import("effect/ParseResult").ParseError, never>;
}, never, HTTPClient>;
readonly dependencies: readonly [import("effect/Layer").Layer<HTTPClient, never, never>];
}>;
/**
* An Effect service for retrieving the version of an NPM package from the NPM registry.
*
* @remarks
* This service uses an HTTP client with retry logic to fetch the version information
* for a given package and version (defaulting to 'latest') from the NPM registry.
*
* @example
* ```typescript
* const version = await GetVersionFromNPM.get('react');
* ```
*
* @service
* - Depends on `FetchHttpClient.layer` for HTTP requests.
*
* @method get
* @param pkg - The name of the NPM package.
* @param ver - The version tag or number (defaults to 'latest').
* @returns An Effect that resolves to the version string of the specified package.
*/
export declare class GetVersionFromNPM extends GetVersionFromNPM_base {
}
export {};