bobe 0.0.71 → 0.0.73
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/bobe.cjs +5 -1
- package/dist/bobe.cjs.map +1 -1
- package/dist/bobe.compiler.cjs +5 -1
- package/dist/bobe.compiler.cjs.map +1 -1
- package/dist/bobe.compiler.esm.js +5 -2
- package/dist/bobe.compiler.esm.js.map +1 -1
- package/dist/bobe.esm.js +5 -2
- package/dist/bobe.esm.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.umd.js +5 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -356,7 +356,10 @@ type ComponentNode$1 = LogicNode & {
|
|
|
356
356
|
type Dep = (() => any) | string;
|
|
357
357
|
type RenderWithMw = {
|
|
358
358
|
use: Mw['use'];
|
|
359
|
-
<T extends typeof Store>(Ctor: T, root: any): [ComponentNode$1, InstanceType<T>];
|
|
359
|
+
<T extends typeof Store>(Ctor: T, root: any, options?: RenderOptions<T>): [ComponentNode$1, InstanceType<T>];
|
|
360
|
+
};
|
|
361
|
+
type RenderOptions<T extends typeof Store> = {
|
|
362
|
+
props?: Partial<Omit<InstanceType<T>, 'ui' | 'parent'>>;
|
|
360
363
|
};
|
|
361
364
|
|
|
362
365
|
declare class Tokenizer {
|
|
@@ -627,5 +630,5 @@ declare const context: IContext;
|
|
|
627
630
|
|
|
628
631
|
declare const effect: (callback: (...args: ValueDiff[]) => void, depOrOpt?: Dep[] | Dep | CustomEffectOpt, opt?: CustomEffectOpt) => aoye.Effect;
|
|
629
632
|
|
|
630
|
-
export { Compiler, FakeType, Mw, MwCtx, NodeType, ParseErrorCode, ParseSyntaxError, Tokenizer, bobe, context, customRender, effect };
|
|
633
|
+
export { Compiler, FakeType, Interpreter, Mw, MwCtx, NodeType, ParseErrorCode, ParseSyntaxError, Tokenizer, bobe, context, customRender, effect };
|
|
631
634
|
export type { ASTNodeType, BaseNode, CommentNode, ComponentNode, ConditionalNode, DynamicValue, ElementNode, FragmentNode, IContext, InterpolationNode, LogicNode, LoopNode, ParseError, Program, Property, PropertyKeyNode, PropertyValue, SourceLocation, StaticValue, TemplateNode, TextNode, UI };
|
package/dist/index.umd.js
CHANGED
|
@@ -2744,8 +2744,11 @@
|
|
|
2744
2744
|
}
|
|
2745
2745
|
function customRender(option) {
|
|
2746
2746
|
const mw = new Mw();
|
|
2747
|
-
function render(Ctor, root) {
|
|
2747
|
+
function render(Ctor, root, options = {}) {
|
|
2748
2748
|
const store = Ctor.new();
|
|
2749
|
+
if (options.props) {
|
|
2750
|
+
Object.assign(store, options.props);
|
|
2751
|
+
}
|
|
2749
2752
|
const tokenizer = store.ui(false);
|
|
2750
2753
|
const terp = new Interpreter(tokenizer);
|
|
2751
2754
|
terp.config(option);
|
|
@@ -2865,6 +2868,7 @@
|
|
|
2865
2868
|
});
|
|
2866
2869
|
exports.Compiler = Compiler;
|
|
2867
2870
|
exports.FakeType = FakeType;
|
|
2871
|
+
exports.Interpreter = Interpreter;
|
|
2868
2872
|
exports.Mw = Mw;
|
|
2869
2873
|
exports.MwCtx = MwCtx;
|
|
2870
2874
|
exports.NodeType = NodeType;
|