@oazmi/superbuild 0.1.0

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.
Files changed (118) hide show
  1. package/esm/_dnt.shims.d.ts +2 -0
  2. package/esm/_dnt.shims.d.ts.map +1 -0
  3. package/esm/_dnt.shims.js +57 -0
  4. package/esm/deps/jsr.io/@oazmi/esbuild-types/0.28.0/src/mod.d.ts +598 -0
  5. package/esm/deps/jsr.io/@oazmi/esbuild-types/0.28.0/src/mod.d.ts.map +1 -0
  6. package/esm/deps/jsr.io/@oazmi/esbuild-types/0.28.0/src/mod.js +1 -0
  7. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/alias.d.ts +617 -0
  8. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/alias.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/alias.js +671 -0
  10. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/array1d.d.ts +487 -0
  11. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/array1d.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/array1d.js +536 -0
  13. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/array2d.d.ts +266 -0
  14. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/array2d.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/array2d.js +318 -0
  16. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/binder.d.ts +368 -0
  17. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/binder.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/binder.js +380 -0
  19. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/crossenv.d.ts +711 -0
  20. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/crossenv.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/crossenv.js +1173 -0
  22. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/cryptoman.d.ts +171 -0
  23. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/cryptoman.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/cryptoman.js +308 -0
  25. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/deps.d.ts +10 -0
  26. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/deps.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/deps.js +10 -0
  28. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/eightpack.d.ts +168 -0
  29. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/eightpack.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/eightpack.js +236 -0
  31. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/eightpack_varint.d.ts +90 -0
  32. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/eightpack_varint.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/eightpack_varint.js +237 -0
  34. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/numericarray.d.ts +213 -0
  35. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/numericarray.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/numericarray.js +363 -0
  37. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/numericmethods.d.ts +233 -0
  38. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/numericmethods.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/numericmethods.js +256 -0
  40. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/pathman.d.ts +1436 -0
  41. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/pathman.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/pathman.js +1730 -0
  43. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/promiseman.d.ts +647 -0
  44. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/promiseman.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/promiseman.js +762 -0
  46. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/stringman.d.ts +538 -0
  47. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/stringman.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/stringman.js +626 -0
  49. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/struct.d.ts +734 -0
  50. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/struct.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/struct.js +764 -0
  52. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/typedbuffer.d.ts +137 -0
  53. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/typedbuffer.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/typedbuffer.js +234 -0
  55. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/typedefs.d.ts +391 -0
  56. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/typedefs.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@oazmi/kitchensink/0.10.0/src/typedefs.js +8 -0
  58. package/esm/deps.d.ts +56 -0
  59. package/esm/deps.d.ts.map +1 -0
  60. package/esm/deps.js +37 -0
  61. package/esm/esbuild/metafile.d.ts +90 -0
  62. package/esm/esbuild/metafile.d.ts.map +1 -0
  63. package/esm/esbuild/metafile.js +275 -0
  64. package/esm/esbuild/native.d.ts +95 -0
  65. package/esm/esbuild/native.d.ts.map +1 -0
  66. package/esm/esbuild/native.js +127 -0
  67. package/esm/esbuild/outputfile.d.ts +86 -0
  68. package/esm/esbuild/outputfile.d.ts.map +1 -0
  69. package/esm/esbuild/outputfile.js +221 -0
  70. package/esm/esbuild/strongtypes.d.ts +90 -0
  71. package/esm/esbuild/strongtypes.d.ts.map +1 -0
  72. package/esm/esbuild/strongtypes.js +8 -0
  73. package/esm/esbuild/typedefs.d.ts +121 -0
  74. package/esm/esbuild/typedefs.d.ts.map +1 -0
  75. package/esm/esbuild/typedefs.js +55 -0
  76. package/esm/esbuild/weaktypes.d.ts +46 -0
  77. package/esm/esbuild/weaktypes.d.ts.map +1 -0
  78. package/esm/esbuild/weaktypes.js +8 -0
  79. package/esm/funcdefs.d.ts +89 -0
  80. package/esm/funcdefs.d.ts.map +1 -0
  81. package/esm/funcdefs.js +145 -0
  82. package/esm/mod.d.ts +4 -0
  83. package/esm/mod.d.ts.map +1 -0
  84. package/esm/mod.js +2 -0
  85. package/esm/package.json +3 -0
  86. package/esm/plugins/emissions_driver.d.ts +33 -0
  87. package/esm/plugins/emissions_driver.d.ts.map +1 -0
  88. package/esm/plugins/emissions_driver.js +260 -0
  89. package/esm/plugins/long_build.d.ts +138 -0
  90. package/esm/plugins/long_build.d.ts.map +1 -0
  91. package/esm/plugins/long_build.js +288 -0
  92. package/esm/plugins/native_replica.d.ts +48 -0
  93. package/esm/plugins/native_replica.d.ts.map +1 -0
  94. package/esm/plugins/native_replica.js +122 -0
  95. package/esm/super/build.d.ts +53 -0
  96. package/esm/super/build.d.ts.map +1 -0
  97. package/esm/super/build.js +39 -0
  98. package/esm/super/build_context.d.ts +83 -0
  99. package/esm/super/build_context.d.ts.map +1 -0
  100. package/esm/super/build_context.js +124 -0
  101. package/esm/super/mod.d.ts +12 -0
  102. package/esm/super/mod.d.ts.map +1 -0
  103. package/esm/super/mod.js +9 -0
  104. package/esm/super/plugin.d.ts +23 -0
  105. package/esm/super/plugin.d.ts.map +1 -0
  106. package/esm/super/plugin.js +31 -0
  107. package/esm/super/plugin_build.d.ts +38 -0
  108. package/esm/super/plugin_build.d.ts.map +1 -0
  109. package/esm/super/plugin_build.js +198 -0
  110. package/esm/super/typedefs.d.ts +323 -0
  111. package/esm/super/typedefs.d.ts.map +1 -0
  112. package/esm/super/typedefs.js +10 -0
  113. package/esm/typedefs.d.ts +21 -0
  114. package/esm/typedefs.d.ts.map +1 -0
  115. package/esm/typedefs.js +5 -0
  116. package/license.md +37 -0
  117. package/package.json +88 -0
  118. package/readme.md +181 -0
