@openclaw/slack 2026.8.1-beta.2 → 2026.8.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/account-configured-sUohAxZr.js +33 -0
- package/dist/account-inspect-CN2hBsim.js +87 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CK4AVI2_.js → accounts-Dm_H77gH.js} +12 -11
- package/dist/{accounts.runtime-Cb7QwWBz.js → accounts.runtime-DRuEK6mL.js} +1 -1
- package/dist/{action-runtime-BkGe7ny_.js → action-runtime-044ldvNL.js} +80 -79
- package/dist/action-runtime.runtime-BL3KzX13.js +2 -0
- package/dist/{actions-BTDXwwE3.js → actions-BI7JkfVm.js} +273 -263
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-CJaNzAq2.js → approval-handler.runtime-DYv0UIZS.js} +53 -174
- package/dist/{channel-D_tovcUL.js → channel-1vIJOzPx.js} +134 -160
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-B9MSdoGN.js → channel-type-DlFSKeIZ.js} +3 -7
- package/dist/{channel.setup-Bch9dYmA.js → channel.setup-ofDi3_Pu.js} +34 -49
- package/dist/{config-schema-xto5jFIx.js → config-schema-BVIMyiDN.js} +42 -19
- package/dist/configured-state.js +34 -0
- package/dist/conversation-binding-route-DFVLUdYF.js +115 -0
- package/dist/{directory-config-CNBz8lJa.js → directory-config-DqfQ42OV.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CFKUtW9E.js → directory-live-BPaNHjmP.js} +2 -2
- package/dist/{group-policy-c4RP9bjc.js → group-policy-BdwszjYn.js} +625 -773
- package/dist/{message-tool-api-BykQB4AU.js → message-tool-api-CJ0kjcg5.js} +23 -5
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-1nF1NtqT.js → monitor-Dq5Cmrvp.js} +3 -3
- package/dist/{outbound-adapter-S81tsswN.js → outbound-adapter-DYaI8ThX.js} +101 -66
- package/dist/{pipeline.runtime-BvYsM5JO.js → pipeline.runtime-Bd22U0ga.js} +494 -474
- package/dist/{policy-TapwbeaT.js → policy-CtQVbde1.js} +2 -1
- package/dist/{probe-HoEg_WxB.js → probe-0usmAb0i.js} +209 -22
- package/dist/{provider-CDNvBXUi.js → provider-CN_8hFv2.js} +296 -178
- package/dist/{relay-source-C9leF11u.js → relay-source-BNGpsdwV.js} +1 -1
- package/dist/{replies-CeOfv82I.js → replies-BSiRQOJ1.js} +48 -27
- package/dist/{resolve-channels-CNPrxaXY.js → resolve-channels-Czheznc8.js} +1 -1
- package/dist/{resolve-users-Dzomuwnr.js → resolve-users-BAOlNimr.js} +1 -1
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-cYXKkrRD.js → scopes-COSlmhnH.js} +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-Nor0iBwY.js → send-DS9ICrBI.js} +88 -100
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-BmgNe6S9.js → send.runtime-D_Bb6IuH.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-CbX1-Knh.js → setup-surface-BGnd2pSe.js} +6 -6
- package/dist/{shared-zdT5AMp-.js → shared-D5B-5hBg.js} +35 -9
- package/dist/{slash-dispatch.runtime-Bnr9GR1S.js → slash-dispatch.runtime-CilDmI0c.js} +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/bolt/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/bolt/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/bolt/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/bolt/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/bolt/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/bolt/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +2 -0
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +1 -1
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +2 -0
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/socket-mode/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/socket-mode/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/socket-mode/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/socket-mode/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/socket-mode/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/socket-mode/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/web-api/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/web-api/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +57 -7
- package/package.json +9 -9
- package/dist/account-configured-BwfXBo_F.js +0 -14
- package/dist/account-inspect-Drw2gAiN.js +0 -89
- package/dist/account-reply-mode-DrUXogvO.js +0 -14
- package/dist/action-runtime.runtime-D9I6uc0Q.js +0 -2
- package/dist/actions.runtime-DLFyUkvg.js +0 -2
- package/dist/block-text-YtiNkqmx.js +0 -79
- package/dist/runtime-api-Cj9nxBNv.js +0 -10
- package/node_modules/p-map/index.d.ts +0 -155
- package/node_modules/p-map/index.js +0 -285
- package/node_modules/p-map/license +0 -9
- package/node_modules/p-map/package.json +0 -57
- package/node_modules/p-map/readme.md +0 -190
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
- package/dist/{security-audit-DR097212.js → security-audit-B_yKr7MW.js} +1 -1
|
@@ -2,29 +2,31 @@
|
|
|
2
2
|
import { Guard } from '../../../guard/index.mjs';
|
|
3
3
|
import { IsDependent } from '../../types/dependent.mjs';
|
|
4
4
|
import { IsEnum } from '../../types/enum.mjs';
|
|
5
|
+
import { IsIntersect } from '../../types/intersect.mjs';
|
|
5
6
|
import { Literal } from '../../types/literal.mjs';
|
|
6
|
-
import { IsIntersect, Intersect } from '../../types/intersect.mjs';
|
|
7
7
|
import { Never } from '../../types/never.mjs';
|
|
8
8
|
import { IsTemplateLiteral } from '../../types/template_literal.mjs';
|
|
9
9
|
import { Union, IsUnion } from '../../types/union.mjs';
|
|
10
|
+
// ------------------------------------------------------------------
|
|
11
|
+
// Infrastructure
|
|
12
|
+
// ------------------------------------------------------------------
|
|
10
13
|
import { Distribute } from './distribute.mjs';
|
|
11
14
|
import { Broaden } from './broaden.mjs';
|
|
12
15
|
import { ExcludeOperation } from '../exclude/operation.mjs';
|
|
13
16
|
import { TemplateLiteralDecode } from '../template_literal/decode.mjs';
|
|
14
17
|
export function EvaluateDependent(if_, then_, else_) {
|
|
15
|
-
const
|
|
18
|
+
const intersected = EvaluateIntersect([if_, then_]);
|
|
16
19
|
const excluded = ExcludeOperation(else_, if_);
|
|
17
|
-
const result = EvaluateUnion([
|
|
20
|
+
const result = EvaluateUnion([intersected, excluded]);
|
|
18
21
|
return result;
|
|
19
22
|
}
|
|
20
|
-
export function EvaluateEnum(values) {
|
|
21
|
-
|
|
22
|
-
return EvaluateUnion(result);
|
|
23
|
+
export function EvaluateEnum(values, result = []) {
|
|
24
|
+
return Guard.ShiftLeft(values, (left, right) => EvaluateEnum(right, [...result, Literal(left)]), () => EvaluateUnion(result));
|
|
23
25
|
}
|
|
24
26
|
export function EvaluateIntersect(types) {
|
|
25
27
|
const distribution = Distribute(types);
|
|
26
28
|
const broadend = Broaden(distribution);
|
|
27
|
-
const result =
|
|
29
|
+
const result = EvaluateUnion(broadend);
|
|
28
30
|
return result;
|
|
29
31
|
}
|
|
30
32
|
export function EvaluateTemplateLiteral(pattern) {
|
|
@@ -38,12 +40,13 @@ export function EvaluateUnion(types) {
|
|
|
38
40
|
return result;
|
|
39
41
|
}
|
|
40
42
|
export function EvaluateType(type) {
|
|
41
|
-
|
|
43
|
+
const result = (IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) :
|
|
42
44
|
IsEnum(type) ? EvaluateEnum(type.enum) :
|
|
43
45
|
IsIntersect(type) ? EvaluateIntersect(type.allOf) :
|
|
44
46
|
IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) :
|
|
45
47
|
IsUnion(type) ? EvaluateUnion(type.anyOf) :
|
|
46
48
|
type);
|
|
49
|
+
return result;
|
|
47
50
|
}
|
|
48
51
|
export function EvaluateUnionFast(types) {
|
|
49
52
|
const result = (Guard.IsEqual(types.length, 1) ? types[0] :
|
|
@@ -2,5 +2,5 @@ import { type TSchema } from '../../types/schema.mjs';
|
|
|
2
2
|
import { type TUnion } from '../../types/union.mjs';
|
|
3
3
|
type TFlattenType<Type extends TSchema, Result extends TSchema[] = Type extends TUnion<infer Types extends TSchema[]> ? TFlatten<Types> : [Type]> = Result;
|
|
4
4
|
export type TFlatten<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFlatten<Right, [...Result, ...TFlattenType<Left>]> : Result);
|
|
5
|
-
export declare function Flatten<Types extends TSchema[]>(types: [...Types]): TFlatten<Types>;
|
|
5
|
+
export declare function Flatten<Types extends TSchema[]>(types: [...Types], result?: TSchema[]): TFlatten<Types>;
|
|
6
6
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
+
import { Guard } from '../../../guard/index.mjs';
|
|
2
3
|
import { IsUnion } from '../../types/union.mjs';
|
|
3
4
|
function FlattenType(type) {
|
|
4
5
|
const result = IsUnion(type) ? Flatten(type.anyOf) : [type];
|
|
5
6
|
return result;
|
|
6
7
|
}
|
|
7
|
-
export function Flatten(types) {
|
|
8
|
-
return
|
|
9
|
-
return [...result, ...FlattenType(type)];
|
|
10
|
-
}, []);
|
|
8
|
+
export function Flatten(types, result = []) {
|
|
9
|
+
return Guard.ShiftLeft(types, (left, right) => Flatten(right, [...result, ...FlattenType(left)]), () => result);
|
|
11
10
|
}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
|
+
import { type TAny } from '../../types/any.mjs';
|
|
2
3
|
import { type TNever } from '../../types/never.mjs';
|
|
3
|
-
import { type
|
|
4
|
-
|
|
4
|
+
import { type TUnknown } from '../../types/unknown.mjs';
|
|
5
|
+
import { type TCompare, type TCompareResult, CompareResultLeftInside, CompareResultRightInside, CompareResultEqual } from './compare.mjs';
|
|
6
|
+
import { type TComposite, type TCanComposite } from './composite.mjs';
|
|
7
|
+
type TNarrowCompareRule<Left extends TSchema, Right extends TSchema, Result extends TCompareResult = TCompare<Left, Right>> = (Result extends typeof CompareResultLeftInside ? Left : Result extends typeof CompareResultRightInside ? Right : Result extends typeof CompareResultEqual ? Right : TNever);
|
|
8
|
+
type TNarrowCompositeRule<Left extends TSchema, Right extends TSchema, CanCompositeLeft extends boolean = TCanComposite<Left>, CanCompositeRight extends boolean = TCanComposite<Right>> = ([
|
|
9
|
+
CanCompositeLeft,
|
|
10
|
+
CanCompositeRight
|
|
11
|
+
] extends [true, true] ? TComposite<Left, Right> : [
|
|
12
|
+
CanCompositeLeft,
|
|
13
|
+
CanCompositeRight
|
|
14
|
+
] extends [true, false] ? Left : [
|
|
15
|
+
CanCompositeLeft,
|
|
16
|
+
CanCompositeRight
|
|
17
|
+
] extends [false, true] ? Right : TNarrowCompareRule<Left, Right>);
|
|
18
|
+
export type TNarrow<Left extends TSchema, Right extends TSchema> = (Left extends TNever ? TNever : Left extends TAny ? TAny : Left extends TUnknown ? Right : Right extends TNever ? TNever : Right extends TAny ? TAny : Right extends TUnknown ? Left : TNarrowCompositeRule<Left, Right>);
|
|
5
19
|
export declare function Narrow<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TNarrow<Left, Right>;
|
|
20
|
+
export {};
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../../guard/index.mjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { IsAny } from '../../types/any.mjs';
|
|
4
|
+
import { Never, IsNever } from '../../types/never.mjs';
|
|
5
|
+
import { IsUnknown } from '../../types/unknown.mjs';
|
|
6
|
+
import { Compare, CompareResultLeftInside, CompareResultRightInside, CompareResultEqual } from './compare.mjs';
|
|
7
|
+
import { Composite, CanComposite } from './composite.mjs';
|
|
8
|
+
function NarrowCompareRule(left, right) {
|
|
6
9
|
const result = Compare(left, right);
|
|
7
|
-
return (Guard.IsEqual(result,
|
|
8
|
-
Guard.IsEqual(result,
|
|
9
|
-
Guard.IsEqual(result,
|
|
10
|
+
return (Guard.IsEqual(result, CompareResultLeftInside) ? left :
|
|
11
|
+
Guard.IsEqual(result, CompareResultRightInside) ? right :
|
|
12
|
+
Guard.IsEqual(result, CompareResultEqual) ? right :
|
|
10
13
|
Never());
|
|
11
14
|
}
|
|
15
|
+
function NarrowCompositeRule(left, right) {
|
|
16
|
+
const canCompositeLeft = CanComposite(left);
|
|
17
|
+
const canCompositeRight = CanComposite(right);
|
|
18
|
+
return (canCompositeLeft && canCompositeRight ? Composite(left, right) :
|
|
19
|
+
canCompositeLeft && !canCompositeRight ? left :
|
|
20
|
+
!canCompositeLeft && canCompositeRight ? right :
|
|
21
|
+
NarrowCompareRule(left, right));
|
|
22
|
+
}
|
|
23
|
+
export function Narrow(left, right) {
|
|
24
|
+
return (IsNever(left) ? left :
|
|
25
|
+
IsAny(left) ? left :
|
|
26
|
+
IsUnknown(left) ? right :
|
|
27
|
+
IsNever(right) ? right :
|
|
28
|
+
IsAny(right) ? right :
|
|
29
|
+
IsUnknown(right) ? left :
|
|
30
|
+
NarrowCompositeRule(left, right));
|
|
31
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// deno-lint-ignore-file ban-types
|
|
2
2
|
// deno-fmt-ignore-file
|
|
3
|
+
import { Guard } from '../../../guard/index.mjs';
|
|
3
4
|
import { IsUnion } from '../../types/union.mjs';
|
|
4
5
|
import { Extends, ExtendsResult } from '../../extends/index.mjs';
|
|
5
6
|
import { EvaluateType } from '../evaluate/evaluate.mjs';
|
|
@@ -9,10 +10,8 @@ function ExcludeType(left, right) {
|
|
|
9
10
|
const result = ExtendsResult.IsExtendsTrueLike(check) ? [] : [left];
|
|
10
11
|
return result;
|
|
11
12
|
}
|
|
12
|
-
function ExcludeUnion(
|
|
13
|
-
return
|
|
14
|
-
return [...result, ...ExcludeType(head, right)];
|
|
15
|
-
}, []);
|
|
13
|
+
function ExcludeUnion(left, right, result = []) {
|
|
14
|
+
return Guard.ShiftLeft(left, (head, tail) => ExcludeUnion(tail, right, [...result, ...ExcludeType(head, right)]), () => result);
|
|
16
15
|
}
|
|
17
16
|
export function ExcludeOperation(left, right) {
|
|
18
17
|
const evaluated = EvaluateType(left);
|
|
@@ -4,7 +4,7 @@ import { type TExtends, ExtendsResult } from '../../extends/index.mjs';
|
|
|
4
4
|
import { type TEvaluateType } from '../evaluate/evaluate.mjs';
|
|
5
5
|
import { type TEvaluateUnion } from '../evaluate/evaluate.mjs';
|
|
6
6
|
type TExtractType<Left extends TSchema, Right extends TSchema, Check extends ExtendsResult.TResult = TExtends<{}, Left, Right>, Result extends TSchema[] = Check extends ExtendsResult.TExtendsTrueLike ? [Left] : []> = Result;
|
|
7
|
-
type TExtractUnion<
|
|
7
|
+
type TExtractUnion<Left extends TSchema[], Right extends TSchema, Result extends TSchema[] = []> = (Left extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtractUnion<Tail, Right, [...Result, ...TExtractType<Head, Right>]> : Result);
|
|
8
8
|
export type TExtractOperation<Left extends TSchema, Right extends TSchema, Evaluated extends TSchema = TEvaluateType<Left>, Canonical extends TSchema[] = Evaluated extends TUnion<infer Types extends TSchema[]> ? Types : [Evaluated], Remaining extends TSchema[] = TExtractUnion<Canonical, Right>, Result extends TSchema = TEvaluateUnion<Remaining>> = Result;
|
|
9
9
|
export declare function ExtractOperation<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TExtractOperation<Left, Right>;
|
|
10
10
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// deno-lint-ignore-file ban-types
|
|
2
2
|
// deno-fmt-ignore-file
|
|
3
|
+
import { Guard } from '../../../guard/index.mjs';
|
|
3
4
|
import { IsUnion } from '../../types/union.mjs';
|
|
4
5
|
import { Extends, ExtendsResult } from '../../extends/index.mjs';
|
|
5
6
|
import { EvaluateType } from '../evaluate/evaluate.mjs';
|
|
@@ -9,10 +10,8 @@ function ExtractType(left, right) {
|
|
|
9
10
|
const result = ExtendsResult.IsExtendsTrueLike(check) ? [left] : [];
|
|
10
11
|
return result;
|
|
11
12
|
}
|
|
12
|
-
function ExtractUnion(
|
|
13
|
-
return
|
|
14
|
-
return [...result, ...ExtractType(head, right)];
|
|
15
|
-
}, []);
|
|
13
|
+
function ExtractUnion(left, right, result = []) {
|
|
14
|
+
return Guard.ShiftLeft(left, (head, tail) => ExtractUnion(tail, right, [...result, ...ExtractType(head, right)]), () => result);
|
|
16
15
|
}
|
|
17
16
|
export function ExtractOperation(left, right) {
|
|
18
17
|
const evaluated = EvaluateType(left);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
|
-
import { type TCompare, type TCompareResult } from '../evaluate/compare.mjs';
|
|
3
|
-
type TComparer<Left extends TSchema, Right extends TSchema, CompareResult extends TCompareResult = TCompare<Left, Right>, Result extends 0 | 1 = (CompareResult extends
|
|
2
|
+
import { type TCompare, type TCompareResult, CompareResultRightInside, CompareResultDisjoint } from '../evaluate/compare.mjs';
|
|
3
|
+
type TComparer<Left extends TSchema, Right extends TSchema, CompareResult extends TCompareResult = TCompare<Left, Right>, Result extends 0 | 1 = (CompareResult extends typeof CompareResultRightInside ? 1 : CompareResult extends typeof CompareResultDisjoint ? 1 : 0)> = Result;
|
|
4
4
|
type TInsert<Type extends TSchema, Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TComparer<Type, Left> extends 1 ? TInsert<Type, Right, [...Result, Left]> : [...Result, Type, ...Types] : [...Result, Type]);
|
|
5
5
|
type TSort<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TSort<Right, TInsert<Left, Result>> : Result);
|
|
6
6
|
/**
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../../guard/index.mjs';
|
|
3
|
-
import { Compare } from '../evaluate/compare.mjs';
|
|
3
|
+
import { Compare, CompareResultRightInside, CompareResultDisjoint } from '../evaluate/compare.mjs';
|
|
4
4
|
function Comparer(left, right) {
|
|
5
5
|
const compareResult = Compare(left, right);
|
|
6
|
-
|
|
7
|
-
Guard.IsEqual(compareResult,
|
|
6
|
+
return (Guard.IsEqual(compareResult, CompareResultRightInside) ? 1 :
|
|
7
|
+
Guard.IsEqual(compareResult, CompareResultDisjoint) ? 1 :
|
|
8
8
|
0);
|
|
9
|
-
return result;
|
|
10
9
|
}
|
|
11
10
|
function Insert(type, types, result = []) {
|
|
12
11
|
return Guard.ShiftLeft(types, (left, right) => Guard.IsEqual(Comparer(type, left), 1)
|
|
@@ -65,8 +65,8 @@ type TIntrinsicOrCall<Target extends string, Parameters extends T.TSchema[]> = (
|
|
|
65
65
|
Target,
|
|
66
66
|
Parameters
|
|
67
67
|
] extends ['Uppercase', [infer Type extends T.TSchema]] ? S.TUppercaseDeferred<Type> : T.TCallConstruct<T.TRef<Target>, Parameters>);
|
|
68
|
-
type TDelimitedDecode<Input extends
|
|
69
|
-
type TDelimited<Input extends [unknown, unknown]> = Input extends [infer Left extends unknown[], infer
|
|
68
|
+
type TDelimitedDecode<Input extends [unknown, unknown][], Result extends unknown[] = []> = (Input extends [infer Left extends [unknown, unknown], ...infer Right extends [unknown, unknown][]] ? TDelimitedDecode<Right, [...Result, Left[1]]> : Result);
|
|
69
|
+
type TDelimited<Input extends [unknown, unknown, unknown] | []> = (Input extends [infer Left extends unknown, infer Right extends [unknown, unknown][], infer _ extends unknown[]] ? [Left, ...TDelimitedDecode<Right>] : []);
|
|
70
70
|
export type TGenericParameterExtendsEqualsMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer Name extends string, 'extends', infer Extends extends T.TSchema, '=', infer Equals extends T.TSchema] ? T.TParameter<Name, Extends, Equals> : never);
|
|
71
71
|
export declare function GenericParameterExtendsEqualsMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
72
72
|
export type TGenericParameterExtendsMapping<Input extends [unknown, unknown, unknown]> = (Input extends [infer Name extends string, 'extends', infer Extends extends T.TSchema] ? T.TParameter<Name, Extends, Extends> : never);
|
|
@@ -77,12 +77,12 @@ export type TGenericParameterIdentifierMapping<Input extends string, Result exte
|
|
|
77
77
|
export declare function GenericParameterIdentifierMapping(input: string): unknown;
|
|
78
78
|
export type TGenericParameterMapping<Input extends unknown> = (Input);
|
|
79
79
|
export declare function GenericParameterMapping(input: unknown): unknown;
|
|
80
|
-
export type TGenericParameterListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
81
|
-
export declare function GenericParameterListMapping(input: [unknown, unknown]): unknown;
|
|
80
|
+
export type TGenericParameterListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
81
|
+
export declare function GenericParameterListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
82
82
|
export type TGenericParametersMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['<', infer Parameters extends T.TParameter[], '>'] ? Parameters : never);
|
|
83
83
|
export declare function GenericParametersMapping(input: [unknown, unknown, unknown]): unknown;
|
|
84
|
-
export type TGenericCallArgumentListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
85
|
-
export declare function GenericCallArgumentListMapping(input: [unknown, unknown]): unknown;
|
|
84
|
+
export type TGenericCallArgumentListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
85
|
+
export declare function GenericCallArgumentListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
86
86
|
export type TGenericCallArgumentsMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['<', infer Arguments extends T.TSchema[], '>'] ? Arguments : never);
|
|
87
87
|
export declare function GenericCallArgumentsMapping(input: [unknown, unknown, unknown]): unknown;
|
|
88
88
|
export type TGenericCallMapping<Input extends [unknown, unknown], Result = Input extends [infer Ref extends string, infer Arguments extends T.TSchema[]] ? TIntrinsicOrCall<Ref, Arguments> : never> = Result;
|
|
@@ -202,8 +202,8 @@ export type TPropertyMapping<Input extends [unknown, unknown, unknown, unknown,
|
|
|
202
202
|
export declare function PropertyMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
203
203
|
export type TPropertyDelimiterMapping<Input extends [unknown, unknown] | [unknown]> = (Input);
|
|
204
204
|
export declare function PropertyDelimiterMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
205
|
-
export type TPropertyListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
206
|
-
export declare function PropertyListMapping(input: [unknown, unknown]): unknown;
|
|
205
|
+
export type TPropertyListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
206
|
+
export declare function PropertyListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
207
207
|
type TPropertiesReduce<PropertiesList extends T.TProperties[], Result extends [properties: T.TProperties, patternProperties: T.TProperties] = [{}, {}]> = (PropertiesList extends [infer Left extends T.TProperties, ...infer Right extends T.TProperties[]] ? (Left extends {
|
|
208
208
|
[_ in T.TIntegerKey]: T.TSchema;
|
|
209
209
|
} ? TPropertiesReduce<Right, [Result[0], Memory.TAssign<Result[1], Left>]> : Left extends {
|
|
@@ -219,18 +219,21 @@ export type T_Object_Mapping<Input extends unknown> = (Input extends [infer Prop
|
|
|
219
219
|
export declare function _Object_Mapping(input: unknown): unknown;
|
|
220
220
|
export type TElementNamedMapping<Input extends [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : Input extends [string, /**/ ':', 'readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<Type> : Input extends [string, '?', ':', /* */ infer Type extends T.TSchema] ? S.TAddOptionalDeferred<Type> : Input extends [string, /**/ ':', /* */ infer Type extends T.TSchema] ? Type : never);
|
|
221
221
|
export declare function ElementNamedMapping(input: [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]): unknown;
|
|
222
|
-
export type
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
222
|
+
export type TElementBaseMapping<Input extends unknown | [unknown, unknown, unknown]> = (Input extends [infer IsReadonly extends boolean, infer Type extends T.TSchema, infer IsOptional extends boolean] ? ([
|
|
223
|
+
IsReadonly,
|
|
224
|
+
IsOptional
|
|
225
|
+
] extends [true, true] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : [
|
|
226
|
+
IsReadonly,
|
|
227
|
+
IsOptional
|
|
228
|
+
] extends [true, false] ? S.TAddReadonlyDeferred<Type> : [
|
|
229
|
+
IsReadonly,
|
|
230
|
+
IsOptional
|
|
231
|
+
] extends [false, true] ? S.TAddOptionalDeferred<Type> : Type) : Input);
|
|
232
|
+
export declare function ElementBaseMapping(input: unknown | [unknown, unknown, unknown]): unknown;
|
|
230
233
|
export type TElementMapping<Input extends [unknown, unknown] | [unknown]> = (Input extends ['...', infer Type extends T.TSchema] ? T.TRest<Type> : Input extends [infer Type extends T.TSchema] ? Type : never);
|
|
231
234
|
export declare function ElementMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
232
|
-
export type TElementListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
233
|
-
export declare function ElementListMapping(input: [unknown, unknown]): unknown;
|
|
235
|
+
export type TElementListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
236
|
+
export declare function ElementListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
234
237
|
export type T_Tuple_Mapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Types extends T.TSchema[], ']'] ? T.TTuple<Types> : never);
|
|
235
238
|
export declare function _Tuple_Mapping(input: [unknown, unknown, unknown]): unknown;
|
|
236
239
|
export type TParameterReadonlyOptionalMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : never);
|
|
@@ -245,8 +248,8 @@ export type TParameterBaseMapping<Input extends unknown> = (Input);
|
|
|
245
248
|
export declare function ParameterBaseMapping(input: unknown): unknown;
|
|
246
249
|
export type TParameterMapping<Input extends [unknown, unknown] | [unknown]> = (Input extends ['...', infer Type extends T.TSchema] ? T.TRest<Type> : Input extends [infer Type extends T.TSchema] ? Type : never);
|
|
247
250
|
export declare function ParameterMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
248
|
-
export type TParameterListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
249
|
-
export declare function ParameterListMapping(input: [unknown, unknown]): unknown;
|
|
251
|
+
export type TParameterListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
252
|
+
export declare function ParameterListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
250
253
|
export type T_Function_Mapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['(', infer ParameterList extends T.TSchema[], ')', '=>', infer ReturnType extends T.TSchema] ? T.TFunction<ParameterList, ReturnType> : never);
|
|
251
254
|
export declare function _Function_Mapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
252
255
|
export type T_Constructor_Mapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown]> = (Input extends ['new', '(', infer ParameterList extends T.TSchema[], ')', '=>', infer InstanceType extends T.TSchema] ? T.TConstructor<ParameterList, InstanceType> : never);
|
|
@@ -280,15 +283,15 @@ export type TWithPropertyMapping<Input extends [unknown, unknown, unknown]> = (I
|
|
|
280
283
|
[_ in Key]: Value;
|
|
281
284
|
} : never);
|
|
282
285
|
export declare function WithPropertyMapping(input: [unknown, unknown, unknown]): unknown;
|
|
283
|
-
export type TWithPropertyListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
284
|
-
export declare function WithPropertyListMapping(input: [unknown, unknown]): unknown;
|
|
286
|
+
export type TWithPropertyListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
287
|
+
export declare function WithPropertyListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
285
288
|
type TWithObjectMappingReduce<PropertyList extends Record<PropertyKey, unknown>[], Result extends Record<PropertyKey, unknown> = {}> = (PropertyList extends [infer Left extends Record<PropertyKey, unknown>, ...infer Right extends Record<PropertyKey, unknown>[]] ? TWithObjectMappingReduce<Right, Memory.TAssign<Result, Left>> : {
|
|
286
289
|
[Key in keyof Result]: Result[Key];
|
|
287
290
|
});
|
|
288
291
|
export type TWithObjectMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['{', infer PropertyList extends Record<PropertyKey, unknown>[], '}'] ? TWithObjectMappingReduce<PropertyList> : {});
|
|
289
292
|
export declare function WithObjectMapping(input: [unknown, unknown, unknown]): unknown;
|
|
290
|
-
export type TWithElementListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
291
|
-
export declare function WithElementListMapping(input: [unknown, unknown]): unknown;
|
|
293
|
+
export type TWithElementListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
294
|
+
export declare function WithElementListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
292
295
|
export type TWithArrayMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Elements extends unknown[], ']'] ? Elements : never);
|
|
293
296
|
export declare function WithArrayMapping(input: [unknown, unknown, unknown]): unknown;
|
|
294
297
|
export type TWithValueMapping<Input extends unknown> = (Input);
|
|
@@ -318,8 +321,8 @@ export type TPatternBodyMapping<Input extends unknown> = (Input);
|
|
|
318
321
|
export declare function PatternBodyMapping(input: unknown): unknown;
|
|
319
322
|
export type TPatternMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['^', infer Body extends T.TSchema[], '$'] ? Body : never);
|
|
320
323
|
export declare function PatternMapping(input: [unknown, unknown, unknown]): unknown;
|
|
321
|
-
export type TInterfaceDeclarationHeritageListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
|
|
322
|
-
export declare function InterfaceDeclarationHeritageListMapping(input: [unknown, unknown]): unknown;
|
|
324
|
+
export type TInterfaceDeclarationHeritageListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
325
|
+
export declare function InterfaceDeclarationHeritageListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
323
326
|
export type TInterfaceDeclarationHeritageMapping<Input extends [unknown, unknown] | []> = (Input extends ['extends', infer Heritage extends T.TSchema[]] ? Heritage : []);
|
|
324
327
|
export declare function InterfaceDeclarationHeritageMapping(input: [unknown, unknown] | []): unknown;
|
|
325
328
|
export type TInterfaceDeclarationGenericMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['interface', infer Name extends string, infer Parameters extends T.TParameter[], infer Heritage extends T.TSchema[], infer Properties extends [T.TProperties, T.TProperties]] ? {
|
|
@@ -342,11 +345,11 @@ export type TExportKeywordMapping<Input extends [unknown] | []> = (null);
|
|
|
342
345
|
export declare function ExportKeywordMapping(input: [unknown] | []): unknown;
|
|
343
346
|
export type TModuleDeclarationDelimiterMapping<Input extends [unknown, unknown] | [unknown]> = (Input);
|
|
344
347
|
export declare function ModuleDeclarationDelimiterMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
345
|
-
export type TModuleDeclarationListMapping<Input extends [unknown, unknown]> = (
|
|
346
|
-
export declare function ModuleDeclarationListMapping(input: [unknown, unknown]): unknown;
|
|
348
|
+
export type TModuleDeclarationListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
349
|
+
export declare function ModuleDeclarationListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
347
350
|
export type TModuleDeclarationMapping<Input extends [unknown, unknown, unknown]> = (Input extends [null, infer ModuleDeclaration extends T.TProperties, null] ? ModuleDeclaration : never);
|
|
348
351
|
export declare function ModuleDeclarationMapping(input: [unknown, unknown, unknown]): unknown;
|
|
349
|
-
export type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends T.TProperties, infer ModuleDeclarationList extends
|
|
352
|
+
export type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends T.TProperties, infer ModuleDeclarationList extends T.TProperties[]] ? S.TModuleDeferred<Memory.TAssign<ModuleDeclaration, TPropertiesReduce<ModuleDeclarationList>[0]>> : never);
|
|
350
353
|
export declare function ModuleMapping(input: [unknown, unknown]): unknown;
|
|
351
354
|
export type TScriptMapping<Input extends unknown> = (Input);
|
|
352
355
|
export declare function ScriptMapping(input: unknown): unknown;
|
|
@@ -39,17 +39,14 @@ function IntrinsicOrCall(ref, parameters) {
|
|
|
39
39
|
function Unreachable() {
|
|
40
40
|
throw Error('Unreachable');
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const [left, right] = input;
|
|
51
|
-
return DelimitedDecode([...left, ...right]);
|
|
52
|
-
};
|
|
42
|
+
function DelimitedDecode(input, result = []) {
|
|
43
|
+
return Guard.ShiftLeft(input, (left, right) => DelimitedDecode(right, [...result, left[1]]), () => result);
|
|
44
|
+
}
|
|
45
|
+
function Delimited(input) {
|
|
46
|
+
return Guard.IsEqual(input.length, 3)
|
|
47
|
+
? [input[0], ...DelimitedDecode(input[1])]
|
|
48
|
+
: [];
|
|
49
|
+
}
|
|
53
50
|
export function GenericParameterExtendsEqualsMapping(input) {
|
|
54
51
|
return T.Parameter(input[0], input[2], input[4]);
|
|
55
52
|
}
|
|
@@ -322,17 +319,14 @@ export function ElementNamedMapping(input) {
|
|
|
322
319
|
Guard.IsEqual(input.length, 4) ? (Guard.IsEqual(input[2], 'readonly') ? S.AddReadonlyDeferred(input[3]) : S.AddOptionalDeferred(input[3])) :
|
|
323
320
|
Unreachable());
|
|
324
321
|
}
|
|
325
|
-
export function ElementReadonlyOptionalMapping(input) {
|
|
326
|
-
return S.AddReadonlyDeferred(S.AddOptionalDeferred(input[1]));
|
|
327
|
-
}
|
|
328
|
-
export function ElementReadonlyMapping(input) {
|
|
329
|
-
return S.AddReadonlyDeferred(input[1]);
|
|
330
|
-
}
|
|
331
|
-
export function ElementOptionalMapping(input) {
|
|
332
|
-
return S.AddOptionalDeferred(input[0]);
|
|
333
|
-
}
|
|
334
322
|
export function ElementBaseMapping(input) {
|
|
335
|
-
|
|
323
|
+
if (!Guard.IsArray(input) || !Guard.IsEqual(input.length, 3))
|
|
324
|
+
return input;
|
|
325
|
+
const [isReadonly, type, isOptional] = input;
|
|
326
|
+
return (isReadonly && isOptional ? S.AddReadonlyDeferred(S.AddOptionalDeferred(type)) :
|
|
327
|
+
isReadonly && !isOptional ? S.AddReadonlyDeferred(type) :
|
|
328
|
+
!isReadonly && isOptional ? S.AddOptionalDeferred(type) :
|
|
329
|
+
type);
|
|
336
330
|
}
|
|
337
331
|
// deno-coverage-ignore-start
|
|
338
332
|
export function ElementMapping(input) {
|
|
@@ -520,15 +514,14 @@ export function ModuleDeclarationDelimiterMapping(input) {
|
|
|
520
514
|
return input;
|
|
521
515
|
}
|
|
522
516
|
export function ModuleDeclarationListMapping(input) {
|
|
523
|
-
return
|
|
517
|
+
return Delimited(input);
|
|
524
518
|
}
|
|
525
519
|
export function ModuleDeclarationMapping(input) {
|
|
526
520
|
return input[1];
|
|
527
521
|
}
|
|
528
522
|
export function ModuleMapping(input) {
|
|
529
|
-
const moduleDeclaration = input[0];
|
|
530
|
-
|
|
531
|
-
return S.ModuleDeferred(Memory.Assign(moduleDeclaration, moduleDeclarationList[0]));
|
|
523
|
+
const [moduleDeclaration, moduleDeclarationList] = [input[0], input[1]];
|
|
524
|
+
return S.ModuleDeferred(Memory.Assign(moduleDeclaration, PropertiesReduce(moduleDeclarationList)[0]));
|
|
532
525
|
}
|
|
533
526
|
export function ScriptMapping(input) {
|
|
534
527
|
return input;
|