jsonc-effect 0.2.0 → 0.2.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/index.d.ts +10 -10
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { Effect } from 'effect';
|
|
12
|
-
import { Equals } from 'effect/Types';
|
|
13
12
|
import { Option } from 'effect';
|
|
14
13
|
import { Schema } from 'effect';
|
|
15
14
|
import { Stream } from 'effect';
|
|
15
|
+
import { VoidIfEmpty } from 'effect/Types';
|
|
16
16
|
import { YieldableError } from 'effect/Cause';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -386,7 +386,7 @@ export declare const findNodeAtOffset: {
|
|
|
386
386
|
*
|
|
387
387
|
* @public
|
|
388
388
|
*/
|
|
389
|
-
export declare const format: (text: string, range?: JsoncRange
|
|
389
|
+
export declare const format: (text: string, range?: JsoncRange, options?: Partial<JsoncFormattingOptions>) => Effect.Effect<ReadonlyArray<JsoncEdit>>;
|
|
390
390
|
|
|
391
391
|
/**
|
|
392
392
|
* Format a JSONC document in one step by computing edits and immediately
|
|
@@ -415,7 +415,7 @@ export declare const format: (text: string, range?: JsoncRange | undefined, opti
|
|
|
415
415
|
*
|
|
416
416
|
* @public
|
|
417
417
|
*/
|
|
418
|
-
export declare const formatAndApply: (text: string, range?: JsoncRange
|
|
418
|
+
export declare const formatAndApply: (text: string, range?: JsoncRange, options?: Partial<JsoncFormattingOptions>) => Effect.Effect<string>;
|
|
419
419
|
|
|
420
420
|
/**
|
|
421
421
|
* Get the JSON path to the node at a specific character offset.
|
|
@@ -503,7 +503,7 @@ export declare const getNodePath: {
|
|
|
503
503
|
*
|
|
504
504
|
* @public
|
|
505
505
|
*/
|
|
506
|
-
export declare const getNodeValue: (node: JsoncNode) => Effect.Effect<unknown
|
|
506
|
+
export declare const getNodeValue: (node: JsoncNode) => Effect.Effect<unknown>;
|
|
507
507
|
|
|
508
508
|
/**
|
|
509
509
|
* A non-mutating text edit describing a replacement within a JSONC document.
|
|
@@ -757,7 +757,7 @@ export declare class JsoncModificationError extends JsoncModificationErrorBase<{
|
|
|
757
757
|
*
|
|
758
758
|
* @internal
|
|
759
759
|
*/
|
|
760
|
-
export declare const JsoncModificationErrorBase: new <A extends Record<string, any> = {}>(args:
|
|
760
|
+
export declare const JsoncModificationErrorBase: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
761
761
|
readonly _tag: "JsoncModificationError";
|
|
762
762
|
} & Readonly<A>;
|
|
763
763
|
|
|
@@ -880,7 +880,7 @@ export declare class JsoncNodeNotFoundError extends JsoncNodeNotFoundErrorBase<{
|
|
|
880
880
|
*
|
|
881
881
|
* @internal
|
|
882
882
|
*/
|
|
883
|
-
export declare const JsoncNodeNotFoundErrorBase: new <A extends Record<string, any> = {}>(args:
|
|
883
|
+
export declare const JsoncNodeNotFoundErrorBase: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
884
884
|
readonly _tag: "JsoncNodeNotFoundError";
|
|
885
885
|
} & Readonly<A>;
|
|
886
886
|
|
|
@@ -972,7 +972,7 @@ export declare class JsoncParseError extends JsoncParseErrorBase<{
|
|
|
972
972
|
*
|
|
973
973
|
* @internal
|
|
974
974
|
*/
|
|
975
|
-
export declare const JsoncParseErrorBase: new <A extends Record<string, any> = {}>(args:
|
|
975
|
+
export declare const JsoncParseErrorBase: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
976
976
|
readonly _tag: "JsoncParseError";
|
|
977
977
|
} & Readonly<A>;
|
|
978
978
|
|
|
@@ -1591,7 +1591,7 @@ export declare function makeJsoncFromString(options?: Partial<JsoncParseOptions>
|
|
|
1591
1591
|
*
|
|
1592
1592
|
* @public
|
|
1593
1593
|
*/
|
|
1594
|
-
export declare const makeJsoncSchema: <A, I>(targetSchema: Schema.Schema<A, I
|
|
1594
|
+
export declare const makeJsoncSchema: <A, I>(targetSchema: Schema.Schema<A, I>, options?: Partial<JsoncParseOptions>) => Schema.Schema<A, string>;
|
|
1595
1595
|
|
|
1596
1596
|
/**
|
|
1597
1597
|
* Compute edits to insert, replace, or remove a value at a JSON path.
|
|
@@ -1936,7 +1936,7 @@ export declare const stripComments: {
|
|
|
1936
1936
|
*
|
|
1937
1937
|
* @public
|
|
1938
1938
|
*/
|
|
1939
|
-
export declare const visit: (text: string, options?: Partial<JsoncParseOptions>
|
|
1939
|
+
export declare const visit: (text: string, options?: Partial<JsoncParseOptions>) => Stream.Stream<JsoncVisitorEvent>;
|
|
1940
1940
|
|
|
1941
1941
|
/**
|
|
1942
1942
|
* Visit JSONC text and collect all events matching a type-guard predicate.
|
|
@@ -1978,6 +1978,6 @@ export declare const visit: (text: string, options?: Partial<JsoncParseOptions>
|
|
|
1978
1978
|
*
|
|
1979
1979
|
* @public
|
|
1980
1980
|
*/
|
|
1981
|
-
export declare const visitCollect: <A extends JsoncVisitorEvent>(text: string, predicate: (event: JsoncVisitorEvent) => event is A, options?: Partial<JsoncParseOptions>
|
|
1981
|
+
export declare const visitCollect: <A extends JsoncVisitorEvent>(text: string, predicate: (event: JsoncVisitorEvent) => event is A, options?: Partial<JsoncParseOptions>) => Effect.Effect<ReadonlyArray<A>>;
|
|
1982
1982
|
|
|
1983
1983
|
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsonc-effect",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Pure Effect-TS implementation of a JSONC (JSON with Comments) parser",
|
|
6
6
|
"keywords": [
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"import": "./index.js"
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"
|
|
45
|
-
"effect": "
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"effect": ">=3.21.0"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
48
|
"!jsonc-effect.api.json",
|