-
Notifications
You must be signed in to change notification settings - Fork 64
/
index.d.ts
42 lines (39 loc) · 1.26 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
type InquirerFile = {
name: string;
short: string;
value: string;
};
/**
* Get the folder of a component at `path`.
*
* @param path Path to a component.
* @return The folder of the component given at `path`.
*/
export declare function getComponentFolder(path: string): string
/**
* Search for React components in directory `root`.
*
* @param root Directory to use as root.
* @param workingDir (Optional) Directory the command is executed from (used for relative paths).
* @return A promise resolving to an array of objects containing information about found components.
*/
export declare function getComponentFiles(
root: string,
workingDir?: string,
): Promise<InquirerFile[]>
/**
* Replicate component given by `originialPath` into component with name `answers.name`
* in folder `answers.folder`.
*
* `originalPath` should point to the component file itself. Test, styles, etc. will also
* be copied automatically.
*
* @param originalPath Path of the component to replicate.
* @param answers An object containing `name` and `folder` of the new component.
* @param workingDir (Optional) Current working directory
*/
export declare function replicate(
originalPath: string,
answers: { name: string; folder: string },
workingDir?: string,
): Promise<void>