@@ -0,0 +1,2 @@
1
+ export declare const dntGlobalThis: Omit<typeof globalThis, never>;
2
+ //# sourceMappingURL=_dnt.shims.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
@@ -0,0 +1,57 @@
1
+ const dntGlobals = {};
2
+ export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
3
+ function createMergeProxy(baseObj, extObj) {
4
+ return new Proxy(baseObj, {
5
+ get(_target, prop, _receiver) {
6
+ if (prop in extObj) {
7
+ return extObj[prop];
8
+ }
9
+ else {
10
+ return baseObj[prop];
11
+ }
12
+ },
13
+ set(_target, prop, value) {
14
+ if (prop in extObj) {
15
+ delete extObj[prop];
16
+ }
17
+ baseObj[prop] = value;
18
+ return true;
19
+ },
20
+ deleteProperty(_target, prop) {
21
+ let success = false;
22
+ if (prop in extObj) {
23
+ delete extObj[prop];
24
+ success = true;
25
+ }
26
+ if (prop in baseObj) {
27
+ delete baseObj[prop];
28
+ success = true;
29
+ }
30
+ return success;
31
+ },
32
+ ownKeys(_target) {
33
+ const baseKeys = Reflect.ownKeys(baseObj);
34
+ const extKeys = Reflect.ownKeys(extObj);
35
+ const extKeysSet = new Set(extKeys);
36
+ return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
37
+ },
38
+ defineProperty(_target, prop, desc) {
39
+ if (prop in extObj) {
40
+ delete extObj[prop];
41
+ }
42
+ Reflect.defineProperty(baseObj, prop, desc);
43
+ return true;
44
+ },
45
+ getOwnPropertyDescriptor(_target, prop) {
46
+ if (prop in extObj) {
47
+ return Reflect.getOwnPropertyDescriptor(extObj, prop);
48
+ }
49
+ else {
50
+ return Reflect.getOwnPropertyDescriptor(baseObj, prop);
51
+ }
52
+ },
53
+ has(_target, prop) {
54
+ return prop in extObj || prop in baseObj;
55
+ },
56
+ });
57
+ }
@@ -0,0 +1,598 @@
1
+ export type Platform = "browser" | "node" | "neutral";
2
+ export type Format = "iife" | "cjs" | "esm";
3
+ export type Loader = "base64" | "binary" | "copy" | "css" | "dataurl" | "default" | "empty" | "file" | "js" | "json" | "jsx" | "local-css" | "text" | "ts" | "tsx";
4
+ export type LogLevel = "verbose" | "debug" | "info" | "warning" | "error" | "silent";
5
+ export type Charset = "ascii" | "utf8";
6
+ export type Drop = "console" | "debugger";
7
+ export type AbsPaths = "code" | "log" | "metafile";
8
+ interface CommonOptions {
9
+ /** Documentation: https://esbuild.github.io/api/#sourcemap */
10
+ sourcemap?: boolean | "linked" | "inline" | "external" | "both";
11
+ /** Documentation: https://esbuild.github.io/api/#legal-comments */
12
+ legalComments?: "none" | "inline" | "eof" | "linked" | "external";
13
+ /** Documentation: https://esbuild.github.io/api/#source-root */
14
+ sourceRoot?: string;
15
+ /** Documentation: https://esbuild.github.io/api/#sources-content */
16
+ sourcesContent?: boolean;
17
+ /** Documentation: https://esbuild.github.io/api/#format */
18
+ format?: Format;
19
+ /** Documentation: https://esbuild.github.io/api/#global-name */
20
+ globalName?: string;
21
+ /** Documentation: https://esbuild.github.io/api/#target */
22
+ target?: string | string[];
23
+ /** Documentation: https://esbuild.github.io/api/#supported */
24
+ supported?: Record<string, boolean>;
25
+ /** Documentation: https://esbuild.github.io/api/#platform */
26
+ platform?: Platform;
27
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
28
+ mangleProps?: RegExp;
29
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
30
+ reserveProps?: RegExp;
31
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
32
+ mangleQuoted?: boolean;
33
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
34
+ mangleCache?: Record<string, string | false>;
35
+ /** Documentation: https://esbuild.github.io/api/#drop */
36
+ drop?: Drop[];
37
+ /** Documentation: https://esbuild.github.io/api/#drop-labels */
38
+ dropLabels?: string[];
39
+ /** Documentation: https://esbuild.github.io/api/#minify */
40
+ minify?: boolean;
41
+ /** Documentation: https://esbuild.github.io/api/#minify */
42
+ minifyWhitespace?: boolean;
43
+ /** Documentation: https://esbuild.github.io/api/#minify */
44
+ minifyIdentifiers?: boolean;
45
+ /** Documentation: https://esbuild.github.io/api/#minify */
46
+ minifySyntax?: boolean;
47
+ /** Documentation: https://esbuild.github.io/api/#line-limit */
48
+ lineLimit?: number;
49
+ /** Documentation: https://esbuild.github.io/api/#charset */
50
+ charset?: Charset;
51
+ /** Documentation: https://esbuild.github.io/api/#tree-shaking */
52
+ treeShaking?: boolean;
53
+ /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
54
+ ignoreAnnotations?: boolean;
55
+ /** Documentation: https://esbuild.github.io/api/#jsx */
56
+ jsx?: "transform" | "preserve" | "automatic";
57
+ /** Documentation: https://esbuild.github.io/api/#jsx-factory */
58
+ jsxFactory?: string;
59
+ /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
60
+ jsxFragment?: string;
61
+ /** Documentation: https://esbuild.github.io/api/#jsx-import-source */
62
+ jsxImportSource?: string;
63
+ /** Documentation: https://esbuild.github.io/api/#jsx-development */
64
+ jsxDev?: boolean;
65
+ /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
66
+ jsxSideEffects?: boolean;
67
+ /** Documentation: https://esbuild.github.io/api/#define */
68
+ define?: {
69
+ [key: string]: string;
70
+ };
71
+ /** Documentation: https://esbuild.github.io/api/#pure */
72
+ pure?: string[];
73
+ /** Documentation: https://esbuild.github.io/api/#keep-names */
74
+ keepNames?: boolean;
75
+ /** Documentation: https://esbuild.github.io/api/#abs-paths */
76
+ absPaths?: AbsPaths[];
77
+ /** Documentation: https://esbuild.github.io/api/#color */
78
+ color?: boolean;
79
+ /** Documentation: https://esbuild.github.io/api/#log-level */
80
+ logLevel?: LogLevel;
81
+ /** Documentation: https://esbuild.github.io/api/#log-limit */
82
+ logLimit?: number;
83
+ /** Documentation: https://esbuild.github.io/api/#log-override */
84
+ logOverride?: Record<string, LogLevel>;
85
+ /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
86
+ tsconfigRaw?: string | TsconfigRaw;
87
+ }
88
+ export interface TsconfigRaw {
89
+ compilerOptions?: {
90
+ alwaysStrict?: boolean;
91
+ baseUrl?: string;
92
+ experimentalDecorators?: boolean;
93
+ importsNotUsedAsValues?: "remove" | "preserve" | "error";
94
+ jsx?: "preserve" | "react-native" | "react" | "react-jsx" | "react-jsxdev";
95
+ jsxFactory?: string;
96
+ jsxFragmentFactory?: string;
97
+ jsxImportSource?: string;
98
+ paths?: Record<string, string[]>;
99
+ preserveValueImports?: boolean;
100
+ strict?: boolean;
101
+ target?: string;
102
+ useDefineForClassFields?: boolean;
103
+ verbatimModuleSyntax?: boolean;
104
+ };
105
+ }
106
+ export interface BuildOptions extends CommonOptions {
107
+ /** Documentation: https://esbuild.github.io/api/#bundle */
108
+ bundle?: boolean;
109
+ /** Documentation: https://esbuild.github.io/api/#splitting */
110
+ splitting?: boolean;
111
+ /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
112
+ preserveSymlinks?: boolean;
113
+ /** Documentation: https://esbuild.github.io/api/#outfile */
114
+ outfile?: string;
115
+ /** Documentation: https://esbuild.github.io/api/#metafile */
116
+ metafile?: boolean;
117
+ /** Documentation: https://esbuild.github.io/api/#outdir */
118
+ outdir?: string;
119
+ /** Documentation: https://esbuild.github.io/api/#outbase */
120
+ outbase?: string;
121
+ /** Documentation: https://esbuild.github.io/api/#external */
122
+ external?: string[];
123
+ /** Documentation: https://esbuild.github.io/api/#packages */
124
+ packages?: "bundle" | "external";
125
+ /** Documentation: https://esbuild.github.io/api/#alias */
126
+ alias?: Record<string, string>;
127
+ /** Documentation: https://esbuild.github.io/api/#loader */
128
+ loader?: {
129
+ [ext: string]: Loader;
130
+ };
131
+ /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
132
+ resolveExtensions?: string[];
133
+ /** Documentation: https://esbuild.github.io/api/#main-fields */
134
+ mainFields?: string[];
135
+ /** Documentation: https://esbuild.github.io/api/#conditions */
136
+ conditions?: string[];
137
+ /** Documentation: https://esbuild.github.io/api/#write */
138
+ write?: boolean;
139
+ /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
140
+ allowOverwrite?: boolean;
141
+ /** Documentation: https://esbuild.github.io/api/#tsconfig */
142
+ tsconfig?: string;
143
+ /** Documentation: https://esbuild.github.io/api/#out-extension */
144
+ outExtension?: {
145
+ [ext: string]: string;
146
+ };
147
+ /** Documentation: https://esbuild.github.io/api/#public-path */
148
+ publicPath?: string;
149
+ /** Documentation: https://esbuild.github.io/api/#entry-names */
150
+ entryNames?: string;
151
+ /** Documentation: https://esbuild.github.io/api/#chunk-names */
152
+ chunkNames?: string;
153
+ /** Documentation: https://esbuild.github.io/api/#asset-names */
154
+ assetNames?: string;
155
+ /** Documentation: https://esbuild.github.io/api/#inject */
156
+ inject?: string[];
157
+ /** Documentation: https://esbuild.github.io/api/#banner */
158
+ banner?: {
159
+ [type: string]: string;
160
+ };
161
+ /** Documentation: https://esbuild.github.io/api/#footer */
162
+ footer?: {
163
+ [type: string]: string;
164
+ };
165
+ /** Documentation: https://esbuild.github.io/api/#entry-points */
166
+ entryPoints?: (string | {
167
+ in: string;
168
+ out: string;
169
+ })[] | Record<string, string>;
170
+ /** Documentation: https://esbuild.github.io/api/#stdin */
171
+ stdin?: StdinOptions;
172
+ /** Documentation: https://esbuild.github.io/plugins/ */
173
+ plugins?: Plugin[];
174
+ /** Documentation: https://esbuild.github.io/api/#working-directory */
175
+ absWorkingDir?: string;
176
+ /** Documentation: https://esbuild.github.io/api/#node-paths */
177
+ nodePaths?: string[];
178
+ }
179
+ export interface StdinOptions {
180
+ contents: string | Uint8Array;
181
+ resolveDir?: string;
182
+ sourcefile?: string;
183
+ loader?: Loader;
184
+ }
185
+ export interface Message {
186
+ id: string;
187
+ pluginName: string;
188
+ text: string;
189
+ location: Location | null;
190
+ notes: Note[];
191
+ /**
192
+ * Optional user-specified data that is passed through unmodified. You can
193
+ * use this to stash the original error, for example.
194
+ */
195
+ detail: any;
196
+ }
197
+ export interface Note {
198
+ text: string;
199
+ location: Location | null;
200
+ }
201
+ export interface Location {
202
+ file: string;
203
+ namespace: string;
204
+ /** 1-based */
205
+ line: number;
206
+ /** 0-based, in bytes */
207
+ column: number;
208
+ /** in bytes */
209
+ length: number;
210
+ lineText: string;
211
+ suggestion: string;
212
+ }
213
+ export interface OutputFile {
214
+ path: string;
215
+ contents: Uint8Array;
216
+ hash: string;
217
+ /** "contents" as text (changes automatically with "contents") */
218
+ readonly text: string;
219
+ }
220
+ export interface BuildResult<ProvidedOptions extends BuildOptions = BuildOptions> {
221
+ errors: Message[];
222
+ warnings: Message[];
223
+ /** Only when "write: false" */
224
+ outputFiles: OutputFile[] | (ProvidedOptions["write"] extends false ? never : undefined);
225
+ /** Only when "metafile: true" */
226
+ metafile: Metafile | (ProvidedOptions["metafile"] extends true ? never : undefined);
227
+ /** Only when "mangleCache" is present */
228
+ mangleCache: Record<string, string | false> | (ProvidedOptions["mangleCache"] extends Object ? never : undefined);
229
+ }
230
+ export interface BuildFailure extends Error {
231
+ errors: Message[];
232
+ warnings: Message[];
233
+ }
234
+ /** Documentation: https://esbuild.github.io/api/#serve-arguments */
235
+ export interface ServeOptions {
236
+ port?: number;
237
+ host?: string;
238
+ servedir?: string;
239
+ keyfile?: string;
240
+ certfile?: string;
241
+ fallback?: string;
242
+ cors?: CORSOptions;
243
+ onRequest?: (args: ServeOnRequestArgs) => void;
244
+ }
245
+ /** Documentation: https://esbuild.github.io/api/#cors */
246
+ export interface CORSOptions {
247
+ origin?: string | string[];
248
+ }
249
+ export interface ServeOnRequestArgs {
250
+ remoteAddress: string;
251
+ method: string;
252
+ path: string;
253
+ status: number;
254
+ /** The time to generate the response, not to send it */
255
+ timeInMS: number;
256
+ }
257
+ /** Documentation: https://esbuild.github.io/api/#serve-return-values */
258
+ export interface ServeResult {
259
+ port: number;
260
+ hosts: string[];
261
+ }
262
+ export interface TransformOptions extends CommonOptions {
263
+ /** Documentation: https://esbuild.github.io/api/#sourcefile */
264
+ sourcefile?: string;
265
+ /** Documentation: https://esbuild.github.io/api/#loader */
266
+ loader?: Loader;
267
+ /** Documentation: https://esbuild.github.io/api/#banner */
268
+ banner?: string;
269
+ /** Documentation: https://esbuild.github.io/api/#footer */
270
+ footer?: string;
271
+ }
272
+ export interface TransformResult<ProvidedOptions extends TransformOptions = TransformOptions> {
273
+ code: string;
274
+ map: string;
275
+ warnings: Message[];
276
+ /** Only when "mangleCache" is present */
277
+ mangleCache: Record<string, string | false> | (ProvidedOptions["mangleCache"] extends Object ? never : undefined);
278
+ /** Only when "legalComments" is "external" */
279
+ legalComments: string | (ProvidedOptions["legalComments"] extends "external" ? never : undefined);
280
+ }
281
+ export interface TransformFailure extends Error {
282
+ errors: Message[];
283
+ warnings: Message[];
284
+ }
285
+ export interface Plugin {
286
+ name: string;
287
+ setup: (build: PluginBuild) => void | Promise<void>;
288
+ }
289
+ export interface PluginBuild {
290
+ /** Documentation: https://esbuild.github.io/plugins/#build-options */
291
+ initialOptions: BuildOptions;
292
+ /** Documentation: https://esbuild.github.io/plugins/#resolve */
293
+ resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>;
294
+ /** Documentation: https://esbuild.github.io/plugins/#on-start */
295
+ onStart(callback: () => OnStartResult | null | void | Promise<OnStartResult | null | void>): void;
296
+ /** Documentation: https://esbuild.github.io/plugins/#on-end */
297
+ onEnd(callback: (result: BuildResult) => OnEndResult | null | void | Promise<OnEndResult | null | void>): void;
298
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve */
299
+ onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>): void;
300
+ /** Documentation: https://esbuild.github.io/plugins/#on-load */
301
+ onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>): void;
302
+ /** Documentation: https://esbuild.github.io/plugins/#on-dispose */
303
+ onDispose(callback: () => void): void;
304
+ esbuild: {
305
+ context: typeof context;
306
+ build: typeof build;
307
+ buildSync: typeof buildSync;
308
+ transform: typeof transform;
309
+ transformSync: typeof transformSync;
310
+ formatMessages: typeof formatMessages;
311
+ formatMessagesSync: typeof formatMessagesSync;
312
+ analyzeMetafile: typeof analyzeMetafile;
313
+ analyzeMetafileSync: typeof analyzeMetafileSync;
314
+ initialize: typeof initialize;
315
+ version: typeof version;
316
+ };
317
+ }
318
+ /** Documentation: https://esbuild.github.io/plugins/#resolve-options */
319
+ export interface ResolveOptions {
320
+ pluginName?: string;
321
+ importer?: string;
322
+ namespace?: string;
323
+ resolveDir?: string;
324
+ kind?: ImportKind;
325
+ pluginData?: any;
326
+ with?: Record<string, string>;
327
+ }
328
+ /** Documentation: https://esbuild.github.io/plugins/#resolve-results */
329
+ export interface ResolveResult {
330
+ errors: Message[];
331
+ warnings: Message[];
332
+ path: string;
333
+ external: boolean;
334
+ sideEffects: boolean;
335
+ namespace: string;
336
+ suffix: string;
337
+ pluginData: any;
338
+ }
339
+ export interface OnStartResult {
340
+ errors?: PartialMessage[];
341
+ warnings?: PartialMessage[];
342
+ }
343
+ export interface OnEndResult {
344
+ errors?: PartialMessage[];
345
+ warnings?: PartialMessage[];
346
+ }
347
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
348
+ export interface OnResolveOptions {
349
+ filter: RegExp;
350
+ namespace?: string;
351
+ }
352
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
353
+ export interface OnResolveArgs {
354
+ path: string;
355
+ importer: string;
356
+ namespace: string;
357
+ resolveDir: string;
358
+ kind: ImportKind;
359
+ pluginData: any;
360
+ with: Record<string, string>;
361
+ }
362
+ export type ImportKind = "entry-point" | "import-statement" | "require-call" | "dynamic-import" | "require-resolve" | "import-rule" | "composes-from" | "url-token";
363
+ /** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
364
+ export interface OnResolveResult {
365
+ pluginName?: string;
366
+ errors?: PartialMessage[];
367
+ warnings?: PartialMessage[];
368
+ path?: string;
369
+ external?: boolean;
370
+ sideEffects?: boolean;
371
+ namespace?: string;
372
+ suffix?: string;
373
+ pluginData?: any;
374
+ watchFiles?: string[];
375
+ watchDirs?: string[];
376
+ }
377
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-options */
378
+ export interface OnLoadOptions {
379
+ filter: RegExp;
380
+ namespace?: string;
381
+ }
382
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
383
+ export interface OnLoadArgs {
384
+ path: string;
385
+ namespace: string;
386
+ suffix: string;
387
+ pluginData: any;
388
+ with: Record<string, string>;
389
+ }
390
+ /** Documentation: https://esbuild.github.io/plugins/#on-load-results */
391
+ export interface OnLoadResult {
392
+ pluginName?: string;
393
+ errors?: PartialMessage[];
394
+ warnings?: PartialMessage[];
395
+ contents?: string | Uint8Array;
396
+ resolveDir?: string;
397
+ loader?: Loader;
398
+ pluginData?: any;
399
+ watchFiles?: string[];
400
+ watchDirs?: string[];
401
+ }
402
+ export interface PartialMessage {
403
+ id?: string;
404
+ pluginName?: string;
405
+ text?: string;
406
+ location?: Partial<Location> | null;
407
+ notes?: PartialNote[];
408
+ detail?: any;
409
+ }
410
+ export interface PartialNote {
411
+ text?: string;
412
+ location?: Partial<Location> | null;
413
+ }
414
+ /** Documentation: https://esbuild.github.io/api/#metafile */
415
+ export interface Metafile {
416
+ inputs: {
417
+ [path: string]: {
418
+ bytes: number;
419
+ imports: {
420
+ path: string;
421
+ kind: ImportKind;
422
+ external?: boolean;
423
+ original?: string;
424
+ with?: Record<string, string>;
425
+ }[];
426
+ format?: "cjs" | "esm";
427
+ with?: Record<string, string>;
428
+ };
429
+ };
430
+ outputs: {
431
+ [path: string]: {
432
+ bytes: number;
433
+ inputs: {
434
+ [path: string]: {
435
+ bytesInOutput: number;
436
+ };
437
+ };
438
+ imports: {
439
+ path: string;
440
+ kind: ImportKind | "file-loader";
441
+ external?: boolean;
442
+ }[];
443
+ exports: string[];
444
+ entryPoint?: string;
445
+ cssBundle?: string;
446
+ };
447
+ };
448
+ }
449
+ export interface FormatMessagesOptions {
450
+ kind: "error" | "warning";
451
+ color?: boolean;
452
+ terminalWidth?: number;
453
+ }
454
+ export interface AnalyzeMetafileOptions {
455
+ color?: boolean;
456
+ verbose?: boolean;
457
+ }
458
+ /** Documentation: https://esbuild.github.io/api/#watch-arguments */
459
+ export interface WatchOptions {
460
+ delay?: number;
461
+ }
462
+ export interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> {
463
+ /** Documentation: https://esbuild.github.io/api/#rebuild */
464
+ rebuild(): Promise<BuildResult<ProvidedOptions>>;
465
+ /** Documentation: https://esbuild.github.io/api/#watch */
466
+ watch(options?: WatchOptions): Promise<void>;
467
+ /** Documentation: https://esbuild.github.io/api/#serve */
468
+ serve(options?: ServeOptions): Promise<ServeResult>;
469
+ cancel(): Promise<void>;
470
+ dispose(): Promise<void>;
471
+ }
472
+ type SameShape<Out, In extends Out> = In & {
473
+ [Key in Exclude<keyof In, keyof Out>]: never;
474
+ };
475
+ /**
476
+ * This function invokes the "esbuild" command-line tool for you. It returns a
477
+ * promise that either resolves with a "BuildResult" object or rejects with a
478
+ * "BuildFailure" object.
479
+ *
480
+ * - Works in node: yes
481
+ * - Works in browser: yes
482
+ *
483
+ * Documentation: https://esbuild.github.io/api/#build
484
+ */
485
+ export declare function build<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildResult<T>>;
486
+ /**
487
+ * This is the advanced long-running form of "build" that supports additional
488
+ * features such as watch mode and a local development server.
489
+ *
490
+ * - Works in node: yes
491
+ * - Works in browser: no
492
+ *
493
+ * Documentation: https://esbuild.github.io/api/#build
494
+ */
495
+ export declare function context<T extends BuildOptions>(options: SameShape<BuildOptions, T>): Promise<BuildContext<T>>;
496
+ /**
497
+ * This function transforms a single JavaScript file. It can be used to minify
498
+ * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
499
+ * to older JavaScript. It returns a promise that is either resolved with a
500
+ * "TransformResult" object or rejected with a "TransformFailure" object.
501
+ *
502
+ * - Works in node: yes
503
+ * - Works in browser: yes
504
+ *
505
+ * Documentation: https://esbuild.github.io/api/#transform
506
+ */
507
+ export declare function transform<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): Promise<TransformResult<T>>;
508
+ /**
509
+ * Converts log messages to formatted message strings suitable for printing in
510
+ * the terminal. This allows you to reuse the built-in behavior of esbuild's
511
+ * log message formatter. This is a batch-oriented API for efficiency.
512
+ *
513
+ * - Works in node: yes
514
+ * - Works in browser: yes
515
+ */
516
+ export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>;
517
+ /**
518
+ * Pretty-prints an analysis of the metafile JSON to a string. This is just for
519
+ * convenience to be able to match esbuild's pretty-printing exactly. If you want
520
+ * to customize it, you can just inspect the data in the metafile yourself.
521
+ *
522
+ * - Works in node: yes
523
+ * - Works in browser: yes
524
+ *
525
+ * Documentation: https://esbuild.github.io/api/#analyze
526
+ */
527
+ export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>;
528
+ /**
529
+ * A synchronous version of "build".
530
+ *
531
+ * - Works in node: yes
532
+ * - Works in browser: no
533
+ *
534
+ * Documentation: https://esbuild.github.io/api/#build
535
+ */
536
+ export declare function buildSync<T extends BuildOptions>(options: SameShape<BuildOptions, T>): BuildResult<T>;
537
+ /**
538
+ * A synchronous version of "transform".
539
+ *
540
+ * - Works in node: yes
541
+ * - Works in browser: no
542
+ *
543
+ * Documentation: https://esbuild.github.io/api/#transform
544
+ */
545
+ export declare function transformSync<T extends TransformOptions>(input: string | Uint8Array, options?: SameShape<TransformOptions, T>): TransformResult<T>;
546
+ /**
547
+ * A synchronous version of "formatMessages".
548
+ *
549
+ * - Works in node: yes
550
+ * - Works in browser: no
551
+ */
552
+ export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
553
+ /**
554
+ * A synchronous version of "analyzeMetafile".
555
+ *
556
+ * - Works in node: yes
557
+ * - Works in browser: no
558
+ *
559
+ * Documentation: https://esbuild.github.io/api/#analyze
560
+ */
561
+ export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string;
562
+ /**
563
+ * This configures the browser-based version of esbuild. It is necessary to
564
+ * call this first and wait for the returned promise to be resolved before
565
+ * making other API calls when using esbuild in the browser.
566
+ *
567
+ * - Works in node: yes
568
+ * - Works in browser: yes ("options" is required)
569
+ *
570
+ * Documentation: https://esbuild.github.io/api/#browser
571
+ */
572
+ export declare function initialize(options: InitializeOptions): Promise<void>;
573
+ export interface InitializeOptions {
574
+ /**
575
+ * The URL of the "esbuild.wasm" file. This must be provided when running
576
+ * esbuild in the browser.
577
+ */
578
+ wasmURL?: string | URL;
579
+ /**
580
+ * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
581
+ * is a typed array or ArrayBuffer containing the binary code of the
582
+ * "esbuild.wasm" file.
583
+ *
584
+ * You can use this as an alternative to "wasmURL" for environments where it's
585
+ * not possible to download the WebAssembly module.
586
+ */
587
+ wasmModule?: WebAssembly.Module;
588
+ /**
589
+ * By default esbuild runs the WebAssembly-based browser API in a web worker
590
+ * to avoid blocking the UI thread. This can be disabled by setting "worker"
591
+ * to false.
592
+ */
593
+ worker?: boolean;
594
+ }
595
+ export declare let version: string;
596
+ export declare function stop(): Promise<void>;
597
+ export {};
598
+ //# sourceMappingURL=mod.d.ts.map