vivth 1.3.2 → 1.3.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.
Files changed (56) hide show
  1. package/README.md +2141 -1776
  2. package/README.src.md +5 -0
  3. package/bun.lock +6 -0
  4. package/index.mjs +12 -3
  5. package/package.json +4 -2
  6. package/src/bundler/CompileJS.mjs +60 -28
  7. package/src/bundler/EsBundler.mjs +2 -1
  8. package/src/bundler/FSInline.mjs +8 -1
  9. package/src/bundler/FSInlineAnalyzer.mjs +47 -38
  10. package/src/bundler/adds/ToBundledJSPlugin.mjs +38 -26
  11. package/src/bundler/adds/pluginVivthBundle.mjs +3 -1
  12. package/src/class/EventSignal.mjs +15 -9
  13. package/src/class/ListSignal.mjs +1 -1
  14. package/src/class/LitExp.mjs +3 -2
  15. package/src/class/Paths.mjs +0 -4
  16. package/src/class/QChannel.mjs +4 -5
  17. package/src/class/SafeExit.mjs +7 -7
  18. package/src/class/Signal.mjs +4 -1
  19. package/src/common/Base64URL.mjs +6 -4
  20. package/src/common/Dev.mjs +134 -0
  21. package/src/common/DevBundled.mjs +5 -0
  22. package/src/common/Trace.mjs +24 -0
  23. package/src/doc/JSautoDOC.mjs +15 -11
  24. package/src/doc/parsedFile.mjs +1 -1
  25. package/src/function/GetNamedImportAlias.mjs +37 -0
  26. package/src/function/LazyFactory.mjs +1 -1
  27. package/src/function/TsToMjs.mjs +3 -3
  28. package/src/types/DevTestCB.mjs +11 -0
  29. package/src/types/Runtime.mjs +0 -1
  30. package/src/types/VivthDevCodeBlockStringType.mjs +6 -0
  31. package/tsconfig.json +6 -1
  32. package/types/index.d.mts +8 -3
  33. package/types/src/bundler/CompileJS.d.mts +56 -28
  34. package/types/src/bundler/EsBundler.d.mts +2 -2
  35. package/types/src/bundler/FSInline.d.mts +8 -1
  36. package/types/src/bundler/FSInlineAnalyzer.d.mts +1 -0
  37. package/types/src/bundler/adds/ToBundledJSPlugin.d.mts +6 -3
  38. package/types/src/class/EventSignal.d.mts +8 -8
  39. package/types/src/class/ListSignal.d.mts +2 -2
  40. package/types/src/class/LitExp.d.mts +1 -0
  41. package/types/src/class/Paths.d.mts +0 -4
  42. package/types/src/class/QChannel.d.mts +4 -4
  43. package/types/src/class/SafeExit.d.mts +7 -7
  44. package/types/src/common/Base64URL.d.mts +5 -3
  45. package/types/src/common/Dev.d.mts +68 -0
  46. package/types/src/common/DevBundled.d.mts +3 -0
  47. package/types/src/common/Trace.d.mts +14 -0
  48. package/types/src/doc/JSautoDOC.d.mts +8 -7
  49. package/types/src/function/GetNamedImportAlias.d.mts +22 -0
  50. package/types/src/function/LazyFactory.d.mts +1 -1
  51. package/types/src/function/TsToMjs.d.mts +3 -3
  52. package/types/src/function/WithDefer.d.mts +10 -0
  53. package/types/src/types/DevTestCB.d.mts +3 -0
  54. package/types/src/types/IsDevCBStringType.d.mts +4 -0
  55. package/types/src/types/Runtime.d.mts +3 -0
  56. package/types/src/types/VivthDevCodeBlockStringType.d.mts +4 -0
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * @description
3
- * - class helper to inline file;
3
+ * - class helper to inline files;
4
+ * >- as `type: "buffer"`;
4
5
  * - use only if you are planning to use [CompileJS](#compilejs);
6
+ * >- the class static methods don't obfuscate target file;
7
+ * >- don't embed any sensitive content using this methods of this class;
5
8
  */
6
9
  export class FSInline {
7
10
  /**
@@ -12,6 +15,9 @@ export class FSInline {
12
15
  * @param {string} filePathFromProject
13
16
  * - doesn't require prefix;
14
17
  * @returns {Promise<Buffer<ArrayBuffer>>}
18
+ * - dev: returns `ArrayBuffer`;
19
+ * - bundled: embed the `ArrayBuffer` of file, which then returned;
20
+ * >- `Dev` will be cleaned up;
15
21
  * @example
16
22
  * import { FSInline } from 'vivth';
17
23
  *
@@ -21,6 +27,7 @@ export class FSInline {
21
27
  /**
22
28
  * @description
23
29
  * - declare entrypoint of file inlining, include all files on `dir` and `subdir` that match the `fileRule`;
30
+ * - consider this as inline assets embed/bundler;
24
31
  * @param {string} dirPathFromProject
25
32
  * - doesn't require prefix;
26
33
  * @param {RegExp} fileRule
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @description
3
3
  * - collections of static method to analyze content for `FSInline`;
4
+ * - mostly used internally;
4
5
  */
5
6
  export class FSInlineAnalyzer {
6
7
  /**
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * @description
3
3
  * - generate `esbuild.Plugin` for changing dev time file into runtime file;
4
- * - on using esbuild with this plugin, it will replace any module that have similiar file name but ended with Bundled(before extname);
4
+ * - on using esbuild with this plugin, it will:
5
+ * >- replace any module that have similiar file name but ended with Bundled(before extname);
5
6
  * >- works on `.mts`|`.ts`|`.mjs`|`.cjs`|`.js`;
6
- * >- `anyFileName.mjs` -> seek for and use `anyFileNameBundled.mjs`, if not found use `anyFileName.mjs`;
7
+ * >- `${fileName}.mjs` -> seek for and use `${fileName}Bundled.mjs`, if not found use `${fileName}.mjs`;
8
+ * >- removes `Dev.vivthDevCodeBlock` code block;
7
9
  * @param {string} includedInPath
8
- * - is generalized, you can freely uses forward or backward slash;
10
+ * - is generalized path, you can freely uses forward or backward slash;
9
11
  * @returns {ReturnType<CreateESPlugin>}
10
12
  * @example
11
13
  * import { ToBundledJSPlugin } from 'vivth';
@@ -13,4 +15,5 @@
13
15
  * export const myBundledPlugin = ToBundledJSPlugin('/myProjectName/src/');
14
16
  */
15
17
  export function ToBundledJSPlugin(includedInPath: string): ReturnType<typeof CreateESPlugin>;
18
+ export function removeVivthDevCodeBlock(originalContent_: string): string;
16
19
  import { CreateESPlugin } from '../CreateESPlugin.mjs';
@@ -44,14 +44,14 @@ export class EventSignal<ISLIST extends boolean> {
44
44
  * @description
45
45
  * - remove subscriber from the named `EventSignal_instance`;
46
46
  * @param {string} name
47
- * @param {import('./Effect.mjs').Effect} effect
47
+ * @param {import('./Effect.mjs').Effect} effectInstance
48
48
  * @returns {void}
49
49
  * @example
50
50
  * import { EventSignal } from 'vivth';
51
51
  *
52
52
  * EventSignal.remove.subscriber('yourEventSignalName', myEffectInstance);
53
53
  */
54
- subscriber: (name: string, effect: import("./Effect.mjs").Effect) => void;
54
+ subscriber: (name: string, effectInstance: import("./Effect.mjs").Effect) => void;
55
55
  /**
56
56
  * @static remove
57
57
  * @description
@@ -83,14 +83,14 @@ export class EventSignal<ISLIST extends boolean> {
83
83
  * @description
84
84
  * - remove subscriber from the named `EventSignal_instance`;
85
85
  * @param {string} name
86
- * @param {import('./Effect.mjs').Effect} effect
86
+ * @param {import('./Effect.mjs').Effect} effectInstance
87
87
  * @returns {void}
88
88
  * @example
89
89
  * import { EventSignal } from 'vivth';
90
90
  *
91
91
  * EventSignal.remove.subscriber('yourEventSignalName', myEffectInstance);
92
92
  */
93
- subscriber: (name: string, effect: import("./Effect.mjs").Effect) => void;
93
+ subscriber: (name: string, effectInstance: import("./Effect.mjs").Effect) => void;
94
94
  /**
95
95
  * @static remove
96
96
  * @description
@@ -170,7 +170,7 @@ export class EventSignal<ISLIST extends boolean> {
170
170
  * @instance remove
171
171
  * @description
172
172
  * - remove subscriber from the `EventSignal_instance`;
173
- * @param {import('./Effect.mjs').Effect} effect
173
+ * @param {import('./Effect.mjs').Effect} effectInstance
174
174
  * @returns {void}
175
175
  * @example
176
176
  * import { EventSignal, Effect, Console } from 'vivth';
@@ -184,7 +184,7 @@ export class EventSignal<ISLIST extends boolean> {
184
184
  * myEventSignal.dispatch.value = 'hey';
185
185
  * eventSignal_instance.remove.subscriber(myEffectInstance);
186
186
  */
187
- subscriber: (effect: import("./Effect.mjs").Effect) => void;
187
+ subscriber: (effectInstance: import("./Effect.mjs").Effect) => void;
188
188
  /**
189
189
  * @instance remove
190
190
  * @description
@@ -227,7 +227,7 @@ export class EventSignal<ISLIST extends boolean> {
227
227
  * @instance remove
228
228
  * @description
229
229
  * - remove subscriber from the `EventSignal_instance`;
230
- * @param {import('./Effect.mjs').Effect} effect
230
+ * @param {import('./Effect.mjs').Effect} effectInstance
231
231
  * @returns {void}
232
232
  * @example
233
233
  * import { EventSignal, Effect, Console } from 'vivth';
@@ -241,7 +241,7 @@ export class EventSignal<ISLIST extends boolean> {
241
241
  * myEventSignal.dispatch.value = 'hey';
242
242
  * eventSignal_instance.remove.subscriber(myEffectInstance);
243
243
  */
244
- subscriber: (effect: import("./Effect.mjs").Effect) => void;
244
+ subscriber: (effectInstance: import("./Effect.mjs").Effect) => void;
245
245
  /**
246
246
  * @instance remove
247
247
  * @description
@@ -40,7 +40,7 @@ export class ListSignal<LISTARG extends import("../types/ListArg.mjs").ListArg>
40
40
  * @instance arrayMethods
41
41
  * @description
42
42
  * - reference to structuredClone elements of `value`;
43
- * - calling doesn't notify
43
+ * - calling doesn't notify for changes;
44
44
  * @returns {Array<LISTARG>}
45
45
  */
46
46
  readonly structuredClone: Array<LISTARG>;
@@ -146,7 +146,7 @@ export class ListSignal<LISTARG extends import("../types/ListArg.mjs").ListArg>
146
146
  * @instance arrayMethods
147
147
  * @description
148
148
  * - reference to structuredClone elements of `value`;
149
- * - calling doesn't notify
149
+ * - calling doesn't notify for changes;
150
150
  * @returns {Array<LISTARG>}
151
151
  */
152
152
  readonly structuredClone: Array<LISTARG>;
@@ -7,6 +7,7 @@
7
7
  * >- destructuring is meant for extensive typehelper;
8
8
  * >- and destructuring can lead to unhandled error here and there;
9
9
  * >- therefore error as value is introduced to help to prevent error on runtime;
10
+ * - made primarily for generating string file, that are purely managed programatically;
10
11
  * @template {LitExpKeyType} KEYS
11
12
  */
12
13
  export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyType> {
@@ -57,10 +57,6 @@ export class Paths {
57
57
  * ```js
58
58
  * Deno.env.get("INIT_CWD") ?? Deno.cwd()
59
59
  * ```
60
- * - pkg:
61
- * ```js
62
- * __dirname
63
- * ```
64
60
  * - other: you need to check your JSRuntime for the rootPath reference;
65
61
  * @example
66
62
  * import { Paths } from 'vivth';
@@ -19,9 +19,9 @@ export class QChannel<DEFINEDANY extends import("../types/AnyButUndefined.mjs").
19
19
  * import { QChannel } from 'vivth';
20
20
  *
21
21
  * const myMappedQref = (window['myMappedQref'] = new Map());
22
- * export const MyQClass = QChannel.makeQClass(myMappedQref);
22
+ * export const MyQClass = QChannel.setup(myMappedQref);
23
23
  */
24
- static makeQClass: (uniqueMap: Map<import("../types/AnyButUndefined.mjs").AnyButUndefined, [Promise<any>, {}]>) => typeof QChannel;
24
+ static setup: (uniqueMap: Map<import("../types/AnyButUndefined.mjs").AnyButUndefined, [Promise<any>, {}]>) => typeof QChannel;
25
25
  /**
26
26
  * @type {Map<AnyButUndefined, [Promise<any>, {}]>}
27
27
  */
@@ -140,7 +140,7 @@ export class QChannel<DEFINEDANY extends import("../types/AnyButUndefined.mjs").
140
140
  * - `callbackBlock` with error as value:
141
141
  * - caveat:
142
142
  * >- no need to manually call resume();
143
- * >- slightly less performant than `callback`;
143
+ * >- slightly less performant than `key`;
144
144
  * @template RESULT
145
145
  * @param {DEFINEDANY} keyID
146
146
  * @param {(options:Omit<QCBReturn,
@@ -149,7 +149,7 @@ export class QChannel<DEFINEDANY extends import("../types/AnyButUndefined.mjs").
149
149
  * @returns {ReturnType<typeof TryAsync<RESULT>>}
150
150
  * @example
151
151
  * const q = new QChannel('channel name');
152
- * const [result, error] = await q.callback(keyID, async ({ isLastOnQ }) = > {
152
+ * const [result, error] = await q.callback(keyID, async ({ isLastOnQ }) => {
153
153
  * // if (!isLastOnQ()) { // imperative debounce if needed
154
154
  * // return;
155
155
  * // }
@@ -42,7 +42,7 @@ export class SafeExit {
42
42
  * SafeExit.instance.exiting.correction(true);
43
43
  * Console.log(`safe exit via "${eventName}"`);
44
44
  * });
45
- * };
45
+ * }
46
46
  * ```
47
47
  * - example Deno:
48
48
  * ```js
@@ -65,11 +65,11 @@ export class SafeExit {
65
65
  * // optional deno example
66
66
  * listener : (eventName) => {
67
67
  * const sig = Deno.signal(eventName);
68
- * for await (const _ of sig) {
69
- * exiting.correction(true);
70
- * sig.dispose();
71
- * Console.log(`safe exit via "${eventName}"`);
72
- * }
68
+ * for await (const _ of sig) {
69
+ * exiting.correction(true);
70
+ * sig.dispose();
71
+ * Console.log(`safe exit via "${eventName}"`);
72
+ * }
73
73
  * }
74
74
  * });
75
75
  */
@@ -111,7 +111,7 @@ export class SafeExit {
111
111
  * // code
112
112
  * }
113
113
  * SafeExit.instance.addCallback(exitCallback);
114
- *
114
+ * // somewhere else
115
115
  * SafeExit.instance.removeCallback(exitCallback);
116
116
  */
117
117
  removeCallback: (cb: () => (Promise<void>)) => void;
@@ -2,21 +2,23 @@
2
2
  * @description
3
3
  * - create inline base64 url;
4
4
  * - usage:
5
- * >- can be extremely usefull to display file on desktop app webview, without exposing http server;
5
+ * >- can be extremely usefull to display file on desktop app `webview` or any bundled browser, without exposing http server;
6
6
  * @param {string} fileString
7
7
  * @param {string} mimeType
8
8
  * @param {(string:string)=>string} btoaFunction
9
9
  * - check your js runtime `btoa`;
10
10
  * - node compatible:
11
11
  * ```js
12
- * (str, prevBufferEncoding) =>
13
- * Buffer.from(str, prevBufferEncoding).toString('base64')
12
+ * (str, prevBufferEncoding) => {
13
+ * return Buffer.from(str, prevBufferEncoding).toString('base64');
14
+ * }
14
15
  * ```
15
16
  * @returns {string}
16
17
  * @example
17
18
  * import { Base64URL } from 'vivth'
18
19
  * import fileString from './fileString.mjs';
19
20
  *
21
+ * // example for browser;
20
22
  * Base64URL(fileString, 'application/javascript', btoa);
21
23
  */
22
24
  export function Base64URL(fileString: string, mimeType: string, btoaFunction: (string: string) => string): string;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @typedef {import("../types/VivthDevCodeBlockStringType.mjs").VivthDevCodeBlockStringType} VivthDevCodeBlockStringType
3
+ * @typedef {import('../types/DevTestCB.mjs').DevTestCB} DevTestCB
4
+ */
5
+ /**
6
+ * @description
7
+ * - class helper for `devTime` only code block;
8
+ */
9
+ export class Dev {
10
+ /**
11
+ * @description
12
+ * - persistent variable(during `devTime` and `bundled`);
13
+ * - can be used as `condition` for checking whether it is in `devTime` or `bundled`;
14
+ * @type {boolean}
15
+ * @example
16
+ * import { Dev } from 'vivth';
17
+ *
18
+ * if (Dev.isDev) {
19
+ * // this code block will presist even on `bundled`;
20
+ * }
21
+ */
22
+ static isDev: boolean;
23
+ /**
24
+ * @type {Signal<Map<string,Awaited<ReturnType<typeof TryAsync<boolean>>>>>}
25
+ */
26
+ static #notifications: Signal<Map<string, Awaited<ReturnType<typeof TryAsync<boolean>>>>>;
27
+ /**
28
+ * @type {DevTestCB}
29
+ */
30
+ static #test: DevTestCB;
31
+ static #effectForCheck: Effect & {
32
+ "vivth:unwrapLazy;": () => Effect;
33
+ };
34
+ /**
35
+ * @description
36
+ * - to wrap `devTime` only code block;
37
+ * - when bundled uses `EsBundler` or esbuild with `ToBundledJSPlugin` plugin, the code block will be removed on the bundled version;
38
+ * @param {(options:{test:DevTestCB})=>Promise<void>} callback
39
+ * - also provide `test` method for inline testing:
40
+ * >- which is wrapped in `TryAsync`, throwed errors will automatically return `false`;
41
+ * @param {VivthDevCodeBlockStringType} _closing
42
+ * - it is needed to detect the code block closing;
43
+ * - should use single or double quote and not back tick;
44
+ * @returns {Promise<void>}
45
+ * @example
46
+ * import { Dev, Signal } from 'vivth';
47
+ *
48
+ * Dev.vivthDevCodeBlock(async function () {
49
+ * // this code block will be removed on `bundled` version;
50
+ * }, 'vivthDevCodeBlock');
51
+ *
52
+ * const numberSignal = new Signal(0);
53
+ * Dev.vivthDevCodeBlock(async ({ test }) => {
54
+ * // this code block will be removed on `bundled` version;
55
+ * const [{ removeId: removeTest }] = await Promise.all([
56
+ * test(async () => numberSignal.value === 0)
57
+ * ])
58
+ * }, 'vivthDevCodeBlock');
59
+ */
60
+ static vivthDevCodeBlock: (callback: (options: {
61
+ test: DevTestCB;
62
+ }) => Promise<void>, _closing: VivthDevCodeBlockStringType) => Promise<void>;
63
+ }
64
+ export type VivthDevCodeBlockStringType = import("../types/VivthDevCodeBlockStringType.mjs").VivthDevCodeBlockStringType;
65
+ export type DevTestCB = import("../types/DevTestCB.mjs").DevTestCB;
66
+ import { Signal } from '../class/Signal.mjs';
67
+ import { TryAsync } from '../function/TryAsync.mjs';
68
+ import { Effect } from '../class/Effect.mjs';
@@ -0,0 +1,3 @@
1
+ export class Dev {
2
+ static isDev: boolean;
3
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @description
3
+ * - returns position of stack trace as string, formatted as `fileName:lineNumber:columnNumber`;
4
+ * - extremely usefull for:
5
+ * >- jumping positions to code line;
6
+ * >- creating dynamic string id;
7
+ * @param {number} traceIndex
8
+ * @returns {string}
9
+ * @example
10
+ * import { Trace, Console } from 'vivth';
11
+ *
12
+ * Console.log(Trace(3)); // "D://test.mjs:3:13"
13
+ */
14
+ export function Trace(traceIndex: number): string;
@@ -4,21 +4,22 @@
4
4
  * - this autodocumenter uses [chokidar](https://npmjs.com/package/chokidar) under the hood;
5
5
  * - this class also is used to generate this `README.md`;
6
6
  * - behaviours:
7
+ * >- auto export must follows the following rules;
7
8
  * >1) add `"at"noautodoc` on self closing jsdoc comment to opt out from generating documentation on said file;
8
- * >>- auto export must follows the following rules, and there's no way to override;
9
- * >2) export all named exported 'const'|'function'|'async function'|'class', alphanumeric name, started with Capital letter, same name with fileName on `options.pahts.file`;
10
- * >3) declare typedef of existing typedef with alphanumeric name, started with Capital letter, same name with fileName, and have no valid export like on point <sup>1</sup> on `options.pahts.file`;
11
- * >4) create `README.md` based on, `options.paths.dir` and `README.src.md`;
9
+ * >2) will (generate) export all named exported 'const'|'function'|'async function'|'class', alphanumeric name, started with Capital letter, same name with fileName on `options.paths.file`;
10
+ * >3) will (generate) declare typedef of existing typedef with alphanumeric name, started with Capital letter, same name with fileName, and have no valid export like on point <sup>1</sup> on `options.paths.file`;
11
+ * >4) will (generate) create `README.md` based on, `options.paths.dir` and `README.src.md`;
12
12
  * >5) extract `"at"description` jsdoc:
13
13
  * >>- on static/prop that have depths, all of children should have `"at"static`/`"at"instance` `nameOfImmediateParent`, same block but before `"at"description` comment line;
14
14
  * >>- `"at"description` are treated as plain `markdown`;
15
15
  * >>- first `"at"${string}` after `"at"description` until `"at"example` will be treated as `javascript` comment block on the `markdown`;
16
16
  * >>- `"at"example` are treated as `javascript` block on the `markdown` file, and should be placed last on the same comment block;
17
17
  * >>- you can always look at `vivth/src` files to check how the source, and the `README.md` and `index.mjs` documentation/generation results;
18
- * >6) this types of arrow functions will be converted to regullar function, for concise type emition:
18
+ * >6) this types of arrow functions will be converted to regullar function, for concise type emition, includes:
19
19
  * >>- validly exported function;
