@homedev/fields 1.2.22 → 1.2.23
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/index.d.ts +9 -12
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,13 @@ export declare type FieldProcessorTypedFunc = FieldProcessorFunc | (FieldProcess
|
|
|
47
47
|
fn: FieldProcessorFunc;
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
export declare interface FieldSectionProcessorContext {
|
|
51
|
+
content: string;
|
|
52
|
+
path: string;
|
|
53
|
+
root: Record<string, any>;
|
|
54
|
+
options: ProcessFieldsOptions;
|
|
55
|
+
}
|
|
56
|
+
|
|
50
57
|
export declare const makeFieldProcessor: (fn: SourceFunc, types?: FieldProcessorTypeChecker) => FieldProcessorTypedFunc;
|
|
51
58
|
|
|
52
59
|
export declare const makeFieldProcessorList: <T = unknown>(source: SourceFunc[], options?: {
|
|
@@ -72,18 +79,8 @@ export declare interface ProcessFieldsOptions {
|
|
|
72
79
|
filters?: RegExp[];
|
|
73
80
|
root?: Record<any, any>;
|
|
74
81
|
globalContext?: any;
|
|
75
|
-
onSection?: (section: FieldProcessorSection, context:
|
|
76
|
-
|
|
77
|
-
path: string;
|
|
78
|
-
root: Record<string, any>;
|
|
79
|
-
options: ProcessFieldsOptions;
|
|
80
|
-
}) => Promise<void | boolean | string> | void | boolean | string;
|
|
81
|
-
onSectionConfig?: (section: FieldProcessorSection, context: {
|
|
82
|
-
content: string;
|
|
83
|
-
path: string;
|
|
84
|
-
root: Record<string, any>;
|
|
85
|
-
options: ProcessFieldsOptions;
|
|
86
|
-
}) => Promise<boolean | void> | boolean | void;
|
|
82
|
+
onSection?: (section: FieldProcessorSection, context: FieldSectionProcessorContext) => Promise<void | boolean | string> | void | boolean | string;
|
|
83
|
+
onSectionConfig?: (section: FieldProcessorSection, context: FieldSectionProcessorContext) => Promise<boolean | void> | boolean | void;
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
declare type SourceFunc = (...args: any[]) => any;
|