@soundscript/cli-darwin-arm64 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/soundscript +0 -0
- package/package.json +5 -4
- package/src/bundled/portable-web-globals.d.ts +153 -0
- package/src/bundled/sound-libs/lib.es2015.iterable.d.ts +49 -49
- package/src/bundled/sound-libs/lib.es2015.promise.d.ts +2 -2
- package/src/bundled/sound-libs/lib.es2016.array.include.d.ts +8 -8
- package/src/bundled/sound-libs/lib.es2020.bigint.d.ts +60 -60
- package/src/bundled/sound-libs/lib.es2022.array.d.ts +10 -10
- package/src/bundled/sound-libs/lib.es2023.array.d.ts +70 -70
- package/src/bundled/sound-libs/lib.es5.d.ts +210 -210
- package/src/stdlib/async.d.ts +3 -3
- package/src/stdlib/codec.d.ts +3 -2
- package/src/stdlib/decode.d.ts +6 -4
- package/src/stdlib/encode.d.ts +11 -9
- package/src/stdlib/fetch.d.ts +1 -1
- package/src/stdlib/json.d.ts +29 -2
- package/src/stdlib/numerics.d.ts +521 -43
- package/src/stdlib/result.d.ts +21 -5
- package/src/stdlib/typeclasses.d.ts +2 -2
- package/src/stdlib/value.d.ts +9 -0
- package/src/stdlib/component.d.ts +0 -40
package/src/stdlib/async.d.ts
CHANGED
|
@@ -54,15 +54,15 @@ export function flatMap<A, B, E1, E2>(
|
|
|
54
54
|
): Task<B, E1 | E2>;
|
|
55
55
|
export function recover<A, B, E>(
|
|
56
56
|
task: Task<A, E>,
|
|
57
|
-
project: (error: E) => B |
|
|
57
|
+
project: (error: E) => B | Promise<B>,
|
|
58
58
|
): Task<A | B, Error>;
|
|
59
59
|
export function tap<A, E>(
|
|
60
60
|
task: Task<A, E>,
|
|
61
|
-
effect: (value: A) => unknown |
|
|
61
|
+
effect: (value: A) => unknown | Promise<unknown>,
|
|
62
62
|
): Task<A, E | Error>;
|
|
63
63
|
export function tapError<A, E>(
|
|
64
64
|
task: Task<A, E>,
|
|
65
|
-
effect: (error: E) => unknown |
|
|
65
|
+
effect: (error: E) => unknown | Promise<unknown>,
|
|
66
66
|
): Task<A, E | Error>;
|
|
67
67
|
export function parallel<T, E>(tasks: readonly Task<T, E>[]): Task<readonly T[], E>;
|
|
68
68
|
export function race<T, E>(
|
package/src/stdlib/codec.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ import type { Invariant } from 'sts:typeclasses';
|
|
|
6
6
|
export { booleanEncoder, contramap, numberEncoder, stringEncoder } from 'sts:encode';
|
|
7
7
|
export type { EncodeFailure, Encoder } from 'sts:encode';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// #[variance(T: inout, TEncoded: out, DE: out, EE: out)]
|
|
10
|
+
export type Codec<T, TEncoded = unknown, DE = DecodeFailure, EE = EncodeFailure> =
|
|
11
|
+
Decoder<T, DE> & Encoder<T, TEncoded, EE>;
|
|
11
12
|
|
|
12
13
|
export interface CodecF extends TypeLambda {
|
|
13
14
|
readonly type: Codec<this['Args'][3], this['Args'][2], this['Args'][1], this['Args'][0]>;
|
package/src/stdlib/decode.d.ts
CHANGED
|
@@ -17,14 +17,16 @@ export class DecodeFailure extends Failure {
|
|
|
17
17
|
at(segment: DecodePathSegment): this;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// #[variance(T: out, E: out)]
|
|
21
|
+
export type Decoder<T, E = DecodeFailure> = {
|
|
21
22
|
decode(value: unknown): Result<T, E>;
|
|
22
|
-
}
|
|
23
|
+
};
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
// #[variance(T: out, E: out)]
|
|
26
|
+
export type OptionalDecoder<T, E = DecodeFailure> = Decoder<T | undefined, E> & {
|
|
25
27
|
readonly __soundscriptOptional: true;
|
|
26
28
|
readonly inner: Decoder<T, E>;
|
|
27
|
-
}
|
|
29
|
+
};
|
|
28
30
|
|
|
29
31
|
type DecoderValue<TDecoder> = TDecoder extends Decoder<infer TValue, unknown> ? TValue : never;
|
|
30
32
|
type DecoderError<TDecoder> = TDecoder extends Decoder<unknown, infer E> ? E : never;
|
package/src/stdlib/encode.d.ts
CHANGED
|
@@ -7,15 +7,17 @@ export class EncodeFailure extends Failure {
|
|
|
7
7
|
constructor(message?: string, cause?: unknown);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// #[variance(T: in, TEncoded: out, E: out)]
|
|
11
|
+
export type Encoder<T, TEncoded = unknown, E = EncodeFailure> = {
|
|
11
12
|
encode(value: T): Result<TEncoded, E>;
|
|
12
|
-
}
|
|
13
|
+
};
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// #[variance(T: in, TEncoded: out, E: out)]
|
|
16
|
+
export type OptionalEncoder<T, TEncoded = T, E = EncodeFailure> =
|
|
17
|
+
Encoder<T | undefined, TEncoded | undefined, E> & {
|
|
18
|
+
readonly __soundscriptOptional: true;
|
|
19
|
+
readonly inner: Encoder<T, TEncoded, E>;
|
|
20
|
+
};
|
|
19
21
|
|
|
20
22
|
type EncoderInput<TEncoder> = TEncoder extends Encoder<infer TValue, unknown, unknown> ? TValue
|
|
21
23
|
: never;
|
|
@@ -72,8 +74,8 @@ export function option<T, TEncoded, E>(
|
|
|
72
74
|
item: Encoder<T, TEncoded, E>,
|
|
73
75
|
): Encoder<
|
|
74
76
|
Option<T>,
|
|
75
|
-
{ readonly
|
|
76
|
-
readonly tag: '
|
|
77
|
+
{ readonly tag: 'none' } | {
|
|
78
|
+
readonly tag: 'some';
|
|
77
79
|
readonly value: TEncoded;
|
|
78
80
|
},
|
|
79
81
|
E
|
package/src/stdlib/fetch.d.ts
CHANGED
package/src/stdlib/json.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Failure } from 'sts:failures';
|
|
|
2
2
|
import type { Decoder } from 'sts:decode';
|
|
3
3
|
import type { Encoder } from 'sts:encode';
|
|
4
4
|
import type { Result } from 'sts:result';
|
|
5
|
+
import type { Numeric } from 'sts:numerics';
|
|
5
6
|
|
|
6
7
|
export type JsonArray = JsonValue[];
|
|
7
8
|
export type JsonObject = {
|
|
@@ -35,15 +36,33 @@ export type JsonLikeValue =
|
|
|
35
36
|
| JsonLikeObject
|
|
36
37
|
| JsonLikeArray;
|
|
37
38
|
|
|
39
|
+
export type MachineJsonArray = MachineJsonLikeValue[];
|
|
40
|
+
export type MachineJsonObject = {
|
|
41
|
+
[key: string]: MachineJsonLikeValue;
|
|
42
|
+
};
|
|
43
|
+
export type MachineJsonLikeValue =
|
|
44
|
+
| string
|
|
45
|
+
| number
|
|
46
|
+
| boolean
|
|
47
|
+
| bigint
|
|
48
|
+
| null
|
|
49
|
+
| undefined
|
|
50
|
+
| Numeric
|
|
51
|
+
| MachineJsonObject
|
|
52
|
+
| MachineJsonArray;
|
|
53
|
+
|
|
38
54
|
export interface JsonParseOptions {
|
|
39
55
|
int64?: 'default' | 'lossless';
|
|
56
|
+
numerics?: 'tagged';
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
export type JsonStringifyBigintMode = 'number' | 'reject' | 'string';
|
|
60
|
+
export type MachineJsonNumericMode = 'tagged' | 'decimal-string' | 'json-number';
|
|
43
61
|
|
|
44
62
|
export interface JsonStringifyOptions {
|
|
45
63
|
int64?: 'default' | 'string' | 'lossless';
|
|
46
64
|
readonly bigint?: JsonStringifyBigintMode;
|
|
65
|
+
numerics?: MachineJsonNumericMode;
|
|
47
66
|
}
|
|
48
67
|
|
|
49
68
|
export class JsonParseFailure extends Failure {
|
|
@@ -59,17 +78,25 @@ export function parseJson(
|
|
|
59
78
|
text: string,
|
|
60
79
|
options: JsonParseOptions & { int64: 'lossless' },
|
|
61
80
|
): Result<LosslessJsonValue, JsonParseFailure>;
|
|
81
|
+
export function parseJson(
|
|
82
|
+
text: string,
|
|
83
|
+
options: JsonParseOptions & { numerics: 'tagged' },
|
|
84
|
+
): Result<MachineJsonLikeValue, JsonParseFailure>;
|
|
62
85
|
export function parseJson(
|
|
63
86
|
text: string,
|
|
64
87
|
options?: JsonParseOptions,
|
|
65
|
-
): Result<JsonValue | LosslessJsonValue, JsonParseFailure>;
|
|
88
|
+
): Result<JsonValue | LosslessJsonValue | MachineJsonLikeValue, JsonParseFailure>;
|
|
66
89
|
export function stringifyJson(value: JsonValue): Result<string, JsonStringifyFailure>;
|
|
67
90
|
export function stringifyJson(
|
|
68
91
|
value: LosslessJsonValue,
|
|
69
92
|
options: JsonStringifyOptions & { int64: 'string' | 'lossless' },
|
|
70
93
|
): Result<string, JsonStringifyFailure>;
|
|
71
94
|
export function stringifyJson(
|
|
72
|
-
value:
|
|
95
|
+
value: MachineJsonLikeValue,
|
|
96
|
+
options: JsonStringifyOptions & { numerics: MachineJsonNumericMode },
|
|
97
|
+
): Result<string, JsonStringifyFailure>;
|
|
98
|
+
export function stringifyJson(
|
|
99
|
+
value: JsonValue | LosslessJsonValue | MachineJsonLikeValue,
|
|
73
100
|
options?: JsonStringifyOptions,
|
|
74
101
|
): Result<string, JsonStringifyFailure>;
|
|
75
102
|
export function parseAndDecode<T, E>(
|