Skip to content

Commit 5fe6408

Browse files
committed
Subtree merged in blinkforms/typescript-core
2 parents e74290a + 5ceb5ca commit 5fe6408

22 files changed

+2596
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Cache
2+
.rpt2_cache/
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
*.pid.lock
16+
17+
# Directory for instrumented libs generated by jscoverage/JSCover
18+
lib-cov
19+
20+
# Coverage directory used by tools like istanbul
21+
coverage
22+
23+
# nyc test coverage
24+
.nyc_output
25+
26+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27+
.grunt
28+
29+
# Bower dependency directory (https://bower.io/)
30+
bower_components
31+
32+
# node-waf configuration
33+
.lock-wscript
34+
35+
# Compiled binary addons (https://nodejs.org/api/addons.html)
36+
build/Release
37+
38+
# Dependency directories
39+
node_modules/
40+
jspm_packages/
41+
42+
# TypeScript v1 declaration files
43+
typings/
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
63+
# next.js build output
64+
.next

blinkforms/typescript-core/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Blinkforms
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Blinkforms TS Core
2+
3+
**Project is under heavy development right now. Details will be available in some time in the future**
Lines changed: 21 additions & 0 deletions
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 declare 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+
}
Lines changed: 23 additions & 0 deletions
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+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { SchemaParserConfig } from "./schemaTypes";
2+
export declare const defaultParserConfig: SchemaParserConfig;
Lines changed: 6 additions & 0 deletions
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)