@tsplc/compiler 0.2.16 → 0.2.18
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/README.md +2 -2
- package/dist/cli.js +920 -943
- package/dist/cli.js.map +13 -10
- package/dist/codesys.js +3893 -3352
- package/dist/codesys.js.map +29 -20
- package/dist/elaborate-capture.js +33 -17
- package/dist/elaborate-capture.js.map +3 -3
- package/dist/index.js +8787 -6855
- package/dist/index.js.map +40 -20
- package/dist/ir.js +1575 -1072
- package/dist/ir.js.map +21 -17
- package/dist/math.js.map +2 -2
- package/dist/project.js +154 -60
- package/dist/project.js.map +5 -5
- package/dist/telemetry.js +27 -9
- package/dist/telemetry.js.map +5 -5
- package/package.json +112 -112
- package/src/codesys/config.ts +50 -0
- package/src/codesys/debug.ts +670 -0
- package/src/codesys/emit.ts +142 -0
- package/src/codesys/engineering.ts +109 -0
- package/src/codesys/expressions.ts +92 -0
- package/src/codesys/global-lists.ts +250 -0
- package/src/codesys/global-names.ts +68 -0
- package/src/codesys/http.ts +890 -0
- package/src/codesys/index.ts +30 -0
- package/src/codesys/instrumentation.ts +430 -0
- package/src/codesys/io-paths.ts +140 -0
- package/src/codesys/manifest.ts +643 -0
- package/src/codesys/names.ts +81 -0
- package/src/codesys/numeric.ts +409 -0
- package/src/codesys/operands.ts +62 -0
- package/src/codesys/plan.ts +605 -0
- package/src/codesys/programs.ts +53 -0
- package/src/codesys/publication.ts +171 -0
- package/src/codesys/routines.ts +603 -0
- package/src/codesys/sources.ts +71 -0
- package/src/codesys/st-files.ts +115 -0
- package/src/codesys/storage.ts +97 -0
- package/src/codesys/symbols.ts +220 -0
- package/src/codesys/task-access.ts +320 -0
- package/src/codesys/telemetry.ts +732 -0
- package/src/codesys/types.ts +250 -0
- package/src/codesys/vendor.ts +150 -0
- package/src/frontend/analyzer.ts +794 -0
- package/src/frontend/async.ts +317 -1137
- package/src/frontend/blocks.ts +537 -403
- package/src/frontend/configuration.ts +176 -144
- package/src/frontend/const-functions.ts +183 -148
- package/src/frontend/cooperative.ts +73 -43
- package/src/frontend/coroutines.ts +1032 -0
- package/src/frontend/elaborate/calls.ts +535 -0
- package/src/frontend/elaborate/capture.ts +157 -101
- package/src/frontend/elaborate/dialect.ts +257 -0
- package/src/frontend/elaborate/expressions.ts +992 -0
- package/src/frontend/elaborate/frame.ts +53 -0
- package/src/frontend/elaborate/graph.ts +116 -71
- package/src/frontend/elaborate/imports.ts +70 -0
- package/src/frontend/elaborate/index.ts +435 -331
- package/src/frontend/elaborate/initializers.ts +198 -0
- package/src/frontend/elaborate/layouts.ts +591 -384
- package/src/frontend/elaborate/model.ts +264 -169
- package/src/frontend/elaborate/specialize.ts +343 -2586
- package/src/frontend/elaborate/statements.ts +606 -0
- package/src/frontend/elaborate/storage.ts +546 -0
- package/src/frontend/elaborate/values.ts +58 -0
- package/src/frontend/elaborate/writes.ts +100 -0
- package/src/frontend/exposure.ts +172 -140
- package/src/frontend/expressions.ts +1383 -0
- package/src/frontend/intrinsics.ts +337 -0
- package/src/frontend/module-graph.ts +89 -59
- package/src/frontend/positions.ts +271 -200
- package/src/frontend/promise-chains.ts +897 -0
- package/src/frontend/promises.ts +390 -747
- package/src/frontend/routines.ts +181 -0
- package/src/frontend/sdk.ts +82 -0
- package/src/frontend/services.ts +506 -372
- package/src/frontend/statements.ts +855 -0
- package/src/frontend/tasks.ts +471 -0
- package/src/frontend/telemetry.ts +174 -0
- package/src/frontend/types.ts +845 -551
- package/src/frontend/typescript.ts +323 -2543
- package/src/index.ts +5 -5
- package/src/ir/aggregates.ts +275 -0
- package/src/ir/allocation.ts +84 -0
- package/src/ir/core-model.ts +146 -0
- package/src/ir/declarations.ts +295 -0
- package/src/ir/diagnostics.ts +61 -0
- package/src/ir/domains.ts +152 -0
- package/src/ir/fold.ts +342 -0
- package/src/ir/index.ts +90 -0
- package/{ir/errors.ts → src/ir/job-errors.ts} +12 -10
- package/src/ir/layouts.ts +181 -0
- package/src/ir/link.ts +354 -0
- package/src/ir/model.ts +386 -0
- package/{ir → src/ir}/normalization-error.ts +4 -4
- package/src/ir/normalize.ts +70 -0
- package/src/ir/numeric.ts +171 -0
- package/src/ir/ranges.ts +256 -0
- package/src/ir/routine.ts +1163 -0
- package/src/ir/scalars.ts +321 -0
- package/src/ir/types.ts +127 -0
- package/src/project/artifacts.ts +342 -0
- package/src/project/cli.ts +177 -0
- package/src/project/debugger.ts +82 -0
- package/src/project/index.ts +6 -0
- package/src/project/plant.ts +467 -0
- package/src/project/project-commands.ts +372 -0
- package/src/project/project.ts +457 -0
- package/src/project/release.ts +153 -0
- package/src/project/server.ts +150 -0
- package/src/project/terminal.ts +32 -0
- package/stdlib/math.ts +14 -10
- package/stdlib/telemetry.ts +71 -47
- package/types/async.d.ts +46 -40
- package/types/data-types.d.ts +26 -26
- package/types/globals.d.ts +41 -38
- package/types/index.d.ts +96 -51
- package/types/plc.d.ts +3 -4
- package/types/telemetry.d.ts +14 -14
- package/backends/codesys/config.ts +0 -54
- package/backends/codesys/debug.ts +0 -509
- package/backends/codesys/emit.ts +0 -1738
- package/backends/codesys/engineering.ts +0 -88
- package/backends/codesys/global-names.ts +0 -49
- package/backends/codesys/http.ts +0 -675
- package/backends/codesys/index.ts +0 -13
- package/backends/codesys/io-paths.ts +0 -105
- package/backends/codesys/manifest.ts +0 -312
- package/backends/codesys/names.ts +0 -76
- package/backends/codesys/numeric.ts +0 -356
- package/backends/codesys/plan.ts +0 -457
- package/backends/codesys/publication.ts +0 -59
- package/backends/codesys/storage.ts +0 -70
- package/backends/codesys/task-access.ts +0 -293
- package/backends/codesys/telemetry.ts +0 -593
- package/backends/codesys/types.ts +0 -179
- package/backends/codesys/vendor.ts +0 -108
- package/ir/aggregates.ts +0 -333
- package/ir/allocation.ts +0 -74
- package/ir/core-model.ts +0 -129
- package/ir/core.ts +0 -64
- package/ir/declarations.ts +0 -208
- package/ir/diagnostics.ts +0 -43
- package/ir/domains.ts +0 -96
- package/ir/index.ts +0 -8
- package/ir/link.ts +0 -185
- package/ir/model.ts +0 -346
- package/ir/routine.ts +0 -859
- package/ir/scalars.ts +0 -675
- package/ir/types.ts +0 -76
- package/project/artifacts.ts +0 -277
- package/project/cli.ts +0 -395
- package/project/index.ts +0 -1
- package/project/plant.ts +0 -509
- package/project/project.ts +0 -358
- package/project/server.ts +0 -113
package/types/index.d.ts
CHANGED
|
@@ -19,16 +19,40 @@ export type Input<T> = T;
|
|
|
19
19
|
export type Output<T> = T;
|
|
20
20
|
|
|
21
21
|
// Conversions and arithmetic state their overflow policy explicitly.
|
|
22
|
-
export declare function exact<T extends number | bigint>(
|
|
23
|
-
|
|
22
|
+
export declare function exact<T extends number | bigint>(
|
|
23
|
+
value: number | bigint,
|
|
24
|
+
): T;
|
|
25
|
+
export declare function wrap<T extends number | bigint>(
|
|
26
|
+
value: number | bigint,
|
|
27
|
+
): T;
|
|
24
28
|
// Float-to-float saturation clips to finite target endpoints, then rounds to its width.
|
|
25
|
-
export declare function saturate<T extends number | bigint>(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export declare function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
export declare function saturate<T extends number | bigint>(
|
|
30
|
+
value: number | bigint,
|
|
31
|
+
): T;
|
|
32
|
+
export declare function wrapAdd<T extends number | bigint>(
|
|
33
|
+
left: T,
|
|
34
|
+
right: T,
|
|
35
|
+
): T;
|
|
36
|
+
export declare function wrapSubtract<T extends number | bigint>(
|
|
37
|
+
left: T,
|
|
38
|
+
right: T,
|
|
39
|
+
): T;
|
|
40
|
+
export declare function wrapMultiply<T extends number | bigint>(
|
|
41
|
+
left: T,
|
|
42
|
+
right: T,
|
|
43
|
+
): T;
|
|
44
|
+
export declare function saturatingAdd<T extends number | bigint>(
|
|
45
|
+
left: T,
|
|
46
|
+
right: T,
|
|
47
|
+
): T;
|
|
48
|
+
export declare function saturatingSubtract<T extends number | bigint>(
|
|
49
|
+
left: T,
|
|
50
|
+
right: T,
|
|
51
|
+
): T;
|
|
52
|
+
export declare function saturatingMultiply<T extends number | bigint>(
|
|
53
|
+
left: T,
|
|
54
|
+
right: T,
|
|
55
|
+
): T;
|
|
32
56
|
export declare function div<T extends number | bigint>(left: T, right: T): T;
|
|
33
57
|
|
|
34
58
|
// Capacity and bounds are compiler metadata, erased by the TypeScript checker.
|
|
@@ -38,14 +62,18 @@ export type WSTRING<_N extends number> = string;
|
|
|
38
62
|
export declare function defaultValue<T>(): T;
|
|
39
63
|
export declare function copy<T>(value: T): T;
|
|
40
64
|
// `for (const [key, element] of entries(record))` iterates an enum-keyed Record by key.
|
|
41
|
-
export declare function entries<K extends number, T>(
|
|
65
|
+
export declare function entries<K extends number, T>(
|
|
66
|
+
record: Record<K, T>,
|
|
67
|
+
): [K, T][];
|
|
42
68
|
|
|
43
69
|
declare const timeBrand: unique symbol;
|
|
44
70
|
declare const calendarBrand: unique symbol;
|
|
45
71
|
export type TIME = number & { readonly [timeBrand]: "TIME" };
|
|
46
72
|
export type DATE = string & { readonly [calendarBrand]: "DATE" };
|
|
47
73
|
export type TIME_OF_DAY = string & { readonly [calendarBrand]: "TIME_OF_DAY" };
|
|
48
|
-
export type DATE_AND_TIME = string & {
|
|
74
|
+
export type DATE_AND_TIME = string & {
|
|
75
|
+
readonly [calendarBrand]: "DATE_AND_TIME";
|
|
76
|
+
};
|
|
49
77
|
|
|
50
78
|
// Borrowing and retained storage are checked by the compiler, not JS wrappers.
|
|
51
79
|
export type InOut<T> = T;
|
|
@@ -63,85 +91,102 @@ export declare function dateAndTime(value: string): DATE_AND_TIME;
|
|
|
63
91
|
|
|
64
92
|
// The empty output schema makes execute return void for outputless blocks.
|
|
65
93
|
export declare abstract class FunctionBlock<I, O = Record<never, never>> {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
94
|
+
readonly out: Readonly<O>;
|
|
95
|
+
update(input: I): void;
|
|
96
|
+
protected abstract execute(input: I): keyof O extends never ? void : O;
|
|
69
97
|
}
|
|
70
98
|
|
|
71
99
|
/** Starts on, then alternates `onTime` and `offTime`. Keeps its last `on` when disabled. CODESYS Util.BLINK. */
|
|
72
100
|
export declare class Blinker extends FunctionBlock<
|
|
73
|
-
|
|
74
|
-
|
|
101
|
+
{ enabled: BOOL; offTime: TIME; onTime: TIME },
|
|
102
|
+
{ on: BOOL }
|
|
75
103
|
> {
|
|
76
|
-
|
|
104
|
+
protected execute(input: { enabled: BOOL; offTime: TIME; onTime: TIME }): {
|
|
105
|
+
on: BOOL;
|
|
106
|
+
};
|
|
77
107
|
}
|
|
78
108
|
|
|
79
109
|
/** `done` once `enabled` has held for `duration`; resets when `enabled` drops. `elapsed` stops at `duration`. IEC TON. */
|
|
80
110
|
export declare class OnDelayTimer extends FunctionBlock<
|
|
81
|
-
|
|
82
|
-
|
|
111
|
+
{ enabled: BOOL; duration: TIME },
|
|
112
|
+
{ done: BOOL; elapsed: TIME }
|
|
83
113
|
> {
|
|
84
|
-
|
|
114
|
+
protected execute(input: { enabled: BOOL; duration: TIME }): {
|
|
115
|
+
done: BOOL;
|
|
116
|
+
elapsed: TIME;
|
|
117
|
+
};
|
|
85
118
|
}
|
|
86
119
|
|
|
87
120
|
/** `active` while `enabled`, and for `duration` after it drops. IEC TOF. */
|
|
88
121
|
export declare class OffDelayTimer extends FunctionBlock<
|
|
89
|
-
|
|
90
|
-
|
|
122
|
+
{ enabled: BOOL; duration: TIME },
|
|
123
|
+
{ active: BOOL; elapsed: TIME }
|
|
91
124
|
> {
|
|
92
|
-
|
|
125
|
+
protected execute(input: { enabled: BOOL; duration: TIME }): {
|
|
126
|
+
active: BOOL;
|
|
127
|
+
elapsed: TIME;
|
|
128
|
+
};
|
|
93
129
|
}
|
|
94
130
|
|
|
95
131
|
/** `active` for `duration` from a rising `start`; `start` is ignored while active. IEC TP. */
|
|
96
132
|
export declare class PulseTimer extends FunctionBlock<
|
|
97
|
-
|
|
98
|
-
|
|
133
|
+
{ start: BOOL; duration: TIME },
|
|
134
|
+
{ active: BOOL; elapsed: TIME }
|
|
99
135
|
> {
|
|
100
|
-
|
|
136
|
+
protected execute(input: { start: BOOL; duration: TIME }): {
|
|
137
|
+
active: BOOL;
|
|
138
|
+
elapsed: TIME;
|
|
139
|
+
};
|
|
101
140
|
}
|
|
102
141
|
|
|
103
142
|
/** `rose` for the one update where `signal` goes from false to true. IEC R_TRIG. */
|
|
104
|
-
export declare class RisingEdge extends FunctionBlock<
|
|
105
|
-
|
|
143
|
+
export declare class RisingEdge extends FunctionBlock<
|
|
144
|
+
{ signal: BOOL },
|
|
145
|
+
{ rose: BOOL }
|
|
146
|
+
> {
|
|
147
|
+
protected execute(input: { signal: BOOL }): { rose: BOOL };
|
|
106
148
|
}
|
|
107
149
|
|
|
108
150
|
/** `fell` for the one update where `signal` goes from true to false. IEC F_TRIG. */
|
|
109
|
-
export declare class FallingEdge extends FunctionBlock<
|
|
110
|
-
|
|
151
|
+
export declare class FallingEdge extends FunctionBlock<
|
|
152
|
+
{ signal: BOOL },
|
|
153
|
+
{ fell: BOOL }
|
|
154
|
+
> {
|
|
155
|
+
protected execute(input: { signal: BOOL }): { fell: BOOL };
|
|
111
156
|
}
|
|
112
157
|
|
|
113
158
|
/** Counts rising `countUp` edges. `reset` clears `value`. `reachedPreset` indicates `value >= preset`. CODESYS CTU. */
|
|
114
159
|
export declare class UpCounter extends FunctionBlock<
|
|
115
|
-
|
|
116
|
-
|
|
160
|
+
{ countUp: BOOL; reset: BOOL; preset: WORD },
|
|
161
|
+
{ reachedPreset: BOOL; value: WORD }
|
|
117
162
|
> {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
163
|
+
protected execute(input: { countUp: BOOL; reset: BOOL; preset: WORD }): {
|
|
164
|
+
reachedPreset: BOOL;
|
|
165
|
+
value: WORD;
|
|
166
|
+
};
|
|
122
167
|
}
|
|
123
168
|
|
|
124
169
|
/** Counts down on rising `countDown` edges. `load` sets `value` to `preset`. `atZero` indicates `value = 0`. CODESYS CTD. */
|
|
125
170
|
export declare class DownCounter extends FunctionBlock<
|
|
126
|
-
|
|
127
|
-
|
|
171
|
+
{ countDown: BOOL; load: BOOL; preset: WORD },
|
|
172
|
+
{ atZero: BOOL; value: WORD }
|
|
128
173
|
> {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
174
|
+
protected execute(input: { countDown: BOOL; load: BOOL; preset: WORD }): {
|
|
175
|
+
atZero: BOOL;
|
|
176
|
+
value: WORD;
|
|
177
|
+
};
|
|
133
178
|
}
|
|
134
179
|
|
|
135
180
|
/** Counts rising edges in either direction. `reset` clears `value`, and `load` sets `value` to `preset`. CODESYS CTUD. */
|
|
136
181
|
export declare class UpDownCounter extends FunctionBlock<
|
|
137
|
-
|
|
138
|
-
|
|
182
|
+
{ countUp: BOOL; countDown: BOOL; reset: BOOL; load: BOOL; preset: WORD },
|
|
183
|
+
{ reachedPreset: BOOL; atZero: BOOL; value: WORD }
|
|
139
184
|
> {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
185
|
+
protected execute(input: {
|
|
186
|
+
countUp: BOOL;
|
|
187
|
+
countDown: BOOL;
|
|
188
|
+
reset: BOOL;
|
|
189
|
+
load: BOOL;
|
|
190
|
+
preset: WORD;
|
|
191
|
+
}): { reachedPreset: BOOL; atZero: BOOL; value: WORD };
|
|
147
192
|
}
|
package/types/plc.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** Sample an explicitly named, read-only telemetry record from the cyclic caller task. */
|
|
2
|
-
export declare function expose<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
): void;
|
|
2
|
+
export declare function expose<
|
|
3
|
+
const T extends Record<string, boolean | number | string>,
|
|
4
|
+
>(name: string, telemetry: T): void;
|
package/types/telemetry.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { BYTE } from "./index.d.ts";
|
|
|
3
3
|
declare const textBrand: unique symbol;
|
|
4
4
|
/** A byte array sent as text; made by `telemetry.text`. */
|
|
5
5
|
export interface TelemetryText {
|
|
6
|
-
|
|
6
|
+
readonly [textBrand]: true;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* A property value: BOOL, an integer, REAL or LREAL, an enum (sent as its member's name), a
|
|
@@ -19,18 +19,18 @@ export type TelemetryProperties = Readonly<Record<string, TelemetryValue>>;
|
|
|
19
19
|
* not every scan: each call fills a slot of a fixed ring the task sends to its server.
|
|
20
20
|
*/
|
|
21
21
|
export interface Telemetry {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
/** An event, such as `"bin scanned"`. */
|
|
23
|
+
capture(event: string, properties?: TelemetryProperties): void;
|
|
24
|
+
info(message: string, properties?: TelemetryProperties): void;
|
|
25
|
+
warn(message: string, properties?: TelemetryProperties): void;
|
|
26
|
+
error(message: string, properties?: TelemetryProperties): void;
|
|
27
|
+
/**
|
|
28
|
+
* A failure: a `catch` binding, which holds the error code, or any code the program picks.
|
|
29
|
+
* Known job error codes are sent with their meaning.
|
|
30
|
+
*/
|
|
31
|
+
captureException(error: unknown, properties?: TelemetryProperties): void;
|
|
32
|
+
/** The first `length` bytes of `bytes`, up to the first 0, as text: a barcode in its buffer. */
|
|
33
|
+
text(bytes: readonly BYTE[], length: number): TelemetryText;
|
|
34
34
|
}
|
|
35
35
|
export declare const telemetry: Telemetry;
|
|
36
36
|
|
|
@@ -40,5 +40,5 @@ export declare const telemetry: Telemetry;
|
|
|
40
40
|
* are dropped.
|
|
41
41
|
*/
|
|
42
42
|
export declare function onTelemetry(
|
|
43
|
-
|
|
43
|
+
collector: (record: Readonly<Record<string, unknown>>) => void,
|
|
44
44
|
): () => void;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
httpOptionsSchema,
|
|
3
|
-
buildTargetSchema,
|
|
4
|
-
publicationSchema,
|
|
5
|
-
type TargetDescriptor,
|
|
6
|
-
} from "@tsplc/config";
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { engineeringSchema } from "./engineering.ts";
|
|
9
|
-
import { isIecIdentifier } from "./names.ts";
|
|
10
|
-
|
|
11
|
-
const addressSchema = z
|
|
12
|
-
.object({
|
|
13
|
-
kind: z.literal("direct"),
|
|
14
|
-
address: z.string().regex(/^%(?:[IQ]X[0-9]+\.[0-7]|[IQ][BWD][0-9]+)$/),
|
|
15
|
-
type: z.string().optional(),
|
|
16
|
-
// A generated device tree maps this bit or byte channel to its target
|
|
17
|
-
// variable, so the scan needs no AT wire or copy.
|
|
18
|
-
mapped: z.boolean().optional(),
|
|
19
|
-
inverted: z.boolean().optional(),
|
|
20
|
-
shared: z.boolean().optional(),
|
|
21
|
-
})
|
|
22
|
-
.strict();
|
|
23
|
-
// Explicit IEC object names keep their exact spelling, so they must already be valid.
|
|
24
|
-
const iecNames = z
|
|
25
|
-
.record(
|
|
26
|
-
z.string().min(1),
|
|
27
|
-
z.string().refine(isIecIdentifier, "Use a valid, non-reserved IEC identifier."),
|
|
28
|
-
)
|
|
29
|
-
.optional();
|
|
30
|
-
export const optionsSchema = z
|
|
31
|
-
.object({
|
|
32
|
-
engineering: engineeringSchema,
|
|
33
|
-
http: httpOptionsSchema,
|
|
34
|
-
io: z.record(z.string().min(1), addressSchema),
|
|
35
|
-
publish: publicationSchema.default({ production: [], development: [] }),
|
|
36
|
-
buildTarget: buildTargetSchema.default("production"),
|
|
37
|
-
programNames: iecNames,
|
|
38
|
-
})
|
|
39
|
-
.strict();
|
|
40
|
-
export type CodesysOptions = z.infer<typeof optionsSchema>;
|
|
41
|
-
export function codesys(
|
|
42
|
-
options: z.input<typeof optionsSchema>,
|
|
43
|
-
): TargetDescriptor<z.input<typeof optionsSchema>> {
|
|
44
|
-
return { kind: "codesys", options };
|
|
45
|
-
}
|
|
46
|
-
export function direct(
|
|
47
|
-
address:
|
|
48
|
-
| `%IX${number}.${number}`
|
|
49
|
-
| `%QX${number}.${number}`
|
|
50
|
-
| `%I${"B" | "W" | "D"}${number}`
|
|
51
|
-
| `%Q${"B" | "W" | "D"}${number}`,
|
|
52
|
-
): z.infer<typeof addressSchema> {
|
|
53
|
-
return { kind: "direct", address };
|
|
54
|
-
}
|