@iobroker/create-adapter
Version:
Command line utility to create customized ioBroker adapters
64 lines (63 loc) • 1.36 kB
TypeScript
import type { Answers } from "./core/questions";
interface AnswersMeta {
creatorVersion: string;
}
type TemplateFunctionReturnType = string | Buffer | undefined;
/**
*
*/
export interface TemplateFunction {
(answers: Answers & AnswersMeta): TemplateFunctionReturnType | Promise<TemplateFunctionReturnType>;
/**
*
*/
customPath?: string | ((answers: Answers & AnswersMeta) => string);
/**
*
*/
noReformat?: boolean;
}
/**
*
*/
export interface File {
/**
*
*/
name: string;
/**
*
*/
content: string | Buffer;
/**
*
*/
noReformat: boolean;
}
/**
*
* @param answers
*/
export declare function createFiles(answers: Answers): Promise<File[]>;
/**
*
* @param targetDir
* @param files
*/
export declare function writeFiles(targetDir: string, files: File[]): Promise<void>;
/**
*
* @param file
* @param relativeTo
* @param binary
*/
export declare function readFile(file: string, relativeTo: string, binary?: boolean): Promise<string | Buffer>;
/**
* Reads a file that resides on the root dir. After compilation, this is one folder higher than at build time
*
* @param file
* @param relativeTo
* @param binary
*/
export declare function readFileFromRootDir(file: string, relativeTo: string, binary?: boolean): Promise<string | Buffer>;
export {};