20
- * >>- static/instance method(s) with generic template;
21
- * >7) transpile `.ts` and `.mts` to `.mjs` same name and directory;
20
+ * >>- static/instance method with generic template;
21
+ * >7) transpile `.ts` and `.mts` to `.mjs` with same name and directory;
22
+ * >>- use `"at"preserve` to preserve tsdoc comment section;
22
23
  */
23
24
  export class JSautoDOC {
24
25
  /**
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @description
3
+ * - regex helper for:
4
+ * >- get named import; OR
5
+ * >- alias of named import;
6
+ * @param {string} content
7
+ * @param {string} moduleName
8
+ * @param {string} packageName
9
+ * @returns {string|undefined}
10
+ * @example
11
+ * import { GetNamedImportAlias } from 'vivth';
12
+ *
13
+ * const checkNoAlias = `
14
+ * import { something } from 'packageName';
15
+ * `
16
+ * const checkAlias = `
17
+ * import { something as somethingElse } from 'packageName';
18
+ * `
19
+ * GetNamedImportAlias(checkNoAlias, 'something', 'packageName'); // 'something'
20
+ * GetNamedImportAlias(checkAlias, 'something', 'packageName'); // 'somethingElse'
21
+ */
22
+ export function GetNamedImportAlias(content: string, moduleName: string, packageName: string): string | undefined;
@@ -29,7 +29,7 @@
29
29
  * const a = myInstance; // not yet initiated;
30
30
  * const b = a.myProp // imediately initiated;
31
31
  * // OR
32
- * myInstance["vivth:unwrapLazy;"]() // forcefully call the callback;
32
+ * myInstance["vivth:unwrapLazy;"]() // forcefully call factory generator;
33
33
  */
34
34
  export function LazyFactory<FACTORY>(factory: () => FACTORY): FACTORY & {
35
35
  [unwrapLazy]: () => FACTORY;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @description
3
- * - turn `.mts`||`.ts` file into `.mjs`, no bundling, just translation;
3
+ * - turn `.mts`||`.ts` file into `.mjs`, no bundling, just traspilation;
4
4
  * - on certain circumstance where `.mjs` result needed to be typed, you need to manually add `jsdoc`;
5
- * >- uses `"at"preserve` to register `jsdoc` inline;
5
+ * >- uses `"at"preserve` to register `jsdoc`;
6
6
  * @param {string} path_
7
7
  * - path from `Paths.root`;
8
8
  * @param {Object} [options]
@@ -15,7 +15,7 @@
15
15
  * @example
16
16
  * import { TsToMjs } from 'vivth';
17
17
  *
18
- * TsToMjs('./myFile.mts', { encoding: 'utf-8', overrideDir: './other/dir' });
18
+ * await TsToMjs('./myFile.mts', { encoding: 'utf-8', overrideDir: './other/dir' });
19
19
  */
20
20
  export function TsToMjs(path_: string, { overrideDir, encoding }?: {
21
21
  overrideDir?: string | undefined;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Description
3
+ * @param {(
4
+ * this:{defer:(tobeDefered:()=>Promise<void>)=>void}
5
+ * )=>Promise<void>} cb
6
+ * @returns {void}
7
+ */
8
+ export function WithDefer(cb: (this: {
9
+ defer: (tobeDefered: () => Promise<void>) => void;
10
+ }) => Promise<void>): void;
@@ -0,0 +1,3 @@
1
+ export type DevTestCB = (testName: string, testCallback: () => Promise<boolean>) => Promise<{
2
+ removeId: () => void;
3
+ }>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * - closing helper for `Dev.IsDevCB`;
3
+ */
4
+ export type IsDevCBStringType = "IsDevCB";
@@ -1 +1,4 @@
1
+ /**
2
+ * - for popular runtimes check;
3
+ */
1
4
  export type Runtime = "node" | "bun" | "deno" | "browser" | "unknown";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * - closing helper for `Dev.vivthDevCodeBlock`;
3
+ */
4
+ export type VivthDevCodeBlockStringType = "vivthDevCodeBlock";