Skip to content

Commit e6a1df5

Browse files
committed
Working Rollup configuration
1 parent b963ca6 commit e6a1df5

18 files changed

+1554
-18
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Cache
2+
.rpt2_cache/
3+
14
# Logs
25
logs
36
*.log

dist/BlinkformsClient.d.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NodeSchema, SchemaParserConfigOpt, RootNode, NodeState, FormContext, NodeAny } from "./schemaTypes";
2+
export declare type BlinkformsStateTransformer = (state: NodeState<any>, root: NodeAny) => NodeState<any>;
3+
export declare type BlinkformsContextUpdateHandler = (context: FormContext, source: NodeAny) => void;
4+
export declare type BlinkformsContextTransformer = (fn: (context: FormContext) => FormContext, source: NodeAny) => void;
5+
export default class BlinkformsClient {
6+
tree: RootNode;
7+
state: NodeState<any>;
8+
stateTransformers: Array<BlinkformsStateTransformer>;
9+
contextUpdateHandlers: Array<BlinkformsContextUpdateHandler>;
10+
contextTransformers: Array<BlinkformsContextTransformer>;
11+
rootConfig: SchemaParserConfigOpt;
12+
constructor();
13+
configure(conf: SchemaParserConfigOpt): void;
14+
registerHandlers(handlers: any): void;
15+
handleFormStateUpdate(state: NodeState<any>, root: NodeAny): void;
16+
handleFormContextUpdate(context: FormContext, source: NodeAny): void;
17+
handleFormContextMapping(fn: (context: FormContext) => FormContext, source: NodeAny): void;
18+
render<S extends NodeSchema>(schema: S, options?: SchemaParserConfigOpt): BlinkformsClient;
19+
getTree(): RootNode;
20+
getState(): NodeState<any>;
21+
}

dist/compositeNodes.d.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as React from "react";
2+
import { FormContext, Node, NodeAny, NodeOutputValue, NodeSchema, NodeState } from "./schemaTypes";
3+
export declare type NodeS = {
4+
[key: string]: NodeState<any>;
5+
};
6+
export declare type NodeO = {
7+
[key: string]: NodeOutputValue<any>;
8+
};
9+
export declare type ChildrenMap<T> = {
10+
[key: string]: T;
11+
};
12+
export declare abstract class CompositeNode<O extends object, M extends NodeSchema> extends Node<NodeS, O, M> {
13+
abstract getChildrenMapFromSchema(): ChildrenMap<NodeSchema>;
14+
abstract getCompositeOutput(output: NodeO): NodeOutputValue<O>;
15+
renderComposite(context: FormContext, children: ChildrenMap<React.ReactNode>): React.ReactNode;
16+
resolveInitialState(): {};
17+
getValueMapFromValue(value: NodeOutputValue<O>): NodeOutputValue<O>;
18+
setValue(value: NodeOutputValue<O>): void;
19+
getRawOutput(options: any): O;
20+
onChildStateChanged(state: NodeState<any>, source: NodeAny, originalSource?: NodeAny): void;
21+
resolveChildren(): Node<any, any, any, any, any, any, any, any, any>[];
22+
render(context: FormContext): React.ReactNode;
23+
}

dist/defaultParserConfig.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { SchemaParserConfig } from "./schemaTypes";
2+
export declare const defaultParserConfig: SchemaParserConfig;

dist/index.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export * from "./BlinkformsClient";
2+
export * from "./compositeNodes";
3+
export * from "./simpleNodes";
4+
export * from "./defaultParserConfig";
5+
export * from "./schemaParser";
6+
export * from "./schemaTypes";

0 commit comments

Comments
 (0)