@awesomeness-js/utils 1.0.25 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,11 +5,23 @@ import generateFlatExportLines from './generateFlatExportLines.js';
5
5
  import generateNamespaceExportLines from './generateNamespaceExportLines.js';
6
6
  import generateNamedExports from './generateNamedExports.js';
7
7
 
8
- export default function generateFile(src, exportRoots, ignore, includeComments, dts, useTabs = true) {
8
+ export default function generateFile({
9
+ src,
10
+ exportRoots,
11
+ ignore,
12
+ includeComments,
13
+ dts,
14
+ useTabs = true
15
+ }) {
9
16
 
10
- const fileDataList = buildFileDataList(src, ignore, includeComments);
17
+ const fileDataList = buildFileDataList({
18
+ src,
19
+ ignore,
20
+ includeComments
21
+ });
11
22
  const {
12
- flatExports, nestedExports
23
+ flatExports,
24
+ nestedExports
13
25
  } = buildExportsTree(fileDataList);
14
26
  const headerComment = `/**
15
27
  * This file is auto-generated by the build script.
@@ -17,16 +29,38 @@ export default function generateFile(src, exportRoots, ignore, includeComments,
17
29
  * Do not edit manually.
18
30
  */
19
31
  `;
20
- const importStatements = generateImportStatements(fileDataList, dts, src);
21
- const flatExportLines = generateFlatExportLines(flatExports, exportRoots, includeComments, dts, useTabs);
22
- const namespaceExportLines = generateNamespaceExportLines(nestedExports, includeComments, dts, useTabs);
32
+ const importStatements = generateImportStatements({
33
+ fileDataList,
34
+ dts,
35
+ src
36
+ });
37
+
38
+ const flatExportLines = generateFlatExportLines({
39
+ flatExports,
40
+ exportRoots,
41
+ includeComments,
42
+ dts,
43
+ useTabs
44
+ });
45
+
46
+ const namespaceExportLines = generateNamespaceExportLines({
47
+ nestedExports,
48
+ includeComments,
49
+ dts,
50
+ useTabs
51
+ });
23
52
 
24
53
  const defaultExportCode = dts
25
54
  ? `declare const _default: {\n${flatExportLines}${namespaceExportLines}};\n\nexport default _default;\n`
26
55
  : `export default {\n${flatExportLines}${namespaceExportLines}};`;
27
56
 
28
- const namedExports = generateNamedExports(flatExports, exportRoots, dts);
29
-
57
+ const namedExports = generateNamedExports({
58
+ nestedExports,
59
+ flatExports,
60
+ exportRoots,
61
+ dts,
62
+ useTabs
63
+ });
30
64
 
31
65
  return headerComment +
32
66
  importStatements + '\n' +
@@ -1,4 +1,10 @@
1
- export default function generateFlatExportLines(flatExports, exportRoots, includeComments, dts, useTabs = true) {
1
+ export default function generateFlatExportLines({
2
+ flatExports,
3
+ exportRoots,
4
+ includeComments,
5
+ dts,
6
+ useTabs = true
7
+ }) {
2
8
 
3
9
  let indentStyle = useTabs ? '\t' : ' ';
4
10
 
@@ -1,4 +1,8 @@
1
- export default function generateImportStatements(fileDataList, dts, src) {
1
+ export default function generateImportStatements({
2
+ fileDataList,
3
+ dts,
4
+ src
5
+ }) {
2
6
 
3
7
  let statements = '';
4
8
 
@@ -1,19 +1,53 @@
1
- export default function generateNamedExports(flatExports, exportRoots, dts) {
1
+ export default function generateNamedExports({
2
+ flatExports,
3
+ exportRoots,
4
+ nestedExports,
5
+ dts,
6
+ useTabs = true
7
+ }) {
2
8
 
9
+ const indentStyle = useTabs ? '\t' : ' ';
3
10
  let lines = '';
4
11
 
12
+ if (!exportRoots) return lines;
5
13
 
6
- if (exportRoots) {
14
+ // existing flat exports
15
+ flatExports.forEach(({
16
+ functionName, importVarName
17
+ }) => {
7
18
 
8
- flatExports.forEach(({
9
- functionName, importVarName
10
- }) => {
19
+ lines += dts
20
+ ? `export declare const ${functionName}: typeof ${importVarName};\n`
21
+ : `export { ${importVarName} as ${functionName} };\n`;
22
+
23
+ });
24
+
25
+ // grouped namespaces as named exports
26
+ if (nestedExports) {
27
+
28
+ lines += '\n';
29
+
30
+ for (const [ groupName, members ] of Object.entries(nestedExports)) {
31
+
32
+ if (dts) {
33
+
34
+ const fields = Object.entries(members)
35
+ .map(([ k, v ]) => `${indentStyle}${k}: typeof ${v.importVarName};`)
36
+ .join('\n');
37
+
38
+ lines += `export declare const ${groupName}: {\n${fields}\n};\n\n`;
39
+
40
+ } else {
41
+
42
+ const fields = Object.entries(members)
43
+ .map(([ k, v ]) => `${indentStyle}${k}: ${v.importVarName}`)
44
+ .join(',\n');
11
45
 
12
- lines += dts
13
- ? `export declare const ${functionName}: typeof ${importVarName};\n`
14
- : `export { ${importVarName} as ${functionName} };\n`;
46
+ lines += `export const ${groupName} = {\n${fields}\n};\n\n`;
47
+
48
+ }
15
49
 
16
- });
50
+ }
17
51
 
18
52
  }
19
53
 
@@ -1,4 +1,10 @@
1
- export default function generateNamespaceCode(nsObj, indentLevel, includeComments, dts, useTabs = true) {
1
+ export default function generateNamespaceCode({
2
+ nsObj,
3
+ indentLevel,
4
+ includeComments,
5
+ dts,
6
+ useTabs = true
7
+ }) {
2
8
 
3
9
  let indentStyle = useTabs ? '\t' : ' ';
4
10
 
@@ -31,7 +37,12 @@ export default function generateNamespaceCode(nsObj, indentLevel, includeComment
31
37
 
32
38
  } else {
33
39
 
34
- const nestedCode = generateNamespaceCode(value, indentLevel + 1, includeComments, dts);
40
+ const nestedCode = generateNamespaceCode({
41
+ nsObj: value,
42
+ indentLevel: indentLevel + 1,
43
+ includeComments,
44
+ dts
45
+ });
35
46
 
36
47
  lines.push(`${indent}${indentStyle}${key}: ${nestedCode},`);
37
48
 
@@ -1,6 +1,11 @@
1
1
  import generateNamespaceCode from './generateNamespaceCode.js';
2
2
 
3
- export default function generateNamespaceExportLines(nestedExports, includeComments, dts, useTabs = true) {
3
+ export default function generateNamespaceExportLines({
4
+ nestedExports,
5
+ includeComments,
6
+ dts,
7
+ useTabs = true
8
+ }) {
4
9
 
5
10
  const indentStyle = useTabs ? '\t' : ' ';
6
11
 
@@ -8,7 +13,13 @@ export default function generateNamespaceExportLines(nestedExports, includeComme
8
13
 
9
14
  for (const ns in nestedExports) {
10
15
 
11
- const nsCode = generateNamespaceCode(nestedExports[ns], 1, includeComments, dts, useTabs);
16
+ const nsCode = generateNamespaceCode({
17
+ nsObj: nestedExports[ns],
18
+ indentLevel: 1,
19
+ includeComments,
20
+ dts,
21
+ useTabs
22
+ });
12
23
 
13
24
  lines += `${indentStyle}${ns}: ${nsCode},\n`;
14
25
 
@@ -0,0 +1,42 @@
1
+ import { writeFileSync } from 'node:fs';
2
+
3
+ export default function writeHotWrapper({
4
+ dest,
5
+ hotSource
6
+ }) {
7
+
8
+ const wrapper = `// auto-generated wrapper
9
+ import chokidar from 'chokidar';
10
+ import path from 'node:path';
11
+ import { pathToFileURL } from 'node:url';
12
+
13
+ let _default;
14
+
15
+ export { _default as default };
16
+
17
+ const target = path.resolve(${JSON.stringify(hotSource)});
18
+
19
+ async function reload() {
20
+
21
+ const mod = await import(\`\${pathToFileURL(target)}?t=\${Date.now()}\`);
22
+
23
+ _default = mod.default;
24
+ console.log('[hot] reloaded', target);
25
+
26
+ }
27
+
28
+ await reload();
29
+
30
+ let t;
31
+
32
+ chokidar.watch(target, { ignoreInitial: true }).on('all', () => {
33
+
34
+ clearTimeout(t);
35
+ t = setTimeout(() => reload().catch(err => console.error('[hot] failed:', err)), 50);
36
+
37
+ });
38
+ `;
39
+
40
+ writeFileSync(dest, wrapper);
41
+
42
+ }
@@ -0,0 +1,55 @@
1
+ // example.test.js
2
+ import {
3
+ expect, test, describe
4
+ } from 'vitest';
5
+ import utils from '../index.js';
6
+
7
+
8
+ describe('shouldIgnore', () => {
9
+
10
+ test('exact file match (case-insensitive)', () => {
11
+
12
+ expect(utils.shouldIgnore('/src/ignoreMe.js', [ 'ignoreMe.js' ])).toBe(true);
13
+ expect(utils.shouldIgnore('/src/IGNOREME.JS', [ 'ignoreMe.js' ])).toBe(true);
14
+ expect(utils.shouldIgnore('/src/notIgnoreMe.js', [ 'ignoreMe.js' ])).toBe(false);
15
+
16
+ });
17
+
18
+ test('ignore all in folder/* immediate children only', () => {
19
+
20
+ expect(utils.shouldIgnore('/src/ignoreFolder/file.js', [ 'ignoreFolder/*' ])).toBe(true);
21
+ expect(utils.shouldIgnore('/src/ignoreFolder/nested/file.js', [ 'ignoreFolder/*' ])).toBe(false);
22
+
23
+ });
24
+
25
+ test('ignore all with extension (*.js)', () => {
26
+
27
+ expect(utils.shouldIgnore('/src/file.js', [ '*.js' ])).toBe(true);
28
+ expect(utils.shouldIgnore('/src/deep/file.js', [ '*.js' ])).toBe(true);
29
+ expect(utils.shouldIgnore('/src/file.ts', [ '*.js' ])).toBe(false);
30
+
31
+ });
32
+
33
+ test('ignore only specific extension in folder (folder/*.js)', () => {
34
+
35
+ expect(utils.shouldIgnore('/src/css/style.js', [ 'css/*.js' ])).toBe(true);
36
+ expect(utils.shouldIgnore('/src/css/nested/style.js', [ 'css/*.js' ])).toBe(false);
37
+ expect(utils.shouldIgnore('/src/css/style.css', [ 'css/*.js' ])).toBe(false);
38
+
39
+ });
40
+
41
+ test('ignore whole directory (folder)', () => {
42
+
43
+ expect(utils.shouldIgnore('/src/namespaceExample/file.js', [ 'namespaceExample' ])).toBe(true);
44
+ expect(utils.shouldIgnore('/src/namespaceExample/nested/file.js', [ 'namespaceExample' ])).toBe(true);
45
+ expect(utils.shouldIgnore('/src/namespaceExampleFile.js', [ 'namespaceExample' ])).toBe(false);
46
+
47
+ });
48
+
49
+ test('mixed case patterns still match paths', () => {
50
+
51
+ expect(utils.shouldIgnore('/src/SomeFolder/File.JS', [ 'somefolder/*' ])).toBe(true);
52
+
53
+ });
54
+
55
+ });
@@ -0,0 +1,13 @@
1
+ // example.test.js
2
+ import {
3
+ expect, test
4
+ } from 'vitest';
5
+
6
+ import { password } from '../index.js';
7
+
8
+ test('test named export', () => {
9
+
10
+ expect(password.check).toBeDefined();
11
+ expect(password.hash).toBeDefined();
12
+
13
+ });
package/types/build.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  export default build;
2
- declare function build({ src, dest, exportRoots, ignore, includeComments, dts }?: {
2
+ declare function build({ src, dest, exportRoots, ignore, includeComments, dts, useTabs, hotModuleReload, hotCallback, hotSource }?: {
3
3
  src?: string;
4
4
  dest?: string;
5
5
  exportRoots?: boolean;
6
6
  ignore?: any[];
7
7
  includeComments?: boolean;
8
8
  dts?: boolean;
9
+ useTabs?: boolean;
10
+ hotModuleReload?: boolean;
11
+ hotCallback?: any;
12
+ hotSource?: string;
9
13
  }): Promise<boolean>;
package/types/index.d.ts CHANGED
@@ -20,13 +20,12 @@ import type _each from './each';
20
20
  import type _eachAsync from './eachAsync';
21
21
  import type _encrypt from './encrypt';
22
22
  import type _getAllFiles from './getAllFiles';
23
- import type _ignoreFolder_ignoreMe from './ignoreFolder/ignoreMe';
24
- import type _ignoreMe from './ignoreMe';
25
23
  import type _isUUID from './isUUID';
26
24
  import type _md5 from './md5';
27
25
  import type _password_check from './password/check';
28
26
  import type _password_hash from './password/hash';
29
27
  import type _setLocalEnvs from './setLocalEnvs';
28
+ import type _shouldIgnore from './shouldIgnore';
30
29
  import type _thingType from './thingType';
31
30
  import type _toPennies from './toPennies';
32
31
  import type _utils_buildExportsTree from './utils/buildExportsTree';
@@ -39,7 +38,7 @@ import type _utils_generateImportStatements from './utils/generateImportStatemen
39
38
  import type _utils_generateNamedExports from './utils/generateNamedExports';
40
39
  import type _utils_generateNamespaceCode from './utils/generateNamespaceCode';
41
40
  import type _utils_generateNamespaceExportLines from './utils/generateNamespaceExportLines';
42
- import type _utils_shouldIgnore from './utils/shouldIgnore';
41
+ import type _utils_writeHotWrapper from './utils/writeHotWrapper';
43
42
  import type _uuid from './uuid';
44
43
  import type _validateSchema from './validateSchema';
45
44
 
@@ -52,91 +51,119 @@ export declare const each: typeof _each;
52
51
  export declare const eachAsync: typeof _eachAsync;
53
52
  export declare const encrypt: typeof _encrypt;
54
53
  export declare const getAllFiles: typeof _getAllFiles;
55
- export declare const ignoreMe: typeof _ignoreMe;
56
54
  export declare const isUUID: typeof _isUUID;
57
55
  export declare const md5: typeof _md5;
58
56
  export declare const setLocalEnvs: typeof _setLocalEnvs;
57
+ export declare const shouldIgnore: typeof _shouldIgnore;
59
58
  export declare const thingType: typeof _thingType;
60
59
  export declare const toPennies: typeof _toPennies;
61
60
  export declare const uuid: typeof _uuid;
62
61
  export declare const validateSchema: typeof _validateSchema;
63
62
 
63
+ export declare const clean: {
64
+ array: typeof _clean_array;
65
+ boolean: typeof _clean_boolean;
66
+ integer: typeof _clean_integer;
67
+ number: typeof _clean_number;
68
+ object: typeof _clean_object;
69
+ string: typeof _clean_string;
70
+ timestamp: typeof _clean_timestamp;
71
+ uuid: typeof _clean_uuid;
72
+ };
73
+
74
+ export declare const password: {
75
+ check: typeof _password_check;
76
+ hash: typeof _password_hash;
77
+ };
78
+
79
+ export declare const utils: {
80
+ buildExportsTree: typeof _utils_buildExportsTree;
81
+ buildFileDataList: typeof _utils_buildFileDataList;
82
+ clean: typeof _utils_clean;
83
+ extractJSDocComment: typeof _utils_extractJSDocComment;
84
+ generateFile: typeof _utils_generateFile;
85
+ generateFlatExportLines: typeof _utils_generateFlatExportLines;
86
+ generateImportStatements: typeof _utils_generateImportStatements;
87
+ generateNamedExports: typeof _utils_generateNamedExports;
88
+ generateNamespaceCode: typeof _utils_generateNamespaceCode;
89
+ generateNamespaceExportLines: typeof _utils_generateNamespaceExportLines;
90
+ writeHotWrapper: typeof _utils_writeHotWrapper;
91
+ };
92
+
93
+
64
94
  declare const _default: {
65
- /**
66
- * Builds a file from the specified source directory and writes it to the destination file.
67
- *
68
- * @param {Object} options - The options for the build process.
69
- * @param {string} [options.src='./src'] - The source directory to build from.
70
- * @param {string} [options.dest='./index.js'] - The destination file to write the built content to.
71
- * @param {boolean} [options.exportRoots=true] - Whether to export root files.
72
- * @param {string[]} [options.ignore=[]] - An array of file patterns to ignore.
73
- * @param {boolean} [options.includeComments=true] - Whether to include comments in the generated file.
74
- * @param {boolean} [options.dts=false] - Whether to generate TypeScript declaration files.
75
- * @returns {Promise<boolean>} A promise that resolves to true when the build is complete.
76
- */
77
- build: typeof _build;
78
- collectImports: typeof _collectImports;
79
- combineFiles: typeof _combineFiles;
80
- /**
81
- * Converts a given number of bytes into a more readable string format with appropriate units.
82
- *
83
- * @param {number} bytes - The number of bytes to convert.
84
- * @param {number} [precision=2] - The number of decimal places to include in the result.
85
- * @returns {string} The converted bytes in a string format with appropriate units.
86
- */
87
- convertBytes: typeof _convertBytes;
88
- decrypt: typeof _decrypt;
89
- /**
90
- * Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
91
- * The iteration stops if the callback returns `false`.
92
- *
93
- * @example each({ a: 1, b: 2 }, (value, key) => { console.log(value, key); });
94
- * @param {Object|Array} objectOrArray - The object or array to iterate over.
95
- * @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
96
- * @returns {void}
97
- */
98
- each: typeof _each;
99
- eachAsync: typeof _eachAsync;
100
- encrypt: typeof _encrypt;
101
- getAllFiles: typeof _getAllFiles;
102
- ignoreMe: typeof _ignoreMe;
103
- isUUID: typeof _isUUID;
104
- md5: typeof _md5;
105
- setLocalEnvs: typeof _setLocalEnvs;
106
- thingType: typeof _thingType;
107
- toPennies: typeof _toPennies;
108
- uuid: typeof _uuid;
109
- validateSchema: typeof _validateSchema;
110
- clean: {
111
- array: typeof _clean_array,
112
- boolean: typeof _clean_boolean,
113
- integer: typeof _clean_integer,
114
- number: typeof _clean_number,
115
- object: typeof _clean_object,
116
- string: typeof _clean_string,
117
- timestamp: typeof _clean_timestamp,
118
- uuid: typeof _clean_uuid,
119
- },
120
- ignoreFolder: {
121
- ignoreMe: typeof _ignoreFolder_ignoreMe,
122
- },
123
- password: {
124
- check: typeof _password_check,
125
- hash: typeof _password_hash,
126
- },
127
- utils: {
128
- buildExportsTree: typeof _utils_buildExportsTree,
129
- buildFileDataList: typeof _utils_buildFileDataList,
130
- clean: typeof _utils_clean,
131
- extractJSDocComment: typeof _utils_extractJSDocComment,
132
- generateFile: typeof _utils_generateFile,
133
- generateFlatExportLines: typeof _utils_generateFlatExportLines,
134
- generateImportStatements: typeof _utils_generateImportStatements,
135
- generateNamedExports: typeof _utils_generateNamedExports,
136
- generateNamespaceCode: typeof _utils_generateNamespaceCode,
137
- generateNamespaceExportLines: typeof _utils_generateNamespaceExportLines,
138
- shouldIgnore: typeof _utils_shouldIgnore,
139
- },
95
+ /**
96
+ * Builds a file from the specified source directory and writes it to the destination file.
97
+ *
98
+ * @param {Object} options - The options for the build process.
99
+ * @param {string} [options.src='./src'] - The source directory to build from.
100
+ * @param {string} [options.dest='./index.js'] - The destination file to write the built content to.
101
+ * @param {boolean} [options.exportRoots=true] - Whether to export root files.
102
+ * @param {string[]} [options.ignore=[]] - An array of file patterns to ignore.
103
+ * @param {boolean} [options.includeComments=true] - Whether to include comments in the generated file.
104
+ * @param {boolean} [options.dts=false] - Whether to generate TypeScript declaration files.
105
+ * @returns {Promise<boolean>} A promise that resolves to true when the build is complete.
106
+ */
107
+ build: typeof _build;
108
+ collectImports: typeof _collectImports;
109
+ combineFiles: typeof _combineFiles;
110
+ /**
111
+ * Converts a given number of bytes into a more readable string format with appropriate units.
112
+ *
113
+ * @param {number} bytes - The number of bytes to convert.
114
+ * @param {number} [precision=2] - The number of decimal places to include in the result.
115
+ * @returns {string} The converted bytes in a string format with appropriate units.
116
+ */
117
+ convertBytes: typeof _convertBytes;
118
+ decrypt: typeof _decrypt;
119
+ /**
120
+ * Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
121
+ * The iteration stops if the callback returns `false`.
122
+ *
123
+ * @example each({ a: 1, b: 2 }, (value, key) => { console.log(value, key); });
124
+ * @param {Object|Array} objectOrArray - The object or array to iterate over.
125
+ * @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
126
+ * @returns {void}
127
+ */
128
+ each: typeof _each;
129
+ eachAsync: typeof _eachAsync;
130
+ encrypt: typeof _encrypt;
131
+ getAllFiles: typeof _getAllFiles;
132
+ isUUID: typeof _isUUID;
133
+ md5: typeof _md5;
134
+ setLocalEnvs: typeof _setLocalEnvs;
135
+ shouldIgnore: typeof _shouldIgnore;
136
+ thingType: typeof _thingType;
137
+ toPennies: typeof _toPennies;
138
+ uuid: typeof _uuid;
139
+ validateSchema: typeof _validateSchema;
140
+ clean: {
141
+ array: typeof _clean_array,
142
+ boolean: typeof _clean_boolean,
143
+ integer: typeof _clean_integer,
144
+ number: typeof _clean_number,
145
+ object: typeof _clean_object,
146
+ string: typeof _clean_string,
147
+ timestamp: typeof _clean_timestamp,
148
+ uuid: typeof _clean_uuid,
149
+ },
150
+ password: {
151
+ check: typeof _password_check,
152
+ hash: typeof _password_hash,
153
+ },
154
+ utils: {
155
+ buildExportsTree: typeof _utils_buildExportsTree,
156
+ buildFileDataList: typeof _utils_buildFileDataList,
157
+ clean: typeof _utils_clean,
158
+ extractJSDocComment: typeof _utils_extractJSDocComment,
159
+ generateFile: typeof _utils_generateFile,
160
+ generateFlatExportLines: typeof _utils_generateFlatExportLines,
161
+ generateImportStatements: typeof _utils_generateImportStatements,
162
+ generateNamedExports: typeof _utils_generateNamedExports,
163
+ generateNamespaceCode: typeof _utils_generateNamespaceCode,
164
+ generateNamespaceExportLines: typeof _utils_generateNamespaceExportLines,
165
+ writeHotWrapper: typeof _utils_writeHotWrapper,
166
+ },
140
167
  };
141
168
 
142
169
  export default _default;
@@ -0,0 +1 @@
1
+ export default function shouldIgnore(filePath: any, ignorePatterns: any): any;
@@ -1,4 +1,8 @@
1
- export default function buildFileDataList(src: any, ignore: any, includeComments: any): {
1
+ export default function buildFileDataList({ src, ignore, includeComments }: {
2
+ src: any;
3
+ ignore: any;
4
+ includeComments: any;
5
+ }): {
2
6
  normalizedFile: any;
3
7
  parts: any;
4
8
  functionName: any;
@@ -1 +1,8 @@
1
- export default function generateFile(src: any, exportRoots: any, ignore: any, includeComments: any, dts: any): string;
1
+ export default function generateFile({ src, exportRoots, ignore, includeComments, dts, useTabs }: {
2
+ src: any;
3
+ exportRoots: any;
4
+ ignore: any;
5
+ includeComments: any;
6
+ dts: any;
7
+ useTabs?: boolean;
8
+ }): string;
@@ -1 +1,7 @@
1
- export default function generateFlatExportLines(flatExports: any, exportRoots: any, includeComments: any, dts: any): string;
1
+ export default function generateFlatExportLines({ flatExports, exportRoots, includeComments, dts, useTabs }: {
2
+ flatExports: any;
3
+ exportRoots: any;
4
+ includeComments: any;
5
+ dts: any;
6
+ useTabs?: boolean;
7
+ }): string;
@@ -1 +1,5 @@
1
- export default function generateImportStatements(fileDataList: any, dts: any, src: any): string;
1
+ export default function generateImportStatements({ fileDataList, dts, src }: {
2
+ fileDataList: any;
3
+ dts: any;
4
+ src: any;
5
+ }): string;
@@ -1 +1,7 @@
1
- export default function generateNamedExports(flatExports: any, exportRoots: any, dts: any): string;
1
+ export default function generateNamedExports({ flatExports, exportRoots, nestedExports, dts, useTabs }: {
2
+ flatExports: any;
3
+ exportRoots: any;
4
+ nestedExports: any;
5
+ dts: any;
6
+ useTabs?: boolean;
7
+ }): string;
@@ -1 +1,7 @@
1
- export default function generateNamespaceCode(nsObj: any, indentLevel: any, includeComments: any, dts: any): string;
1
+ export default function generateNamespaceCode({ nsObj, indentLevel, includeComments, dts, useTabs }: {
2
+ nsObj: any;
3
+ indentLevel: any;
4
+ includeComments: any;
5
+ dts: any;
6
+ useTabs?: boolean;
7
+ }): string;
@@ -1 +1,6 @@
1
- export default function generateNamespaceExportLines(nestedExports: any, includeComments: any, dts: any): string;
1
+ export default function generateNamespaceExportLines({ nestedExports, includeComments, dts, useTabs }: {
2
+ nestedExports: any;
3
+ includeComments: any;
4
+ dts: any;
5
+ useTabs?: boolean;
6
+ }): string;
@@ -0,0 +1,4 @@
1
+ export default function writeHotWrapper({ dest, hotSource }: {
2
+ dest: any;
3
+ hotSource: any;
4
+ }): void;