functionalscript 0.1.594 → 0.1.597
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/.github/workflows/npm-publish.yml +2 -1
- package/com/cpp/module.f.d.mts +8 -0
- package/com/cpp/module.f.mjs +18 -18
- package/com/cpp/test.f.d.mts +2 -0
- package/com/cpp/testlib.f.d.mts +2 -0
- package/com/cs/module.f.d.mts +8 -0
- package/com/cs/module.f.mjs +1 -1
- package/com/cs/test.f.d.mts +2 -0
- package/com/cs/testlib.f.d.mts +2 -0
- package/com/rust/module.f.d.mts +28 -0
- package/com/rust/module.f.mjs +30 -30
- package/com/rust/test.f.d.mts +2 -0
- package/com/rust/testlib.f.d.mts +2 -0
- package/com/test/build.d.mts +1 -0
- package/com/test/build.f.d.mts +26 -0
- package/com/test/build.mjs +2 -2
- package/com/types/module.f.d.mts +28 -0
- package/com/types/module.f.mjs +1 -1
- package/com/types/testlib.f.d.mts +44 -0
- package/commonjs/build/module.f.d.mts +24 -0
- package/commonjs/build/test.f.d.mts +3 -0
- package/commonjs/module/function/module.f.d.mts +7 -0
- package/commonjs/module/module.f.d.mts +57 -0
- package/commonjs/module/module.f.mjs +1 -1
- package/commonjs/module.d.mts +7 -0
- package/commonjs/module.f.d.mts +4 -0
- package/commonjs/package/dependencies/module.f.d.mts +10 -0
- package/commonjs/package/dependencies/module.f.mjs +3 -3
- package/commonjs/package/dependencies/test.f.d.mts +2 -0
- package/commonjs/package/module.f.d.mts +27 -0
- package/commonjs/package/module.f.mjs +4 -4
- package/commonjs/package/test.f.d.mts +2 -0
- package/commonjs/path/module.f.d.mts +67 -0
- package/commonjs/path/module.f.mjs +5 -5
- package/commonjs/path/test.f.d.mts +25 -0
- package/commonjs/path/test.f.mjs +7 -7
- package/commonjs/test.d.mts +8 -0
- package/commonjs/test.mjs +2 -2
- package/dev/index.d.mts +1 -0
- package/dev/module.d.mts +26 -0
- package/dev/module.f.d.mts +4 -0
- package/dev/test/module.f.d.mts +26 -0
- package/dev/test.d.mts +3 -0
- package/dev/test.f.d.mts +9 -0
- package/djs/module.f.d.mts +25 -0
- package/djs/module.f.mjs +1 -1
- package/djs/parser/module.f.d.mts +40 -0
- package/djs/parser/test.f.d.mts +8 -0
- package/djs/test.f.d.mts +12 -0
- package/djs/tokenizer/module.f.d.mts +17 -0
- package/djs/tokenizer/module.f.mjs +1 -1
- package/djs/tokenizer/test.f.d.mts +6 -0
- package/djs/tokenizer/test.f.mjs +1 -1
- package/fsc/module.f.d.mts +12 -0
- package/fsc/test.f.d.mts +4 -0
- package/fsm/module.f.d.mts +21 -0
- package/fsm/test.f.d.mts +5 -0
- package/html/module.f.d.mts +20 -0
- package/html/module.f.mjs +1 -1
- package/html/test.f.d.mts +10 -0
- package/index.f.d.mts +83 -0
- package/js/tokenizer/module.f.d.mts +150 -0
- package/js/tokenizer/test.f.d.mts +8 -0
- package/js/tokenizer/test.f.mjs +3 -3
- package/json/module.f.d.mts +41 -0
- package/json/parser/module.f.d.mts +36 -0
- package/json/parser/module.f.mjs +12 -12
- package/json/parser/test.f.d.mts +5 -0
- package/json/parser/test.f.mjs +2 -2
- package/json/serializer/module.f.d.mts +45 -0
- package/json/serializer/module.f.mjs +2 -2
- package/json/serializer/test.f.d.mts +8 -0
- package/json/test.f.d.mts +8 -0
- package/json/tokenizer/module.f.d.mts +17 -0
- package/json/tokenizer/module.f.mjs +7 -7
- package/json/tokenizer/test.f.d.mts +6 -0
- package/json/tokenizer/test.f.mjs +3 -3
- package/jsr.json +1 -1
- package/nodejs/version/main.d.mts +1 -0
- package/nodejs/version/module.f.d.mts +18 -0
- package/nodejs/version/test.f.d.mts +2 -0
- package/package.json +2 -1
- package/prime_field/module.f.d.mts +44 -0
- package/prime_field/test.f.d.mts +12 -0
- package/secp/module.f.d.mts +49 -0
- package/secp/module.f.mjs +6 -6
- package/secp/test.f.d.mts +4 -0
- package/secp/test.f.mjs +5 -5
- package/sha2/module.f.d.mts +23 -0
- package/sha2/module.f.mjs +1 -1
- package/sha2/test.f.d.mts +10 -0
- package/sha2/test.f.mjs +0 -1
- package/text/ascii/module.f.d.mts +73 -0
- package/text/ascii/test.f.d.mts +4 -0
- package/text/module.f.d.mts +18 -0
- package/text/sgr/module.f.d.mts +14 -0
- package/text/test.f.d.mts +2 -0
- package/text/utf16/module.f.d.mts +19 -0
- package/text/utf16/test.f.d.mts +6 -0
- package/text/utf16/test.f.mjs +2 -2
- package/text/utf8/module.f.d.mts +15 -0
- package/text/utf8/module.f.mjs +2 -2
- package/text/utf8/test.f.d.mts +6 -0
- package/types/array/module.f.d.mts +41 -0
- package/types/array/test.f.d.mts +10 -0
- package/types/bigfloat/module.f.d.mts +11 -0
- package/types/bigfloat/test.f.d.mts +6 -0
- package/types/bigint/module.f.d.mts +77 -0
- package/types/bigint/module.f.mjs +5 -5
- package/types/bigint/test.f.d.mts +16 -0
- package/types/btree/find/module.f.d.mts +42 -0
- package/types/btree/find/module.f.mjs +4 -4
- package/types/btree/find/test.f.d.mts +2 -0
- package/types/btree/find/test.f.mjs +2 -2
- package/types/btree/module.f.d.mts +9 -0
- package/types/btree/remove/module.f.d.mts +19 -0
- package/types/btree/remove/module.f.mjs +12 -12
- package/types/btree/remove/test.f.d.mts +7 -0
- package/types/btree/remove/test.f.mjs +5 -5
- package/types/btree/set/module.f.d.mts +9 -0
- package/types/btree/set/module.f.mjs +6 -6
- package/types/btree/set/test.f.d.mts +2 -0
- package/types/btree/set/test.f.mjs +32 -32
- package/types/btree/test.f.d.mts +13 -0
- package/types/btree/test.f.mjs +7 -11
- package/types/btree/types/module.f.d.mts +16 -0
- package/types/byte_set/module.f.d.mts +38 -0
- package/types/byte_set/module.f.mjs +2 -2
- package/types/byte_set/test.f.d.mts +13 -0
- package/types/byte_set/test.f.mjs +3 -3
- package/types/function/compare/module.f.d.mts +29 -0
- package/types/function/compare/module.f.mjs +4 -4
- package/types/function/compare/test.f.d.mts +2 -0
- package/types/function/module.f.d.mts +36 -0
- package/types/function/operator/module.f.d.mts +75 -0
- package/types/function/test.f.d.mts +2 -0
- package/types/list/module.f.d.mts +117 -0
- package/types/list/test.f.d.mts +38 -0
- package/types/map/module.f.d.mts +30 -0
- package/types/map/module.f.mjs +4 -4
- package/types/map/test.f.d.mts +5 -0
- package/types/nibble_set/module.f.d.mts +26 -0
- package/types/nibble_set/test.f.d.mts +13 -0
- package/types/nullable/module.f.d.mts +14 -0
- package/types/nullable/test.f.d.mts +2 -0
- package/types/number/module.f.d.mts +13 -0
- package/types/number/test.f.d.mts +11 -0
- package/types/object/module.f.d.mts +29 -0
- package/types/object/test.f.d.mts +5 -0
- package/types/range/module.f.d.mts +11 -0
- package/types/range/test.f.d.mts +2 -0
- package/types/range_map/module.f.d.mts +25 -0
- package/types/range_map/module.f.mjs +5 -5
- package/types/range_map/test.f.d.mts +6 -0
- package/types/range_map/test.f.mjs +2 -2
- package/types/result/module.d.mts +7 -0
- package/types/result/module.f.d.mts +28 -0
- package/types/sorted_list/module.f.d.mts +59 -0
- package/types/sorted_list/test.f.d.mts +5 -0
- package/types/sorted_list/test.f.mjs +2 -2
- package/types/sorted_set/module.f.d.mts +25 -0
- package/types/sorted_set/test.f.d.mts +6 -0
- package/types/sorted_set/test.f.mjs +1 -1
- package/types/string/module.f.d.mts +15 -0
- package/types/string/test.f.d.mts +15 -0
- package/types/string_set/module.f.d.mts +21 -0
- package/types/string_set/test.f.d.mts +5 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { isDependenciesJson };
|
|
3
|
+
}
|
|
4
|
+
export default _default;
|
|
5
|
+
export type DependencyJson = readonly [string, string];
|
|
6
|
+
export type DependencyMapJson = { readonly [k in string]: string; };
|
|
7
|
+
export type DependenciesJson = DependencyMapJson | null;
|
|
8
|
+
/** @type {(j: Json.Unknown) => j is DependenciesJson} */
|
|
9
|
+
declare const isDependenciesJson: (j: Json.Unknown) => j is DependenciesJson;
|
|
10
|
+
import * as Json from '../../../json/module.f.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import json, * as
|
|
1
|
+
import json, * as Json from '../../../json/module.f.mjs'
|
|
2
2
|
const { isObject } = json
|
|
3
3
|
import list from '../../../types/list/module.f.mjs'
|
|
4
4
|
const { map, every } = list
|
|
@@ -10,10 +10,10 @@ const { entries } = Object
|
|
|
10
10
|
|
|
11
11
|
/** @typedef {DependencyMapJson|null} DependenciesJson */
|
|
12
12
|
|
|
13
|
-
/** @type {(entry:
|
|
13
|
+
/** @type {(entry: Json.Entry) => boolean} */
|
|
14
14
|
const isDependencyJson = ([, v]) => typeof v === 'string'
|
|
15
15
|
|
|
16
|
-
/** @type {(j:
|
|
16
|
+
/** @type {(j: Json.Unknown) => j is DependenciesJson} */
|
|
17
17
|
const isDependenciesJson = j => {
|
|
18
18
|
if (j === null) { return true }
|
|
19
19
|
if (!isObject(j)) { return false }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { dependencies };
|
|
3
|
+
export { isPackageJson };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export type PackageJson = {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly version: string;
|
|
9
|
+
readonly dependencies?: Dependencies.DependenciesJson;
|
|
10
|
+
};
|
|
11
|
+
export type Package = {
|
|
12
|
+
readonly dependency: (localPackageId: string) => string | null;
|
|
13
|
+
readonly file: (localFileId: string) => string | null;
|
|
14
|
+
};
|
|
15
|
+
export type Get = (packageId: string) => Package | null;
|
|
16
|
+
import dependencies from './dependencies/module.f.mjs';
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {{
|
|
19
|
+
* readonly name: string
|
|
20
|
+
* readonly version: string
|
|
21
|
+
* readonly dependencies?: Dependencies.DependenciesJson
|
|
22
|
+
* }} PackageJson
|
|
23
|
+
*/
|
|
24
|
+
/** @type {(j: Json.Unknown) => j is PackageJson} */
|
|
25
|
+
declare const isPackageJson: (j: Json.Unknown) => j is PackageJson;
|
|
26
|
+
import * as Dependencies from './dependencies/module.f.mjs';
|
|
27
|
+
import * as Json from '../../json/module.f.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import json, * as
|
|
1
|
+
import json, * as Json from '../../json/module.f.mjs'
|
|
2
2
|
const { isObject } = json
|
|
3
|
-
import dependencies, * as
|
|
3
|
+
import dependencies, * as Dependencies from './dependencies/module.f.mjs'
|
|
4
4
|
const { isDependenciesJson } = dependencies
|
|
5
5
|
import o from '../../types/object/module.f.mjs'
|
|
6
6
|
const { at } = o
|
|
@@ -9,11 +9,11 @@ const { at } = o
|
|
|
9
9
|
* @typedef {{
|
|
10
10
|
* readonly name: string
|
|
11
11
|
* readonly version: string
|
|
12
|
-
* readonly dependencies?:
|
|
12
|
+
* readonly dependencies?: Dependencies.DependenciesJson
|
|
13
13
|
* }} PackageJson
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
/** @type {(j:
|
|
16
|
+
/** @type {(j: Json.Unknown) => j is PackageJson} */
|
|
17
17
|
const isPackageJson = j => {
|
|
18
18
|
if (!isObject(j)) { return false }
|
|
19
19
|
if (typeof j.name !== 'string') { return false }
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { parseLocal };
|
|
3
|
+
export { parseGlobal };
|
|
4
|
+
export { parse };
|
|
5
|
+
export { parseAndFind };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
export type Items = readonly string[];
|
|
9
|
+
export type LocalPath = {
|
|
10
|
+
readonly external: boolean;
|
|
11
|
+
readonly dir: boolean;
|
|
12
|
+
readonly items: Items;
|
|
13
|
+
};
|
|
14
|
+
export type OptionList = readonly [List.List<string>] | null;
|
|
15
|
+
export type IdPath = readonly [string, List.List<string>];
|
|
16
|
+
export type Path = {
|
|
17
|
+
readonly package: string;
|
|
18
|
+
readonly items: Items;
|
|
19
|
+
readonly dir: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type FoundResult = {
|
|
22
|
+
readonly id: Module.Id;
|
|
23
|
+
readonly source: string;
|
|
24
|
+
};
|
|
25
|
+
export type Result = FoundResult | null;
|
|
26
|
+
/** @type {(local: string) => (path: string) => LocalPath|null} */
|
|
27
|
+
declare const parseLocal: (local: string) => (path: string) => LocalPath | null;
|
|
28
|
+
/**
|
|
29
|
+
* @typedef {{
|
|
30
|
+
* readonly package: string,
|
|
31
|
+
* readonly items: Items,
|
|
32
|
+
* readonly dir: boolean,
|
|
33
|
+
* }} Path
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* @type {(d: (local: string) => string|null) =>
|
|
37
|
+
* (dir: boolean) =>
|
|
38
|
+
* (items: List.List<string>) =>
|
|
39
|
+
* Path|null}
|
|
40
|
+
*/
|
|
41
|
+
declare const parseGlobal: (d: (local: string) => string | null) => (dir: boolean) => (items: List.List<string>) => Path | null;
|
|
42
|
+
/**
|
|
43
|
+
* @type {(packageId: string) =>
|
|
44
|
+
* (dependencies: (local: string) => string|null) =>
|
|
45
|
+
* (local: string) =>
|
|
46
|
+
* (path: string) =>
|
|
47
|
+
* Path|null }
|
|
48
|
+
*/
|
|
49
|
+
declare const parse: (packageId: string) => (dependencies: (local: string) => string | null) => (local: string) => (path: string) => Path | null;
|
|
50
|
+
/**
|
|
51
|
+
* @typedef {{
|
|
52
|
+
* readonly id: Module.Id
|
|
53
|
+
* readonly source: string
|
|
54
|
+
* }} FoundResult
|
|
55
|
+
*/
|
|
56
|
+
/** @typedef {FoundResult| null} Result */
|
|
57
|
+
/**
|
|
58
|
+
* @type {(packageGet: Package.Get) =>
|
|
59
|
+
* (moduleId: Module.Id) =>
|
|
60
|
+
* (path: string) =>
|
|
61
|
+
* Result
|
|
62
|
+
* }
|
|
63
|
+
*/
|
|
64
|
+
declare const parseAndFind: (packageGet: Package.Get) => (moduleId: Module.Id) => (path: string) => Result;
|
|
65
|
+
import * as List from '../../types/list/module.f.mjs';
|
|
66
|
+
import * as Module from '../module/module.f.mjs';
|
|
67
|
+
import * as Package from '../package/module.f.mjs';
|
|
@@ -2,8 +2,8 @@ import list, * as List from '../../types/list/module.f.mjs'
|
|
|
2
2
|
const { next, fold, reverse, first, flat, toArray, filterMap, isEmpty, concat } = list
|
|
3
3
|
import string from '../../types/string/module.f.mjs'
|
|
4
4
|
const { join } = string
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import * as Package from '../package/module.f.mjs'
|
|
6
|
+
import * as Module from '../module/module.f.mjs'
|
|
7
7
|
|
|
8
8
|
/** @typedef {readonly string[]} Items */
|
|
9
9
|
|
|
@@ -132,7 +132,7 @@ const parse = packageId => dependencies => {
|
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
134
|
* @typedef {{
|
|
135
|
-
* readonly id:
|
|
135
|
+
* readonly id: Module.Id
|
|
136
136
|
* readonly source: string
|
|
137
137
|
* }} FoundResult
|
|
138
138
|
*/
|
|
@@ -140,8 +140,8 @@ const parse = packageId => dependencies => {
|
|
|
140
140
|
/** @typedef {FoundResult| null} Result */
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* @type {(packageGet:
|
|
144
|
-
* (moduleId:
|
|
143
|
+
* @type {(packageGet: Package.Get) =>
|
|
144
|
+
* (moduleId: Module.Id) =>
|
|
145
145
|
* (path: string) =>
|
|
146
146
|
* Result
|
|
147
147
|
* }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
0: () => void;
|
|
3
|
+
1: () => void;
|
|
4
|
+
2: () => void;
|
|
5
|
+
3: () => void;
|
|
6
|
+
4: () => void;
|
|
7
|
+
5: () => void;
|
|
8
|
+
6: () => void;
|
|
9
|
+
7: () => void;
|
|
10
|
+
8: {
|
|
11
|
+
0: () => void;
|
|
12
|
+
1: () => void;
|
|
13
|
+
2: () => void;
|
|
14
|
+
3: () => void;
|
|
15
|
+
4: () => void;
|
|
16
|
+
5: () => void;
|
|
17
|
+
6: () => void;
|
|
18
|
+
7: () => void;
|
|
19
|
+
};
|
|
20
|
+
9: () => void;
|
|
21
|
+
10: () => void;
|
|
22
|
+
11: () => void;
|
|
23
|
+
12: () => void;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
package/commonjs/path/test.f.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _ from './module.f.mjs'
|
|
2
2
|
import dev from '../../dev/module.f.mjs'
|
|
3
3
|
const { todo } = dev
|
|
4
|
-
import json, * as
|
|
4
|
+
import json, * as Json from '../../json/module.f.mjs'
|
|
5
5
|
import f from '../../types/function/module.f.mjs'
|
|
6
6
|
const { identity } = f
|
|
7
7
|
import object, * as O from '../../types/object/module.f.mjs'
|
|
8
8
|
const { at } = object
|
|
9
|
-
import * as
|
|
9
|
+
import * as Package from '../package/module.f.mjs'
|
|
10
10
|
|
|
11
11
|
/** @type {<T>(o: O.Map<T>) => (s: string) => T|null} */
|
|
12
12
|
const i = o => s => at(s)(o)
|
|
13
13
|
|
|
14
|
-
/** @type {(g:
|
|
14
|
+
/** @type {(g: Json.Unknown) => string} */
|
|
15
15
|
const stringify = json.stringify(identity)
|
|
16
16
|
|
|
17
17
|
export default {
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
9: () => {
|
|
73
|
-
/** @type {O.Map<
|
|
73
|
+
/** @type {O.Map<Package.Package>} */
|
|
74
74
|
const packages = {
|
|
75
75
|
'': {
|
|
76
76
|
dependency: () => todo(),
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
if (result !== '{"id":{"package":"","path":["a","c"]},"source":"return \\"a/c\\""}') { throw result }
|
|
82
82
|
},
|
|
83
83
|
10: () => {
|
|
84
|
-
/** @type {O.Map<
|
|
84
|
+
/** @type {O.Map<Package.Package>} */
|
|
85
85
|
const packages = {
|
|
86
86
|
'': {
|
|
87
87
|
dependency: x => {
|
|
@@ -131,7 +131,7 @@ export default {
|
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
11: () => {
|
|
134
|
-
/** @type {O.Map<
|
|
134
|
+
/** @type {O.Map<Package.Package>} */
|
|
135
135
|
const packages = {
|
|
136
136
|
'': {
|
|
137
137
|
dependency: x => {
|
|
@@ -158,7 +158,7 @@ export default {
|
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
160
|
12: () => {
|
|
161
|
-
/** @type {O.Map<
|
|
161
|
+
/** @type {O.Map<Package.Package>} */
|
|
162
162
|
const packages = {
|
|
163
163
|
'': {
|
|
164
164
|
dependency: x => {
|
package/commonjs/test.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from './module.mjs'
|
|
2
|
-
import
|
|
2
|
+
import * as Run from './module/function/module.f.mjs'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
ok: () => {
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
const d = _.compile(depSource)
|
|
33
33
|
if (d[0] !== 'ok') { throw d }
|
|
34
34
|
|
|
35
|
-
/** @type {
|
|
35
|
+
/** @type {Run.Require<number>} */
|
|
36
36
|
const req = path => prior => {
|
|
37
37
|
if (path !== 'm') { throw path }
|
|
38
38
|
return d[1](req)(prior + 1)
|
package/dev/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dev/module.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @type {(code: number) => never} */
|
|
2
|
+
export const exit: (code: number) => never;
|
|
3
|
+
/** @type {(v: string) => string|undefined} */
|
|
4
|
+
export const env: (v: string) => string | undefined;
|
|
5
|
+
export function loadModuleMap(): Promise<ModuleMap>;
|
|
6
|
+
export function index(): Promise<void>;
|
|
7
|
+
export type Options = {
|
|
8
|
+
readonly withFileTypes: true;
|
|
9
|
+
};
|
|
10
|
+
export type Dirent = {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly isDirectory: () => boolean;
|
|
13
|
+
};
|
|
14
|
+
export type FsPromises = {
|
|
15
|
+
readonly readdir: (path: string, options: Options) => Promise<readonly Dirent[]>;
|
|
16
|
+
readonly readFile: (path: string, options: "utf8") => Promise<string>;
|
|
17
|
+
};
|
|
18
|
+
export type Module = {
|
|
19
|
+
readonly default?: unknown;
|
|
20
|
+
};
|
|
21
|
+
export type Require = (name: string) => unknown;
|
|
22
|
+
export type UnknownMap = { readonly [k in string]: unknown; };
|
|
23
|
+
export type Entry<T> = readonly [string, T];
|
|
24
|
+
export type MutableModuleMap = { [k in string]: Module; };
|
|
25
|
+
export type ModuleMap = { readonly [k in string]: Module; };
|
|
26
|
+
export type FolderMap = { readonly [k in string]: string | FolderMap; };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default main;
|
|
2
|
+
export type DependencyMap = { readonly [k in string]?: Module; };
|
|
3
|
+
export type Module = {
|
|
4
|
+
readonly default?: unknown;
|
|
5
|
+
};
|
|
6
|
+
export type ModuleMap = { readonly [k in string]: Module; };
|
|
7
|
+
export type Log<T> = (v: string) => (state: T) => T;
|
|
8
|
+
export type Measure<T> = <R>(f: () => R) => (state: T) => readonly [R, number, T];
|
|
9
|
+
export type Input<T> = {
|
|
10
|
+
readonly moduleMap: ModuleMap;
|
|
11
|
+
readonly log: Log<T>;
|
|
12
|
+
readonly error: Log<T>;
|
|
13
|
+
readonly measure: Measure<T>;
|
|
14
|
+
readonly state: T;
|
|
15
|
+
readonly tryCatch: <R>(f: () => R) => Result.Result<R, unknown>;
|
|
16
|
+
readonly env: (n: string) => string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type TestState = {
|
|
19
|
+
readonly time: number;
|
|
20
|
+
readonly pass: number;
|
|
21
|
+
readonly fail: number;
|
|
22
|
+
};
|
|
23
|
+
export type FullState<T> = readonly [TestState, T];
|
|
24
|
+
/** @type {<T>(input: Input<T>) => readonly[number, T]} */
|
|
25
|
+
declare const main: <T>(input: Input<T>) => readonly [number, T];
|
|
26
|
+
import * as Result from '../../types/result/module.f.mjs';
|
package/dev/test.d.mts
ADDED
package/dev/test.f.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { stringify };
|
|
3
|
+
export { serialize };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export type Object = { readonly [k in string]: Unknown; };
|
|
7
|
+
export type Array = readonly Unknown[];
|
|
8
|
+
export type Unknown = Object | boolean | string | number | null | Array | bigint;
|
|
9
|
+
export type Entry = O.Entry<Unknown>;
|
|
10
|
+
export type Entries = (List.List<Entry>);
|
|
11
|
+
export type MapEntries = (entries: Entries) => Entries;
|
|
12
|
+
/**
|
|
13
|
+
* The standard `JSON.stringify` rules determined by
|
|
14
|
+
* https://262.ecma-international.org/6.0/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys
|
|
15
|
+
*
|
|
16
|
+
* @type {(mapEntries: MapEntries) => (value: Unknown) => string}
|
|
17
|
+
*/
|
|
18
|
+
declare const stringify: (mapEntries: MapEntries) => (value: Unknown) => string;
|
|
19
|
+
/** @typedef {O.Entry<Unknown>} Entry*/
|
|
20
|
+
/** @typedef {(List.List<Entry>)} Entries */
|
|
21
|
+
/** @typedef {(entries: Entries) => Entries} MapEntries */
|
|
22
|
+
/** @type {(mapEntries: MapEntries) => (value: Unknown) => List.List<string>} */
|
|
23
|
+
declare const serialize: (mapEntries: MapEntries) => (value: Unknown) => List.List<string>;
|
|
24
|
+
import * as O from '../types/object/module.f.mjs';
|
|
25
|
+
import * as List from '../types/list/module.f.mjs';
|
package/djs/module.f.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import list, * as List from '../types/list/module.f.mjs'
|
|
|
2
2
|
const { flat, map } = list
|
|
3
3
|
import string from '../types/string/module.f.mjs'
|
|
4
4
|
const { concat } = string
|
|
5
|
-
import
|
|
5
|
+
import * as O from '../types/object/module.f.mjs'
|
|
6
6
|
import f from '../types/function/module.f.mjs'
|
|
7
7
|
const { compose, fn } = f
|
|
8
8
|
const { entries } = Object
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { parse };
|
|
3
|
+
}
|
|
4
|
+
export default _default;
|
|
5
|
+
export type JsonObject = {
|
|
6
|
+
readonly kind: "object";
|
|
7
|
+
readonly values: Map.Map<Djs.Unknown>;
|
|
8
|
+
readonly key: string;
|
|
9
|
+
};
|
|
10
|
+
export type JsonArray = {
|
|
11
|
+
readonly kind: "array";
|
|
12
|
+
readonly values: List.List<Djs.Unknown>;
|
|
13
|
+
};
|
|
14
|
+
export type JsonStackElement = JsonObject | JsonArray;
|
|
15
|
+
export type JsonStack = List.List<JsonStackElement>;
|
|
16
|
+
export type StateModule = {
|
|
17
|
+
readonly status: "module";
|
|
18
|
+
readonly stage: "module" | "." | "exports" | "=";
|
|
19
|
+
};
|
|
20
|
+
export type StateParse = {
|
|
21
|
+
readonly status: "" | "[" | "[v" | "[," | "{" | "{k" | "{:" | "{v" | "{,";
|
|
22
|
+
readonly top: JsonStackElement | null;
|
|
23
|
+
readonly stack: JsonStack;
|
|
24
|
+
};
|
|
25
|
+
export type StateResult = {
|
|
26
|
+
readonly status: "result";
|
|
27
|
+
readonly value: Djs.Unknown;
|
|
28
|
+
};
|
|
29
|
+
export type StateError = {
|
|
30
|
+
readonly status: "error";
|
|
31
|
+
readonly message: string;
|
|
32
|
+
};
|
|
33
|
+
export type DjsState = StateModule | StateParse | StateResult | StateError;
|
|
34
|
+
/** @type {(tokenList: List.List<tokenizerT.DjsToken>) => Result.Result<Djs.Unknown, string>} */
|
|
35
|
+
declare const parse: (tokenList: List.List<tokenizerT.DjsToken>) => Result.Result<Djs.Unknown, string>;
|
|
36
|
+
import * as Map from '../../types/map/module.f.mjs';
|
|
37
|
+
import * as Djs from '../module.f.mjs';
|
|
38
|
+
import * as List from '../../types/list/module.f.mjs';
|
|
39
|
+
import * as tokenizerT from '../tokenizer/module.f.mjs';
|
|
40
|
+
import * as Result from '../../types/result/module.f.mjs';
|
package/djs/test.f.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { tokenize };
|
|
3
|
+
}
|
|
4
|
+
export default _default;
|
|
5
|
+
export type DjsToken = {
|
|
6
|
+
readonly kind: "true" | "false" | "null";
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: "{" | "}" | ":" | "," | "[" | "]" | "." | "=";
|
|
9
|
+
} | jsTokenizerT.StringToken | jsTokenizerT.NumberToken | jsTokenizerT.ErrorToken | jsTokenizerT.IdToken | jsTokenizerT.BigIntToken | jsTokenizerT.WhitespaceToken;
|
|
10
|
+
export type ScanState = {
|
|
11
|
+
readonly kind: "def" | "-";
|
|
12
|
+
};
|
|
13
|
+
export type ScanInput = jsTokenizerT.JsToken | null;
|
|
14
|
+
/** @type {(input: List.List<number>) => List.List<DjsToken>} */
|
|
15
|
+
declare const tokenize: (input: List.List<number>) => List.List<DjsToken>;
|
|
16
|
+
import * as jsTokenizerT from '../../js/tokenizer/module.f.mjs';
|
|
17
|
+
import * as List from '../../types/list/module.f.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Operator from '../../types/function/operator/module.f.mjs'
|
|
2
2
|
import list, * as List from '../../types/list/module.f.mjs'
|
|
3
3
|
const { empty, flat, stateScan } = list
|
|
4
4
|
import bf from '../../types/bigfloat/module.f.mjs'
|
package/djs/tokenizer/test.f.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import tokenizer, * as tokenizerT from './module.f.mjs'
|
|
2
2
|
import list from '../../types/list/module.f.mjs'
|
|
3
|
-
const { toArray
|
|
3
|
+
const { toArray } = list
|
|
4
4
|
import djs from '../module.f.mjs'
|
|
5
5
|
import o from '../../types/object/module.f.mjs'
|
|
6
6
|
const { sort } = o
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { terminal };
|
|
3
|
+
export { init };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export type Result = readonly [readonly string[], ToResult];
|
|
7
|
+
export type ToResult = (codePoint: number) => Result;
|
|
8
|
+
export type CreateToResult<T> = (state: T) => ToResult;
|
|
9
|
+
export type State<T> = RM.RangeMapArray<CreateToResult<T>>;
|
|
10
|
+
declare const terminal: -1;
|
|
11
|
+
declare const init: ToResult;
|
|
12
|
+
import * as RM from '../types/range_map/module.f.mjs';
|
package/fsc/test.f.d.mts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { dfa };
|
|
3
|
+
export { run };
|
|
4
|
+
export { toRange };
|
|
5
|
+
export { toUnion };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
export type Rule = readonly [string, byteSetT.ByteSet, string];
|
|
9
|
+
export type Grammar = List.List<Rule>;
|
|
10
|
+
export type Dfa = { readonly [state in string]: RM.RangeMapArray<string>; };
|
|
11
|
+
/** @type {(grammar: Grammar) => Dfa} */
|
|
12
|
+
declare const dfa: (grammar: Grammar) => Dfa;
|
|
13
|
+
/** @type {(dfa: Dfa) => (input: List.List<number>) => List.List<string>} */
|
|
14
|
+
declare const run: (dfa: Dfa) => (input: List.List<number>) => List.List<string>;
|
|
15
|
+
/** @type {(s: string) => byteSetT.ByteSet} */
|
|
16
|
+
declare const toRange: (s: string) => byteSetT.ByteSet;
|
|
17
|
+
/** @type {(s: string) => byteSetT.ByteSet} */
|
|
18
|
+
declare const toUnion: (s: string) => byteSetT.ByteSet;
|
|
19
|
+
import * as byteSetT from '../types/byte_set/module.f.mjs';
|
|
20
|
+
import * as List from '../types/list/module.f.mjs';
|
|
21
|
+
import * as RM from '../types/range_map/module.f.mjs';
|
package/fsm/test.f.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { element };
|
|
3
|
+
export { html };
|
|
4
|
+
export { htmlToString };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
export type Tag = string;
|
|
8
|
+
export type Element1 = readonly [Tag];
|
|
9
|
+
export type Element2A = readonly [Tag, Attributes];
|
|
10
|
+
export type Element2N = readonly [Tag, readonly Node[]];
|
|
11
|
+
export type Element3 = readonly [Tag, Attributes, Nodes];
|
|
12
|
+
export type Element = Element1 | Element2A | Element2N | Element3;
|
|
13
|
+
export type Attributes = { readonly [k in string]: string; };
|
|
14
|
+
export type Nodes = List.List<Node>;
|
|
15
|
+
export type Node = Element | string;
|
|
16
|
+
/** @type {(element: Element) => List.List<string>} */
|
|
17
|
+
declare const element: (element: Element) => List.List<string>;
|
|
18
|
+
declare const html: import("../types/function/module.f.mjs").Func<Element, List.List<string>>;
|
|
19
|
+
declare const htmlToString: import("../types/function/module.f.mjs").Func<Element, string>;
|
|
20
|
+
import * as List from '../types/list/module.f.mjs';
|
package/html/module.f.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import list, * as List from '../types/list/module.f.mjs'
|
|
|
2
2
|
const { map, flatMap, flat, concat: listConcat } = list
|
|
3
3
|
import s from '../types/string/module.f.mjs'
|
|
4
4
|
const { concat: stringConcat } = s
|
|
5
|
-
import
|
|
5
|
+
import * as O from '../types/object/module.f.mjs'
|
|
6
6
|
import f from '../types/function/module.f.mjs'
|
|
7
7
|
const { compose } = f
|
|
8
8
|
import utf16 from '../text/utf16/module.f.mjs'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export function empty(): void;
|
|
3
|
+
export function empty2(): void;
|
|
4
|
+
export function _void(): void;
|
|
5
|
+
export { _void as void };
|
|
6
|
+
export function some(): void;
|
|
7
|
+
export function some2(): void;
|
|
8
|
+
export function someVoid(): void;
|
|
9
|
+
}
|
|
10
|
+
export default _default;
|