@trustme24/flext 1.0.4 → 1.1.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/dist/errors.d.ts +3 -0
- package/dist/index.cjs +19 -15
- package/dist/index.d.ts +22 -12
- package/dist/index.js +9 -9
- package/dist/lib.d.ts +36 -4
- package/dist/types.d.ts +15 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type
|
|
1
|
+
import { AST } from '@handlebars/parser';
|
|
2
|
+
import { Obj, DataModelNode, Macro } from './types';
|
|
3
|
+
export type FieldType = 'string' | 'number' | 'boolean' | 'date';
|
|
4
|
+
export type Field = {
|
|
4
5
|
name: string;
|
|
5
|
-
|
|
6
|
+
label?: string | null;
|
|
7
|
+
type: FieldType;
|
|
8
|
+
isRequired: boolean;
|
|
6
9
|
};
|
|
7
|
-
export
|
|
10
|
+
export type MetadataModelNode = DataModelNode & {
|
|
11
|
+
label?: string | null;
|
|
12
|
+
type: FieldType;
|
|
13
|
+
isRequired: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const DEFAULT_FIELD_TYPE: FieldType;
|
|
16
|
+
export declare const DEFAULT_MODEL_DEPTH = 10;
|
|
8
17
|
export declare class SimpleFlext {
|
|
9
|
-
|
|
18
|
+
ast: AST.Program;
|
|
10
19
|
data: Obj;
|
|
11
20
|
helpers: Obj;
|
|
12
21
|
constructor(val?: string | null, data?: Obj, helpers?: Obj);
|
|
13
|
-
|
|
22
|
+
setTemplate(val: string): this;
|
|
14
23
|
setData(val: Obj): this;
|
|
15
24
|
setHelpers(val: Obj): this;
|
|
16
25
|
addHelper(name: string, val: any): this;
|
|
@@ -20,13 +29,14 @@ export declare class SimpleFlext {
|
|
|
20
29
|
export declare class Flext extends SimpleFlext {
|
|
21
30
|
version: string;
|
|
22
31
|
lineHeight: number;
|
|
32
|
+
fields: Field[];
|
|
23
33
|
useModule(...val: string[]): this;
|
|
24
|
-
|
|
34
|
+
setTemplate(val: string): this;
|
|
25
35
|
setVersion(val: string): this;
|
|
26
36
|
setLineHeight(val: number): this;
|
|
37
|
+
setFields(val: Field[]): this;
|
|
38
|
+
getDataModel(depth?: number): MetadataModelNode[];
|
|
39
|
+
get model(): Obj;
|
|
27
40
|
}
|
|
28
|
-
export declare function
|
|
29
|
-
export declare class RegexHelper {
|
|
30
|
-
static macro: RegExp;
|
|
31
|
-
}
|
|
41
|
+
export declare function macroToField(val: Macro): Field;
|
|
32
42
|
export default Flext;
|