@suseejs/types 0.1.0 → 0.1.1
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.
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +117 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +117 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":";AAAA,IAAU,KAAK,CAuHd;AAvHD,WAAU,KAAK;IACb,MAAM,OAAO,GAAG,QAAQ,CAAC;AAsH3B,CAAC,EAvHS,KAAK,KAAL,KAAK,QAuHd;AAED,iBAAS,KAAK,CAAC"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
declare namespace SuSee {
|
|
2
|
+
interface DepsFile {
|
|
3
|
+
file: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
interface NamesSet {
|
|
7
|
+
base: string;
|
|
8
|
+
file: string;
|
|
9
|
+
newName: string;
|
|
10
|
+
isEd?: boolean;
|
|
11
|
+
}
|
|
12
|
+
type NamesSets = NamesSet[];
|
|
13
|
+
type DuplicatesNameMap = Map<string, Set<{
|
|
14
|
+
file: string;
|
|
15
|
+
}>>;
|
|
16
|
+
type BundleHandler = ({ file, content }: DepsFile) => DepsFile;
|
|
17
|
+
interface NamesMap {
|
|
18
|
+
base: string;
|
|
19
|
+
file: string;
|
|
20
|
+
short: string;
|
|
21
|
+
oldName: string;
|
|
22
|
+
}
|
|
23
|
+
type PostProcessHook = {
|
|
24
|
+
async: true;
|
|
25
|
+
func: (code: string, file?: string) => Promise<string>;
|
|
26
|
+
} | {
|
|
27
|
+
async: false;
|
|
28
|
+
func: (code: string, file?: string) => string;
|
|
29
|
+
};
|
|
30
|
+
type OutPutHookFunc = (...args: any[]) => PostProcessHook;
|
|
31
|
+
type OutFiles = {
|
|
32
|
+
commonjs: string | undefined;
|
|
33
|
+
commonjsTypes: string | undefined;
|
|
34
|
+
esm: string | undefined;
|
|
35
|
+
esmTypes: string | undefined;
|
|
36
|
+
main: string | undefined;
|
|
37
|
+
module: string | undefined;
|
|
38
|
+
types: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
type Target = "commonjs" | "esm" | "both";
|
|
41
|
+
type Exports = Record<string, {
|
|
42
|
+
import?: {
|
|
43
|
+
default: string;
|
|
44
|
+
types: string;
|
|
45
|
+
};
|
|
46
|
+
require?: {
|
|
47
|
+
default: string;
|
|
48
|
+
types: string;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Build configuration.
|
|
53
|
+
*/
|
|
54
|
+
interface BuildOptions {
|
|
55
|
+
/**
|
|
56
|
+
* Entry file to bundle.
|
|
57
|
+
*/
|
|
58
|
+
entry: string;
|
|
59
|
+
/**
|
|
60
|
+
* Output target: `"commonjs"`, `"esm"`, or `"both"`.
|
|
61
|
+
*
|
|
62
|
+
* default - "both"
|
|
63
|
+
*/
|
|
64
|
+
target?: Target;
|
|
65
|
+
/**
|
|
66
|
+
* Default export name if applicable.
|
|
67
|
+
* - Required when the entry has default export and `options.target` = `"commonjs"` or `"both"`
|
|
68
|
+
*
|
|
69
|
+
* Example :
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const foo = {bar:"foo"};
|
|
73
|
+
* export default foo; // defaultExportName = "foo"
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* default - undefined
|
|
77
|
+
*/
|
|
78
|
+
defaultExportName?: string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Whether this build represents the main export , otherwise subpath export.
|
|
81
|
+
*
|
|
82
|
+
* default - true
|
|
83
|
+
*/
|
|
84
|
+
isMainExport?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Output directory.
|
|
87
|
+
*
|
|
88
|
+
* For a subpath export (not the main export), `outDir` must be a single-level
|
|
89
|
+
* nested folder under the main output directory.
|
|
90
|
+
*
|
|
91
|
+
* Example:
|
|
92
|
+
*
|
|
93
|
+
* ```ts
|
|
94
|
+
* const mainOutdir = "dist";
|
|
95
|
+
* const subpathOutdir = "dist/subpath"; // subpath export in package.json will be "./subpath"
|
|
96
|
+
* const fooOutdir = "dist/foo"; // subpath export in package.json will be "./foo"
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* default - "dist"
|
|
100
|
+
*/
|
|
101
|
+
outDir?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Identifiers to replace with blanks during compilation.
|
|
104
|
+
*
|
|
105
|
+
* default - []
|
|
106
|
+
*/
|
|
107
|
+
replaceWithBlank?: string[];
|
|
108
|
+
/**
|
|
109
|
+
* Array of hook functions executed during compilation.
|
|
110
|
+
*
|
|
111
|
+
* default - []
|
|
112
|
+
*/
|
|
113
|
+
hooks?: PostProcessHook[];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export = SuSee;
|
|
117
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":"AAAA,kBAAU,KAAK,CAAC;IAGd,UAAiB,QAAQ;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB;IACD,UAAiB,QAAQ;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB;IACD,KAAY,SAAS,GAAG,QAAQ,EAAE,CAAC;IAEnC,KAAY,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;QAAE,IAAI,EA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OAAO,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9C,CACF,CAAC;IAEF;;OAEG;IACH,UAAiB,YAAY;QAC3B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;;;WAIG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;;;;;;;;;;;WAYG;QACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACvC;;;;WAIG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB;;;;;;;;;;;;;;;WAeG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;;;WAIG;QACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B;;;;WAIG;QACH,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;KAC3B;CACF;AAED,SAAS,KAAK,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
declare namespace SuSee {
|
|
2
|
+
interface DepsFile {
|
|
3
|
+
file: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
interface NamesSet {
|
|
7
|
+
base: string;
|
|
8
|
+
file: string;
|
|
9
|
+
newName: string;
|
|
10
|
+
isEd?: boolean;
|
|
11
|
+
}
|
|
12
|
+
type NamesSets = NamesSet[];
|
|
13
|
+
type DuplicatesNameMap = Map<string, Set<{
|
|
14
|
+
file: string;
|
|
15
|
+
}>>;
|
|
16
|
+
type BundleHandler = ({ file, content }: DepsFile) => DepsFile;
|
|
17
|
+
interface NamesMap {
|
|
18
|
+
base: string;
|
|
19
|
+
file: string;
|
|
20
|
+
short: string;
|
|
21
|
+
oldName: string;
|
|
22
|
+
}
|
|
23
|
+
type PostProcessHook = {
|
|
24
|
+
async: true;
|
|
25
|
+
func: (code: string, file?: string) => Promise<string>;
|
|
26
|
+
} | {
|
|
27
|
+
async: false;
|
|
28
|
+
func: (code: string, file?: string) => string;
|
|
29
|
+
};
|
|
30
|
+
type OutPutHookFunc = (...args: any[]) => PostProcessHook;
|
|
31
|
+
type OutFiles = {
|
|
32
|
+
commonjs: string | undefined;
|
|
33
|
+
commonjsTypes: string | undefined;
|
|
34
|
+
esm: string | undefined;
|
|
35
|
+
esmTypes: string | undefined;
|
|
36
|
+
main: string | undefined;
|
|
37
|
+
module: string | undefined;
|
|
38
|
+
types: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
type Target = "commonjs" | "esm" | "both";
|
|
41
|
+
type Exports = Record<string, {
|
|
42
|
+
import?: {
|
|
43
|
+
default: string;
|
|
44
|
+
types: string;
|
|
45
|
+
};
|
|
46
|
+
require?: {
|
|
47
|
+
default: string;
|
|
48
|
+
types: string;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Build configuration.
|
|
53
|
+
*/
|
|
54
|
+
interface BuildOptions {
|
|
55
|
+
/**
|
|
56
|
+
* Entry file to bundle.
|
|
57
|
+
*/
|
|
58
|
+
entry: string;
|
|
59
|
+
/**
|
|
60
|
+
* Output target: `"commonjs"`, `"esm"`, or `"both"`.
|
|
61
|
+
*
|
|
62
|
+
* default - "both"
|
|
63
|
+
*/
|
|
64
|
+
target?: Target;
|
|
65
|
+
/**
|
|
66
|
+
* Default export name if applicable.
|
|
67
|
+
* - Required when the entry has default export and `options.target` = `"commonjs"` or `"both"`
|
|
68
|
+
*
|
|
69
|
+
* Example :
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const foo = {bar:"foo"};
|
|
73
|
+
* export default foo; // defaultExportName = "foo"
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* default - undefined
|
|
77
|
+
*/
|
|
78
|
+
defaultExportName?: string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Whether this build represents the main export , otherwise subpath export.
|
|
81
|
+
*
|
|
82
|
+
* default - true
|
|
83
|
+
*/
|
|
84
|
+
isMainExport?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Output directory.
|
|
87
|
+
*
|
|
88
|
+
* For a subpath export (not the main export), `outDir` must be a single-level
|
|
89
|
+
* nested folder under the main output directory.
|
|
90
|
+
*
|
|
91
|
+
* Example:
|
|
92
|
+
*
|
|
93
|
+
* ```ts
|
|
94
|
+
* const mainOutdir = "dist";
|
|
95
|
+
* const subpathOutdir = "dist/subpath"; // subpath export in package.json will be "./subpath"
|
|
96
|
+
* const fooOutdir = "dist/foo"; // subpath export in package.json will be "./foo"
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* default - "dist"
|
|
100
|
+
*/
|
|
101
|
+
outDir?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Identifiers to replace with blanks during compilation.
|
|
104
|
+
*
|
|
105
|
+
* default - []
|
|
106
|
+
*/
|
|
107
|
+
replaceWithBlank?: string[];
|
|
108
|
+
/**
|
|
109
|
+
* Array of hook functions executed during compilation.
|
|
110
|
+
*
|
|
111
|
+
* default - []
|
|
112
|
+
*/
|
|
113
|
+
hooks?: PostProcessHook[];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export default SuSee;
|
|
117
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kBAAU,KAAK,CAAC;IAGd,UAAiB,QAAQ;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB;IACD,UAAiB,QAAQ;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB;IACD,KAAY,SAAS,GAAG,QAAQ,EAAE,CAAC;IAEnC,KAAY,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;QAAE,IAAI,EAAE,MAAM,CA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