@valbuild/core 0.13.8 → 0.14.0
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/declarations/src/expr/eval.d.ts +6 -6
- package/dist/declarations/src/expr/index.d.ts +3 -3
- package/dist/declarations/src/expr/parser.d.ts +2 -2
- package/dist/declarations/src/fetchVal.d.ts +2 -2
- package/dist/declarations/src/fp/index.d.ts +3 -3
- package/dist/declarations/src/fp/result.d.ts +1 -1
- package/dist/declarations/src/index.d.ts +23 -22
- package/dist/declarations/src/initSchema.d.ts +25 -25
- package/dist/declarations/src/initVal.d.ts +7 -13
- package/dist/declarations/src/module.d.ts +10 -10
- package/dist/declarations/src/patch/deref.d.ts +3 -3
- package/dist/declarations/src/patch/index.d.ts +6 -6
- package/dist/declarations/src/patch/json.d.ts +2 -2
- package/dist/declarations/src/patch/operation.d.ts +2 -2
- package/dist/declarations/src/patch/ops.d.ts +1 -1
- package/dist/declarations/src/patch/parse.d.ts +3 -3
- package/dist/declarations/src/patch/patch.d.ts +3 -3
- package/dist/declarations/src/patch/util.d.ts +2 -2
- package/dist/declarations/src/schema/array.d.ts +3 -3
- package/dist/declarations/src/schema/boolean.d.ts +2 -2
- package/dist/declarations/src/schema/i18n.d.ts +3 -3
- package/dist/declarations/src/schema/image.d.ts +3 -3
- package/dist/declarations/src/schema/index.d.ts +14 -14
- package/dist/declarations/src/schema/literal.d.ts +2 -2
- package/dist/declarations/src/schema/number.d.ts +2 -2
- package/dist/declarations/src/schema/object.d.ts +3 -3
- package/dist/declarations/src/schema/oneOf.d.ts +5 -5
- package/dist/declarations/src/schema/richtext.d.ts +3 -3
- package/dist/declarations/src/schema/string.d.ts +2 -2
- package/dist/declarations/src/schema/union.d.ts +5 -5
- package/dist/declarations/src/selector/array.d.ts +5 -5
- package/dist/declarations/src/selector/boolean.d.ts +1 -1
- package/dist/declarations/src/selector/file.d.ts +1 -1
- package/dist/declarations/src/selector/i18n.d.ts +3 -3
- package/dist/declarations/src/selector/index.d.ts +17 -17
- package/dist/declarations/src/selector/number.d.ts +1 -1
- package/dist/declarations/src/selector/object.d.ts +2 -2
- package/dist/declarations/src/selector/primitive.d.ts +3 -3
- package/dist/declarations/src/selector/remote.d.ts +2 -2
- package/dist/declarations/src/selector/string.d.ts +1 -1
- package/dist/declarations/src/source/file.d.ts +2 -2
- package/dist/declarations/src/source/i18n.d.ts +2 -2
- package/dist/declarations/src/source/index.d.ts +4 -4
- package/dist/declarations/src/source/remote.d.ts +4 -4
- package/dist/declarations/src/source/richtext.d.ts +2 -2
- package/dist/declarations/src/val/array.d.ts +3 -3
- package/dist/declarations/src/val/index.d.ts +9 -9
- package/dist/declarations/src/val/object.d.ts +3 -3
- package/dist/declarations/src/val/primitive.d.ts +3 -3
- package/dist/{index-296cb2b6.esm.js → index-06df0a5b.esm.js} +1 -1
- package/dist/valbuild-core.cjs.dev.js +140 -144
- package/dist/valbuild-core.cjs.prod.js +140 -144
- package/dist/valbuild-core.esm.js +142 -146
- package/expr/dist/valbuild-core-expr.esm.js +1 -1
- package/package.json +1 -1
- package/src/expr/eval.test.ts +2 -3
- package/src/expr/parser.test.ts +1 -1
- package/src/expr/repl.ts +1 -2
- package/src/index.ts +3 -2
- package/src/initVal.ts +1 -21
- package/src/selector/selector.test.ts +1 -1
- package/dist/declarations/src/expr/tokenizer.d.ts +0 -7
- package/dist/declarations/src/selector/SelectorProxy.d.ts +0 -7
@@ -1,9 +1,9 @@
|
|
1
|
-
import { Expr } from "./expr";
|
2
|
-
import { Source } from "../source";
|
3
|
-
import { result } from "../fp";
|
4
|
-
import { Path, SourceOrExpr } from "../selector";
|
5
|
-
import { SourcePath } from "../val";
|
6
|
-
import { Json } from "../Json";
|
1
|
+
import { Expr } from "./expr.js";
|
2
|
+
import { Source } from "../source/index.js";
|
3
|
+
import { result } from "../fp/index.js";
|
4
|
+
import { Path, SourceOrExpr } from "../selector/index.js";
|
5
|
+
import { SourcePath } from "../val/index.js";
|
6
|
+
import { Json } from "../Json.js";
|
7
7
|
export declare class EvalError {
|
8
8
|
readonly message: string;
|
9
9
|
readonly expr: Expr;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { parse } from "./parser";
|
2
|
-
export { Call, Expr, NilSym, StringLiteral, StringTemplate, Sym } from "./expr";
|
3
|
-
export { evaluate } from "./eval";
|
1
|
+
export { parse } from "./parser.js";
|
2
|
+
export { Call, Expr, NilSym, StringLiteral, StringTemplate, Sym } from "./expr.js";
|
3
|
+
export { evaluate } from "./eval.js";
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { result } from "../fp";
|
2
|
-
import { Expr } from "./expr";
|
1
|
+
import { result } from "../fp/index.js";
|
2
|
+
import { Expr } from "./expr.js";
|
3
3
|
export declare class ParserError {
|
4
4
|
readonly message: string;
|
5
5
|
readonly span?: [number, (number | undefined)?] | undefined;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { GenericSelector, SelectorOf, SelectorSource } from "./selector";
|
2
|
-
import { JsonOfSource, Val } from "./val";
|
1
|
+
import { GenericSelector, SelectorOf, SelectorSource } from "./selector/index.js";
|
2
|
+
import { JsonOfSource, Val } from "./val/index.js";
|
3
3
|
export declare function fetchVal<T extends SelectorSource>(selector: T, locale?: string): SelectorOf<T> extends GenericSelector<infer S> ? Promise<Val<JsonOfSource<S>>> : never;
|
4
4
|
export declare function getVal<T extends SelectorSource>(selector: T, locale?: string): SelectorOf<T> extends GenericSelector<infer S> ? Val<JsonOfSource<S>> : never;
|
5
5
|
export declare function serializedValOfSelectorSource<T extends SelectorSource>(selector: T): any;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export * as result from "./result";
|
2
|
-
export * as array from "./array";
|
3
|
-
export * from "./util";
|
1
|
+
export * as result from "./result.js";
|
2
|
+
export * as array from "./array.js";
|
3
|
+
export * from "./util.js";
|
@@ -1,27 +1,28 @@
|
|
1
|
-
export { initVal } from "./initVal";
|
2
|
-
export type { InitVal } from "./initVal";
|
3
|
-
export { Schema, type SerializedSchema } from "./schema";
|
4
|
-
export type { ValModule, SerializedModule } from "./module";
|
5
|
-
export type { SourceObject, SourcePrimitive, Source } from "./source";
|
6
|
-
export type { FileSource } from "./source/file";
|
7
|
-
export type { RemoteSource } from "./source/remote";
|
8
|
-
export type { RichTextSource, RichText, TextNode, ParagraphNode, HeadingNode, ListItemNode, ListNode, } from "./source/richtext";
|
9
|
-
export { type Val, type SerializedVal, type ModuleId, type ModulePath, type SourcePath, type JsonOfSource, } from "./val";
|
10
|
-
export {
|
11
|
-
export * as expr from "./expr/";
|
12
|
-
export { FILE_REF_PROP } from "./source/file";
|
13
|
-
export { VAL_EXTENSION } from "./source";
|
14
|
-
export {
|
15
|
-
export {
|
16
|
-
|
17
|
-
import {
|
18
|
-
import {
|
19
|
-
import {
|
20
|
-
import {
|
1
|
+
export { initVal } from "./initVal.js";
|
2
|
+
export type { InitVal } from "./initVal.js";
|
3
|
+
export { Schema, type SerializedSchema } from "./schema/index.js";
|
4
|
+
export type { ValModule, SerializedModule } from "./module.js";
|
5
|
+
export type { SourceObject, SourcePrimitive, Source } from "./source/index.js";
|
6
|
+
export type { FileSource } from "./source/file.js";
|
7
|
+
export type { RemoteSource } from "./source/remote.js";
|
8
|
+
export type { RichTextSource, RichText, TextNode, ParagraphNode, HeadingNode, ListItemNode, ListNode, } from "./source/richtext.js";
|
9
|
+
export { type Val, type SerializedVal, type ModuleId, type ModulePath, type SourcePath, type JsonOfSource, } from "./val/index.js";
|
10
|
+
export type { Json, JsonPrimitive } from "./Json.js";
|
11
|
+
export * as expr from "./expr/index.js";
|
12
|
+
export { FILE_REF_PROP } from "./source/file.js";
|
13
|
+
export { VAL_EXTENSION, type SourceArray } from "./source/index.js";
|
14
|
+
export type { I18nSource } from "./source/i18n.js";
|
15
|
+
export { derefPatch } from "./patch/deref.js";
|
16
|
+
export { type SelectorSource, type SelectorOf, GenericSelector, } from "./selector/index.js";
|
17
|
+
import { getVal } from "./fetchVal.js";
|
18
|
+
import { getRawSource, resolvePath, splitModuleIdAndModulePath } from "./module.js";
|
19
|
+
import { getSchema } from "./selector/index.js";
|
20
|
+
import { getValPath, isVal } from "./val/index.js";
|
21
|
+
import { fetchVal } from "./fetchVal.js";
|
21
22
|
declare const Internal: {
|
22
|
-
convertImageSource: (src: import("./source/file").FileSource<import("./schema/image").ImageMetadata>) => {
|
23
|
+
convertImageSource: (src: import("./source/file.js").FileSource<import("./schema/image.js").ImageMetadata>) => {
|
23
24
|
url: string;
|
24
|
-
metadata?: import("./schema/image").ImageMetadata;
|
25
|
+
metadata?: import("./schema/image.js").ImageMetadata;
|
25
26
|
};
|
26
27
|
getSchema: typeof getSchema;
|
27
28
|
getValPath: typeof getValPath;
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { F } from "ts-toolbelt";
|
2
|
-
import { array } from "./schema/array";
|
3
|
-
import { number } from "./schema/number";
|
4
|
-
import { object } from "./schema/object";
|
5
|
-
import { string } from "./schema/string";
|
6
|
-
import { boolean } from "./schema/boolean";
|
7
|
-
import { oneOf } from "./schema/oneOf";
|
8
|
-
import { union } from "./schema/union";
|
9
|
-
import { I18n } from "./schema/i18n";
|
10
|
-
import { richtext } from "./schema/richtext";
|
11
|
-
import { image } from "./schema/image";
|
12
|
-
import { literal } from "./schema/literal";
|
2
|
+
import { array } from "./schema/array.js";
|
3
|
+
import { number } from "./schema/number.js";
|
4
|
+
import { object } from "./schema/object.js";
|
5
|
+
import { string } from "./schema/string.js";
|
6
|
+
import { boolean } from "./schema/boolean.js";
|
7
|
+
import { oneOf } from "./schema/oneOf.js";
|
8
|
+
import { union } from "./schema/union.js";
|
9
|
+
import { I18n } from "./schema/i18n.js";
|
10
|
+
import { richtext } from "./schema/richtext.js";
|
11
|
+
import { image } from "./schema/image.js";
|
12
|
+
import { literal } from "./schema/literal.js";
|
13
13
|
export type InitSchema = {
|
14
14
|
readonly string: typeof string;
|
15
15
|
readonly boolean: typeof boolean;
|
@@ -29,18 +29,18 @@ export declare function initSchema<Locales extends readonly string[]>(locales: F
|
|
29
29
|
string: <T extends string>(options?: {
|
30
30
|
maxLength?: number | undefined;
|
31
31
|
minLength?: number | undefined;
|
32
|
-
} | undefined) => import("./schema").Schema<T>;
|
33
|
-
boolean: () => import("./schema").Schema<boolean>;
|
34
|
-
array: <S extends import("./schema").Schema<import("./selector").SelectorSource>>(schema: S) => import("./schema").Schema<import("./schema").SchemaTypeOf<S>[]>;
|
32
|
+
} | undefined) => import("./schema/index.js").Schema<T>;
|
33
|
+
boolean: () => import("./schema/index.js").Schema<boolean>;
|
34
|
+
array: <S extends import("./schema/index.js").Schema<import("./selector/index.js").SelectorSource>>(schema: S) => import("./schema/index.js").Schema<import("./schema/index.js").SchemaTypeOf<S>[]>;
|
35
35
|
object: <Props extends {
|
36
|
-
[key: string]: import("./schema").Schema<import("./selector").SelectorSource>;
|
37
|
-
}>(schema: Props) => import("./schema").Schema<{ [key in keyof Props]: import("./schema").SchemaTypeOf<Props[key]>; }>;
|
36
|
+
[key: string]: import("./schema/index.js").Schema<import("./selector/index.js").SelectorSource>;
|
37
|
+
}>(schema: Props) => import("./schema/index.js").Schema<{ [key in keyof Props]: import("./schema/index.js").SchemaTypeOf<Props[key]>; }>;
|
38
38
|
number: (options?: {
|
39
39
|
max?: number | undefined;
|
40
40
|
min?: number | undefined;
|
41
|
-
} | undefined) => import("./schema").Schema<number>;
|
42
|
-
union: <Key extends string, T_1 extends import("./schema").Schema<{
|
43
|
-
[x: string]: import("./source").Source;
|
41
|
+
} | undefined) => import("./schema/index.js").Schema<number>;
|
42
|
+
union: <Key extends string, T_1 extends import("./schema/index.js").Schema<{
|
43
|
+
[x: string]: import("./source/index.js").Source;
|
44
44
|
} & {
|
45
45
|
fold?: undefined;
|
46
46
|
andThen?: undefined;
|
@@ -48,10 +48,10 @@ export declare function initSchema<Locales extends readonly string[]>(locales: F
|
|
48
48
|
_type?: undefined;
|
49
49
|
val?: undefined;
|
50
50
|
valPath?: undefined;
|
51
|
-
} & { [k in Key]: string; }>[]>(key: Key, ...objects: T_1) => import("./schema").Schema<T_1 extends import("./schema").Schema<infer S_1 extends import("./selector").SelectorSource>[] ? S_1 extends import("./selector").SelectorSource ? S_1 : never : never>;
|
52
|
-
oneOf: <Src extends import("./selector").GenericSelector<import("./source").SourceArray, undefined> & import("./module").ValModuleBrand>(valModule: Src) => import("./schema").Schema<Src extends import("./selector").GenericSelector<infer S_2 extends import("./source").Source, undefined> ? S_2 extends (infer IS)[] ? IS extends import("./source").Source ? import("./selector").GenericSelector<IS, undefined> : never : never : never>;
|
53
|
-
richtext: () => import("./schema").Schema<import(".").RichTextSource>;
|
54
|
-
image: (options?: import("./schema/image").ImageOptions | undefined) => import("./schema").Schema<import(".").FileSource<import("./schema/image").ImageMetadata>>;
|
55
|
-
literal: <T_2 extends string>(value: T_2) => import("./schema").Schema<T_2>;
|
56
|
-
i18n: <S_3 extends import("./schema").Schema<import("./source/i18n").I18nCompatibleSource>>(schema: S_3) => import("./schema").Schema<import("./
|
51
|
+
} & { [k in Key]: string; }>[]>(key: Key, ...objects: T_1) => import("./schema/index.js").Schema<T_1 extends import("./schema/index.js").Schema<infer S_1 extends import("./selector/index.js").SelectorSource>[] ? S_1 extends import("./selector/index.js").SelectorSource ? S_1 : never : never>;
|
52
|
+
oneOf: <Src extends import("./selector/index.js").GenericSelector<import("./source/index.js").SourceArray, undefined> & import("./module.js").ValModuleBrand>(valModule: Src) => import("./schema/index.js").Schema<Src extends import("./selector/index.js").GenericSelector<infer S_2 extends import("./source/index.js").Source, undefined> ? S_2 extends (infer IS)[] ? IS extends import("./source/index.js").Source ? import("./selector/index.js").GenericSelector<IS, undefined> : never : never : never>;
|
53
|
+
richtext: () => import("./schema/index.js").Schema<import("./index.js").RichTextSource>;
|
54
|
+
image: (options?: import("./schema/image.js").ImageOptions | undefined) => import("./schema/index.js").Schema<import("./index.js").FileSource<import("./schema/image.js").ImageMetadata>>;
|
55
|
+
literal: <T_2 extends string>(value: T_2) => import("./schema/index.js").Schema<T_2>;
|
56
|
+
i18n: <S_3 extends import("./schema/index.js").Schema<import("./source/i18n.js").I18nCompatibleSource>>(schema: S_3) => import("./schema/index.js").Schema<import("./index.js").I18nSource<import("ts-toolbelt/out/Any/Try").Try<Locales, [], (Locales extends [] ? [] : never) | (Locales extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? Locales : never) | { [K in keyof Locales]: Locales[K] extends Function ? Locales[K] : (Locales[K] extends infer T_3 ? T_3 extends Locales[K] ? T_3 extends [] ? [] : never : never : never) | (Locales[K] extends infer T_4 ? T_4 extends Locales[K] ? T_4 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_4 : never : never : never) | (Locales[K] extends infer T_5 ? { [K_1 in keyof T_5]: Locales[K][K_1] extends Function ? Locales[K][K_1] : (Locales[K][K_1] extends infer T_6 ? T_6 extends Locales[K][K_1] ? T_6 extends [] ? [] : never : never : never) | (Locales[K][K_1] extends infer T_7 ? T_7 extends Locales[K][K_1] ? T_7 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_7 : never : never : never) | (Locales[K][K_1] extends infer T_8 ? { [K_2 in keyof T_8]: Locales[K][K_1][K_2] extends Function ? Locales[K][K_1][K_2] : (Locales[K][K_1][K_2] extends infer T_9 ? T_9 extends Locales[K][K_1][K_2] ? T_9 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2] extends infer T_10 ? T_10 extends Locales[K][K_1][K_2] ? T_10 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_10 : never : never : never) | (Locales[K][K_1][K_2] extends infer T_11 ? { [K_3 in keyof T_11]: Locales[K][K_1][K_2][K_3] extends Function ? Locales[K][K_1][K_2][K_3] : (Locales[K][K_1][K_2][K_3] extends infer T_12 ? T_12 extends Locales[K][K_1][K_2][K_3] ? T_12 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3] extends infer T_13 ? T_13 extends Locales[K][K_1][K_2][K_3] ? T_13 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_13 : never : never : never) | (Locales[K][K_1][K_2][K_3] extends infer T_14 ? { [K_4 in keyof T_14]: Locales[K][K_1][K_2][K_3][K_4] extends Function ? Locales[K][K_1][K_2][K_3][K_4] : (Locales[K][K_1][K_2][K_3][K_4] extends infer T_15 ? T_15 extends Locales[K][K_1][K_2][K_3][K_4] ? T_15 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4] extends infer T_16 ? T_16 extends Locales[K][K_1][K_2][K_3][K_4] ? T_16 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_16 : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4] extends infer T_17 ? { [K_5 in keyof T_17]: Locales[K][K_1][K_2][K_3][K_4][K_5] extends Function ? Locales[K][K_1][K_2][K_3][K_4][K_5] : (Locales[K][K_1][K_2][K_3][K_4][K_5] extends infer T_18 ? T_18 extends Locales[K][K_1][K_2][K_3][K_4][K_5] ? T_18 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5] extends infer T_19 ? T_19 extends Locales[K][K_1][K_2][K_3][K_4][K_5] ? T_19 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_19 : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5] extends infer T_20 ? { [K_6 in keyof T_20]: Locales[K][K_1][K_2][K_3][K_4][K_5][K_6] extends Function ? Locales[K][K_1][K_2][K_3][K_4][K_5][K_6] : (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6] extends infer T_21 ? T_21 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6] ? T_21 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6] extends infer T_22 ? T_22 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6] ? T_22 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_22 : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6] extends infer T_23 ? { [K_7 in keyof T_23]: Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends Function ? Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] : (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends infer T_24 ? T_24 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] ? T_24 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends infer T_25 ? T_25 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] ? T_25 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_25 : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7] extends infer T_26 ? { [K_8 in keyof T_26]: Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends Function ? Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] : (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends infer T_27 ? T_27 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] ? T_27 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends infer T_28 ? T_28 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] ? T_28 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_28 : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8] extends infer T_29 ? { [K_9 in keyof T_29]: Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends Function ? Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] : (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends infer T_30 ? T_30 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] ? T_30 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends infer T_31 ? T_31 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] ? T_31 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_31 : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9] extends infer T_32 ? { [K_10 in keyof T_32]: Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] extends Function ? Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] : (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] extends infer T_33 ? T_33 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] ? T_33 extends [] ? [] : never : never : never) | (Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] extends infer T_34 ? T_34 extends Locales[K][K_1][K_2][K_3][K_4][K_5][K_6][K_7][K_8][K_9][K_10] ? T_34 extends import("ts-toolbelt/out/Function/_Internal").Narrowable ? T_34 : never : never : never) | any; } : never); } : never); } : never); } : never); } : never); } : never); } : never); } : never); } : never); } : never); }>, import("./schema/index.js").SchemaTypeOf<S_3>>>;
|
57
57
|
};
|
@@ -1,17 +1,13 @@
|
|
1
|
-
import { content } from "./module";
|
2
|
-
import { I18n } from "./source/i18n";
|
3
|
-
import { InitSchema, InitSchemaLocalized } from "./initSchema";
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import { remote } from "./source/remote";
|
9
|
-
import { file } from "./source/file";
|
10
|
-
import { richtext } from "./source/richtext";
|
1
|
+
import { content } from "./module.js";
|
2
|
+
import { I18n } from "./source/i18n.js";
|
3
|
+
import { InitSchema, InitSchemaLocalized } from "./initSchema.js";
|
4
|
+
import { getValPath as getPath } from "./val/index.js";
|
5
|
+
import { remote } from "./source/remote.js";
|
6
|
+
import { file } from "./source/file.js";
|
7
|
+
import { richtext } from "./source/richtext.js";
|
11
8
|
type ValConstructor = {
|
12
9
|
content: typeof content;
|
13
10
|
getPath: typeof getPath;
|
14
|
-
key: typeof getPath;
|
15
11
|
remote: typeof remote;
|
16
12
|
file: typeof file;
|
17
13
|
richtext: typeof richtext;
|
@@ -22,11 +18,9 @@ export type InitVal<Locales extends readonly string[] | undefined> = [
|
|
22
18
|
val: ValConstructor & {
|
23
19
|
i18n: I18n<Locales>;
|
24
20
|
};
|
25
|
-
fetchVal<T extends SelectorSource>(selector: T, locale: Locales[number]): SelectorOf<T> extends GenericSelector<infer S> ? Promise<Val<JsonOfSource<S>>> : never;
|
26
21
|
s: InitSchema & InitSchemaLocalized<Locales>;
|
27
22
|
} : {
|
28
23
|
val: ValConstructor;
|
29
|
-
fetchVal<T extends SelectorSource>(selector: T): SelectorOf<T> extends GenericSelector<infer S> ? Promise<Val<JsonOfSource<S>>> : never;
|
30
24
|
s: InitSchema;
|
31
25
|
};
|
32
26
|
type NarrowStrings<A> = (A extends [] ? [] : never) | (A extends string ? A : never) | {
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { Schema, SchemaTypeOf, SerializedSchema } from "./schema";
|
2
|
-
import { GenericSelector, SelectorOf, SelectorSource } from "./selector";
|
3
|
-
import { Source } from "./source";
|
4
|
-
import { ModuleId, ModulePath, SourcePath } from "./val";
|
5
|
-
import { Json } from "./Json";
|
6
|
-
import { SerializedRichTextSchema } from "./schema/richtext";
|
7
|
-
import { ImageMetadata, ImageSchema, SerializedImageSchema } from "./schema/image";
|
8
|
-
import { FileSource } from "./source/file";
|
9
|
-
import { RichText } from "./source/richtext";
|
1
|
+
import { Schema, SchemaTypeOf, SerializedSchema } from "./schema/index.js";
|
2
|
+
import { GenericSelector, SelectorOf, SelectorSource } from "./selector/index.js";
|
3
|
+
import { Source } from "./source/index.js";
|
4
|
+
import { ModuleId, ModulePath, SourcePath } from "./val/index.js";
|
5
|
+
import { Json } from "./Json.js";
|
6
|
+
import { SerializedRichTextSchema } from "./schema/richtext.js";
|
7
|
+
import { ImageMetadata, ImageSchema, SerializedImageSchema } from "./schema/image.js";
|
8
|
+
import { FileSource } from "./source/file.js";
|
9
|
+
import { RichText } from "./source/richtext.js";
|
10
10
|
declare const brand: unique symbol;
|
11
11
|
export type ValModule<T extends SelectorSource> = SelectorOf<T> & ValModuleBrand;
|
12
12
|
export type ValModuleBrand = {
|
@@ -23,7 +23,7 @@ export declare function resolvePath(path: ModulePath, valModule: ValModule<Selec
|
|
23
23
|
source: any;
|
24
24
|
} | {
|
25
25
|
path: string;
|
26
|
-
schema: SerializedRichTextSchema | Schema<RichText<"h1" | "h2" | "h3" | "h4" | "h5" | "h6", import("./source/richtext").TextNode>>;
|
26
|
+
schema: SerializedRichTextSchema | Schema<RichText<"h1" | "h2" | "h3" | "h4" | "h5" | "h6", import("./source/richtext.js").TextNode>>;
|
27
27
|
source: any;
|
28
28
|
} | {
|
29
29
|
path: ModulePath;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { result } from "../fp";
|
2
|
-
import { Ops, PatchError } from "./ops";
|
3
|
-
import { Patch } from "./patch";
|
1
|
+
import { result } from "../fp/index.js";
|
2
|
+
import { Ops, PatchError } from "./ops.js";
|
3
|
+
import { Patch } from "./patch.js";
|
4
4
|
export type DerefPatchResult = {
|
5
5
|
dereferencedPatch: Patch;
|
6
6
|
fileUpdates: {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export { JSONOps } from "./json";
|
2
|
-
export { type OperationJSON, type Operation } from "./operation";
|
3
|
-
export { parsePatch, parseJSONPointer, formatJSONPointer } from "./parse";
|
4
|
-
export { type JSONValue, type Ops, PatchError } from "./ops";
|
5
|
-
export { type PatchJSON, type Patch, applyPatch } from "./patch";
|
6
|
-
export { isNotRoot, deepEqual, deepClone, parseAndValidateArrayIndex, } from "./util";
|
1
|
+
export { JSONOps } from "./json.js";
|
2
|
+
export { type OperationJSON, type Operation } from "./operation.js";
|
3
|
+
export { parsePatch, parseJSONPointer, formatJSONPointer } from "./parse.js";
|
4
|
+
export { type JSONValue, type Ops, PatchError } from "./ops.js";
|
5
|
+
export { type PatchJSON, type Patch, applyPatch } from "./patch.js";
|
6
|
+
export { isNotRoot, deepEqual, deepClone, parseAndValidateArrayIndex, } from "./util.js";
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { result, array } from "../fp/";
|
2
|
-
import { JSONValue, Ops, PatchError } from "./ops";
|
1
|
+
import { result, array } from "../fp/index.js";
|
2
|
+
import { JSONValue, Ops, PatchError } from "./ops.js";
|
3
3
|
export declare class JSONOps implements Ops<JSONValue, never> {
|
4
4
|
get(document: JSONValue, path: string[]): result.Result<JSONValue, PatchError>;
|
5
5
|
add(document: JSONValue, path: string[], value: JSONValue): result.Result<JSONValue, PatchError>;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { array, result } from "../fp";
|
2
|
-
import { Operation, OperationJSON } from "./operation";
|
3
|
-
import { Patch, PatchJSON } from "./patch";
|
1
|
+
import { array, result } from "../fp/index.js";
|
2
|
+
import { Operation, OperationJSON } from "./operation.js";
|
3
|
+
import { Patch, PatchJSON } from "./patch.js";
|
4
4
|
export declare function parseJSONPointer(pointer: string): result.Result<string[], string>;
|
5
5
|
export declare function formatJSONPointerReferenceToken(key: string): string;
|
6
6
|
export declare function formatJSONPointer(path: string[]): string;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { result } from "../fp";
|
2
|
-
import { Ops, PatchError } from "./ops";
|
3
|
-
import { Operation, OperationJSON } from "./operation";
|
1
|
+
import { result } from "../fp/index.js";
|
2
|
+
import { Ops, PatchError } from "./ops.js";
|
3
|
+
import { Operation, OperationJSON } from "./operation.js";
|
4
4
|
export type Patch = Operation[];
|
5
5
|
export type PatchJSON = OperationJSON[];
|
6
6
|
export declare function applyPatch<T, E>(document: T, ops: Ops<T, E>, patch: Operation[]): result.Result<T, E | PatchError>;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { array, result } from "../fp";
|
2
|
-
import { PatchError, ReadonlyJSONValue, ToMutable } from "./ops";
|
1
|
+
import { array, result } from "../fp/index.js";
|
2
|
+
import { PatchError, ReadonlyJSONValue, ToMutable } from "./ops.js";
|
3
3
|
export declare function isNotRoot(path: string[]): path is array.NonEmptyArray<string>;
|
4
4
|
export declare function deepEqual(a: ReadonlyJSONValue, b: ReadonlyJSONValue): boolean;
|
5
5
|
export declare function deepClone<T extends ReadonlyJSONValue>(value: T): ToMutable<T>;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Schema, SchemaTypeOf, SerializedSchema } from ".";
|
2
|
-
import { SelectorSource } from "../selector";
|
3
|
-
import { SourcePath } from "../val";
|
1
|
+
import { Schema, SchemaTypeOf, SerializedSchema } from "./index.js";
|
2
|
+
import { SelectorSource } from "../selector/index.js";
|
3
|
+
import { SourcePath } from "../val/index.js";
|
4
4
|
export type SerializedArraySchema = {
|
5
5
|
type: "array";
|
6
6
|
item: SerializedSchema;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Schema, SchemaTypeOf, SerializedSchema } from ".";
|
2
|
-
import { I18nCompatibleSource, I18nSource } from "../source/i18n";
|
3
|
-
import { SourcePath } from "../val";
|
1
|
+
import { Schema, SchemaTypeOf, SerializedSchema } from "./index.js";
|
2
|
+
import { I18nCompatibleSource, I18nSource } from "../source/i18n.js";
|
3
|
+
import { SourcePath } from "../val/index.js";
|
4
4
|
export type SerializedI18nSchema = {
|
5
5
|
type: "i18n";
|
6
6
|
locales: readonly string[];
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Schema, SerializedSchema } from ".";
|
2
|
-
import { FileSource } from "../source/file";
|
3
|
-
import { SourcePath } from "../val";
|
1
|
+
import { Schema, SerializedSchema } from "./index.js";
|
2
|
+
import { FileSource } from "../source/file.js";
|
3
|
+
import { SourcePath } from "../val/index.js";
|
4
4
|
export type ImageOptions = {
|
5
5
|
ext: ["jpg"] | ["webp"];
|
6
6
|
directory?: string;
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import { SelectorSource } from "../selector";
|
2
|
-
import { RemoteCompatibleSource, RemoteSource } from "../source/remote";
|
3
|
-
import { SourcePath } from "../val";
|
4
|
-
import { SerializedArraySchema } from "./array";
|
5
|
-
import { SerializedBooleanSchema } from "./boolean";
|
6
|
-
import { SerializedI18nSchema } from "./i18n";
|
7
|
-
import { SerializedImageSchema } from "./image";
|
8
|
-
import { SerializedLiteralSchema } from "./literal";
|
9
|
-
import { SerializedNumberSchema } from "./number";
|
10
|
-
import { SerializedObjectSchema } from "./object";
|
11
|
-
import { SerializedOneOfSchema } from "./oneOf";
|
12
|
-
import { SerializedRichTextSchema } from "./richtext";
|
13
|
-
import { SerializedStringSchema } from "./string";
|
14
|
-
import { SerializedUnionSchema } from "./union";
|
1
|
+
import { SelectorSource } from "../selector/index.js";
|
2
|
+
import { RemoteCompatibleSource, RemoteSource } from "../source/remote.js";
|
3
|
+
import { SourcePath } from "../val/index.js";
|
4
|
+
import { SerializedArraySchema } from "./array.js";
|
5
|
+
import { SerializedBooleanSchema } from "./boolean.js";
|
6
|
+
import { SerializedI18nSchema } from "./i18n.js";
|
7
|
+
import { SerializedImageSchema } from "./image.js";
|
8
|
+
import { SerializedLiteralSchema } from "./literal.js";
|
9
|
+
import { SerializedNumberSchema } from "./number.js";
|
10
|
+
import { SerializedObjectSchema } from "./object.js";
|
11
|
+
import { SerializedOneOfSchema } from "./oneOf.js";
|
12
|
+
import { SerializedRichTextSchema } from "./richtext.js";
|
13
|
+
import { SerializedStringSchema } from "./string.js";
|
14
|
+
import { SerializedUnionSchema } from "./union.js";
|
15
15
|
export type SerializedSchema = SerializedStringSchema | SerializedLiteralSchema | SerializedBooleanSchema | SerializedNumberSchema | SerializedObjectSchema | SerializedOneOfSchema | SerializedArraySchema | SerializedUnionSchema | SerializedRichTextSchema | SerializedImageSchema | SerializedI18nSchema;
|
16
16
|
export declare abstract class Schema<Src extends SelectorSource> {
|
17
17
|
abstract validate(src: Src): false | Record<SourcePath, string[]>;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Schema, SchemaTypeOf, SerializedSchema } from ".";
|
2
|
-
import { SelectorSource } from "../selector";
|
3
|
-
import { SourcePath } from "../val";
|
1
|
+
import { Schema, SchemaTypeOf, SerializedSchema } from "./index.js";
|
2
|
+
import { SelectorSource } from "../selector/index.js";
|
3
|
+
import { SourcePath } from "../val/index.js";
|
4
4
|
export type SerializedObjectSchema = {
|
5
5
|
type: "object";
|
6
6
|
items: Record<string, SerializedSchema>;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { Schema, SerializedSchema } from ".";
|
2
|
-
import { ValModuleBrand } from "../module";
|
3
|
-
import { GenericSelector } from "../selector";
|
4
|
-
import { Source, SourceArray } from "../source";
|
5
|
-
import { SourcePath } from "../val";
|
1
|
+
import { Schema, SerializedSchema } from "./index.js";
|
2
|
+
import { ValModuleBrand } from "../module.js";
|
3
|
+
import { GenericSelector } from "../selector/index.js";
|
4
|
+
import { Source, SourceArray } from "../source/index.js";
|
5
|
+
import { SourcePath } from "../val/index.js";
|
6
6
|
export type SerializedOneOfSchema = {
|
7
7
|
type: "oneOf";
|
8
8
|
selector: SourcePath;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Schema, SerializedSchema } from ".";
|
2
|
-
import { RichTextSource } from "../source/richtext";
|
3
|
-
import { SourcePath } from "../val";
|
1
|
+
import { Schema, SerializedSchema } from "./index.js";
|
2
|
+
import { RichTextSource } from "../source/richtext.js";
|
3
|
+
import { SourcePath } from "../val/index.js";
|
4
4
|
export type SerializedRichTextSchema = {
|
5
5
|
type: "richtext";
|
6
6
|
opt: boolean;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Schema, SerializedSchema } from ".";
|
2
|
-
import { SelectorSource } from "../selector";
|
3
|
-
import { SourceObject } from "../source";
|
4
|
-
import { SourcePath } from "../val";
|
1
|
+
import { Schema, SerializedSchema } from "./index.js";
|
2
|
+
import { SelectorSource } from "../selector/index.js";
|
3
|
+
import { SourceObject } from "../source/index.js";
|
4
|
+
import { SourcePath } from "../val/index.js";
|
5
5
|
export type SerializedUnionSchema = {
|
6
6
|
type: "union";
|
7
7
|
key: string;
|
@@ -24,7 +24,7 @@ export declare class UnionSchema<Key extends string, T extends Schema<SourceObje
|
|
24
24
|
constructor(key: Key, items: T, opt?: boolean);
|
25
25
|
}
|
26
26
|
export declare const union: <Key extends string, T extends Schema<{
|
27
|
-
[x: string]: import("../source").Source;
|
27
|
+
[x: string]: import("../source/index.js").Source;
|
28
28
|
} & {
|
29
29
|
fold?: undefined;
|
30
30
|
andThen?: undefined;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { Selector as UnknownSelector, GenericSelector, SelectorOf, SelectorSource } from ".";
|
2
|
-
import { Schema } from "../schema";
|
3
|
-
import { Source, SourceArray } from "../source";
|
4
|
-
import { Selector as BooleanSelector } from "./boolean";
|
5
|
-
import { Selector as NumberSelector } from "./number";
|
1
|
+
import { Selector as UnknownSelector, GenericSelector, SelectorOf, SelectorSource } from "./index.js";
|
2
|
+
import { Schema } from "../schema/index.js";
|
3
|
+
import { Source, SourceArray } from "../source/index.js";
|
4
|
+
import { Selector as BooleanSelector } from "./boolean.js";
|
5
|
+
import { Selector as NumberSelector } from "./number.js";
|
6
6
|
export type UndistributedSourceArray<T extends SourceArray> = [T] extends [
|
7
7
|
infer U
|
8
8
|
] ? U extends Source[] ? Selector<U> : never : never;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Selector as PrimitiveSelector } from "./primitive";
|
1
|
+
import { Selector as PrimitiveSelector } from "./primitive.js";
|
2
2
|
export type Selector<T extends boolean> = PrimitiveSelector<T>;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { SourceArray, SourceObject, SourcePrimitive } from "../source";
|
2
|
-
import { Selector as UnknownSelector } from ".";
|
3
|
-
import { FileSource } from "../source/file";
|
1
|
+
import { SourceArray, SourceObject, SourcePrimitive } from "../source/index.js";
|
2
|
+
import { Selector as UnknownSelector } from "./index.js";
|
3
|
+
import { FileSource } from "../source/file.js";
|
4
4
|
declare const brand: unique symbol;
|
5
5
|
export type I18nSelector<Locales extends readonly string[], T extends SourcePrimitive | SourceObject | SourceArray | FileSource> = UnknownSelector<T> & {
|
6
6
|
readonly [brand]: "I18nSelector";
|