@yeoman/namespace
Version:
Namespace parsing for yeoman's generator/environment stack
59 lines (58 loc) • 1.68 kB
TypeScript
type ParsedNamespace = {
complete: string;
scope?: string;
unscoped: string;
generator: string;
instanceId?: string;
semver?: string;
method?: string;
flags: any;
};
export declare class YeomanNamespace {
_original: string;
scope?: string;
unscoped: string;
generator: string;
instanceId?: string;
semver?: string;
methods?: string[];
flags?: any;
command?: any;
constructor(parsed: ParsedNamespace);
get _scopeAddition(): string;
get generatorName(): string;
get instanceName(): string;
get complete(): string;
get packageNamespace(): string;
get namespace(): string;
set namespace(namespace: string);
get unscopedNamespace(): string;
get id(): string;
get generatorHint(): string;
get versionedHint(): string;
with(newValues: Partial<ParsedNamespace>): YeomanNamespace;
toString(): string;
private _semverAddition;
private _update;
}
/**
* Convert a namespace to a namespace object
*/
export declare function toNamespace(namespace: string | YeomanNamespace): YeomanNamespace | undefined;
/**
* Convert a package name to a namespace object
*
* @throws if not a valid generator package name (starts with 'generator-')
*/
export declare function namespaceFromPackageName(packageName: string): YeomanNamespace;
/**
* Convert a namespace to a namespace object
*
* @throws if not a valid namespace
*/
export declare function requireNamespace(namespace: string | YeomanNamespace): YeomanNamespace;
/**
* Test if the object is an YeomanNamespace instance.
*/
export declare function isNamespaceObject(namespace: unknown): boolean;
export {};