@next-boilerplate/cli-helpers
Version:
CLI helper for Next Boilerplate
61 lines (58 loc) • 1.72 kB
text/typescript
import { z } from 'zod';
import { TOptionalConfig } from '../config/index.mjs';
import { TStoreConfig, storeConfigSchema } from './index.mjs';
/**
* Get the stores directory path relative to the assets directory.
* @param assetsDirectory
* @returns
*/
declare const getStoresDirectory: (assetsDirectory: string) => string;
declare const getStoreDataDirectory: ({ assetsDirectory, store }: {
assetsDirectory: string;
store: TStoreConfig;
}) => string;
/**
* Get the stores from the assets directory.
* @param opts
* @returns
*/
declare const getStores: ({ assetsDirectory, search }: {
search?: string;
assetsDirectory: string;
}) => Promise<{
name: string;
version: string;
uid: string;
fullPath: string;
}[]>;
/**
* Check for already installed store and download those not installed yet from npmjs
* @param config
* @param param1
* @returns
*/
declare const handleDownloadStores: ({ assetsDirectory, config, }: {
assetsDirectory: string;
config: TOptionalConfig;
}) => Promise<void>;
/**
* Download a store from npmjs and extract it.
* @param store
* @param param1
* @returns
*/
declare const handleDownloadStore: ({ assetsDirectory, override, store, }: {
assetsDirectory: string;
override?: boolean;
store: z.infer<typeof storeConfigSchema>;
}) => Promise<void>;
/**
* Delete a store from the assets directory.
* @param store
* @param assetsDirectory
*/
declare const handleDeleteStore: ({ assetsDirectory, store, }: {
store: z.infer<typeof storeConfigSchema>;
assetsDirectory: string;
}) => Promise<void>;
export { getStoreDataDirectory, getStores, getStoresDirectory, handleDeleteStore, handleDownloadStore, handleDownloadStores };