-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacro.d.ts
52 lines (51 loc) · 1.83 KB
/
macro.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
43
44
45
46
47
48
49
50
51
52
/**
* Set the config for this file only. `setConfigForThisFile` provides a
* way to override the config for this macro on a per-file basis.
*
* @param {{rootDir: string | undefined, removeDupeTitle: boolean | undefined }} config
*/
export function setConfigForThisFile(config: {
/** If undefined, defaults to global `rootDir` value which initially is `src` */
rootDir?: string;
/** If undefined, defaults to global `removeDupeTitle` value which initially is `false` */
removeDupeTitle?: boolean;
}): void;
/**
* This macro will automatically generate
* titles for your stories in Storybook.
*
*
* This babel macro was created to streamline the developer experience when working
* with stories inside Storybook. The macro will automatically generate a title
* for your stories -- eliminating the need to write them out which can be a time
* saver especially when a story is nested deep inside multiple folders.*
*
*
* @param {string} [manualTitle]
* @param {boolean} [useManualTitleOverride=false]
* @returns {string} title
*
* @example <caption>Auto generate title</caption>
*
* // src/components/media/Image.js
* import createTitle from '@parachutehome/create-title.macro';
* createTitle(); // outputs: `components/media/Image`
*
* @example <caption>Manual title</caption>
*
* // src/components/media/Image.js
* import createTitle from '@parachutehome/create-title.macro';
* createTitle('Apple'); // outputs: `components/media/Apple`
*
* @example <caption>Manual override with specified title</caption>
*
* // src/components/media/Image.js
* import createTitle from '@parachutehome/create-title.macro';
* createTitle('Apple', true); // outputs: `Apple`
*
* For more information about the macro visit the README.
*/
export default function createTitle(
manualTitle?: string,
useManualTitleOverride?: boolean
): string;