UNPKG

@o3r/schematics

Version:

Schematics module of the Otter framework

53 lines 2.54 kB
import type { logging } from '@angular-devkit/core'; import { type PackageManagerOptions } from '../utility/index'; import { NpmRegistryPackage, OtterModuleTag } from './modules.constants'; /** * Determine if the given keyword is an Otter tag * @param keyword Keyword to identify * @param expect tag expected for the Otter keyword */ export declare const isOtterTag: <T extends string | undefined>(keyword: any, expect?: T) => keyword is OtterModuleTag<T extends undefined ? "" : T>; /** Options for getAvailableModules function */ export interface AvailableModuleOptions extends PackageManagerOptions { /** * Determine if only the packages that are NOT installed should be returned * @default false */ onlyNotInstalled?: boolean; /** * Npm Registry to fetch to get the package information * @default registry.npmjs.org */ npmRegistryToFetch?: string; } /** * Get Available Otter modules on NPMjs.org * @param keyword Keyword to search for Otter modules * @param scopeWhitelist List of whitelisted scopes * @param options */ export declare function getAvailableModules(keyword: string, scopeWhitelist: string[] | readonly string[], options?: AvailableModuleOptions): Promise<NpmRegistryPackage[]>; /** Options for getAvailableModulesWithLatestPackage function */ export interface AvailableModuleOptionsWithLatestPackage extends AvailableModuleOptions { /** * List of whitelisted scopes * @default {@see OTTER_MODULE_SUPPORTED_SCOPES} */ scopeWhitelist?: string[] | readonly string[]; } /** * Get Available Otter modules on NPMjs.org and get latest package information * Similar to {@link getAvailableModules} with additional calls to retrieve all the package's information * @param keyword Keyword to search for Otter modules * @param options */ export declare function getAvailableModulesWithLatestPackage(keyword: string | undefined, options: AvailableModuleOptionsWithLatestPackage): Promise<NpmRegistryPackage[]>; /** * Format a module description to be displayed in the terminal * @param npmPackage Npm Package to display * @param runner runner according to the context * @param keywordTags Mapping of the NPM package Keywords and a displayed tag * @param logger Logger to use to report package read failure (as debug message) */ export declare function formatModuleDescription(npmPackage: NpmRegistryPackage, runner?: string, keywordTags?: Record<string, string>, logger?: logging.LoggerApi): string; //# sourceMappingURL=modules.helpers.d.ts.map