@b9g/crank 0.5.0-beta.1 → 0.5.0-beta.3
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/crank.cjs +440 -297
- package/crank.cjs.map +1 -1
- package/crank.d.ts +13 -24
- package/crank.js +440 -297
- package/crank.js.map +1 -1
- package/{index.cjs → mod.cjs} +3 -3
- package/mod.cjs.map +1 -0
- package/mod.d.ts +2 -0
- package/{index.js → mod.js} +3 -3
- package/mod.js.map +1 -0
- package/package.json +18 -18
- package/{xm.cjs → tags.cjs} +8 -8
- package/tags.cjs.map +1 -0
- package/tags.d.ts +2 -0
- package/{xm.js → tags.js} +9 -9
- package/tags.js.map +1 -0
- package/umd.js +440 -297
- package/umd.js.map +1 -1
- package/index.cjs.map +0 -1
- package/index.d.ts +0 -2
- package/index.js.map +0 -1
- package/xm.cjs.map +0 -1
- package/xm.d.ts +0 -2
- package/xm.js.map +0 -1
package/crank.d.ts
CHANGED
|
@@ -220,16 +220,16 @@ declare class Retainer<TNode> {
|
|
|
220
220
|
* The cached child values of this element. Only host and component elements
|
|
221
221
|
* will use this property.
|
|
222
222
|
*/
|
|
223
|
-
|
|
223
|
+
cachedChildValues: ElementValue<TNode>;
|
|
224
224
|
/**
|
|
225
225
|
* The child which this retainer replaces. This property is used when an
|
|
226
226
|
* async retainer tree replaces previously rendered elements, so that the
|
|
227
227
|
* previously rendered elements can remain visible until the async tree
|
|
228
228
|
* fulfills. Will be set to undefined once this subtree fully renders.
|
|
229
229
|
*/
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
fallbackValue: RetainerChild<TNode>;
|
|
231
|
+
inflightValue: Promise<ElementValue<TNode>> | undefined;
|
|
232
|
+
onNextValues: Function | undefined;
|
|
233
233
|
constructor(el: Element);
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
@@ -283,7 +283,7 @@ export interface RendererImpl<TNode, TScope, TRoot extends TNode = TNode, TResul
|
|
|
283
283
|
dispose<TTag extends string | symbol>(tag: TTag, node: TNode, props: TagProps<TTag>): unknown;
|
|
284
284
|
flush(root: TRoot): unknown;
|
|
285
285
|
}
|
|
286
|
-
declare const
|
|
286
|
+
declare const _RendererImpl: unique symbol;
|
|
287
287
|
/**
|
|
288
288
|
* An abstract class which is subclassed to render to different target
|
|
289
289
|
* environments. This class is responsible for kicking off the rendering
|
|
@@ -300,7 +300,7 @@ export declare class Renderer<TNode extends object = object, TScope = unknown, T
|
|
|
300
300
|
* A weakmap which stores element trees by root.
|
|
301
301
|
*/
|
|
302
302
|
cache: WeakMap<object, Retainer<TNode>>;
|
|
303
|
-
[
|
|
303
|
+
[_RendererImpl]: RendererImpl<TNode, TScope, TRoot, TResult>;
|
|
304
304
|
constructor(impl: Partial<RendererImpl<TNode, TScope, TRoot, TResult>>);
|
|
305
305
|
/**
|
|
306
306
|
* Renders an element tree into a specific root.
|
|
@@ -309,7 +309,7 @@ export declare class Renderer<TNode extends object = object, TScope = unknown, T
|
|
|
309
309
|
* used root to delete the previously rendered element tree from the cache.
|
|
310
310
|
* @param root - The node to be rendered into. The renderer will cache
|
|
311
311
|
* element trees per root.
|
|
312
|
-
* @param
|
|
312
|
+
* @param bridge - An optional context that will be the ancestor context of all
|
|
313
313
|
* elements in the tree. Useful for connecting different renderers so that
|
|
314
314
|
* events/provisions properly propagate. The context for a given root must be
|
|
315
315
|
* the same or an error will be thrown.
|
|
@@ -329,7 +329,7 @@ export interface ProvisionMap extends Crank.ProvisionMap {
|
|
|
329
329
|
}
|
|
330
330
|
/**
|
|
331
331
|
* @internal
|
|
332
|
-
* The internal class which holds
|
|
332
|
+
* The internal class which holds context data.
|
|
333
333
|
*/
|
|
334
334
|
declare class ContextImpl<TNode = unknown, TScope = unknown, TRoot extends TNode = TNode, TResult = unknown> {
|
|
335
335
|
/**
|
|
@@ -373,31 +373,20 @@ declare class ContextImpl<TNode = unknown, TScope = unknown, TRoot extends TNode
|
|
|
373
373
|
*/
|
|
374
374
|
iterator: Iterator<Children, Children | void, unknown> | AsyncIterator<Children, Children | void, unknown> | undefined;
|
|
375
375
|
/*** async properties ***/
|
|
376
|
-
/**
|
|
377
|
-
* inflightBlock
|
|
378
|
-
*/
|
|
379
376
|
inflightBlock: Promise<unknown> | undefined;
|
|
380
|
-
/**
|
|
381
|
-
* inflightValue
|
|
382
|
-
*/
|
|
383
377
|
inflightValue: Promise<ElementValue<TNode>> | undefined;
|
|
384
|
-
/**
|
|
385
|
-
* enqueuedBlock
|
|
386
|
-
*/
|
|
387
378
|
enqueuedBlock: Promise<unknown> | undefined;
|
|
388
|
-
/**
|
|
389
|
-
* enqueuedValue
|
|
390
|
-
*/
|
|
391
379
|
enqueuedValue: Promise<ElementValue<TNode>> | undefined;
|
|
392
380
|
/**
|
|
393
|
-
*
|
|
381
|
+
* onProps - A callback used in conjunction with the IsAvailable flag to
|
|
394
382
|
* implement the props async iterator. See the Symbol.asyncIterator method
|
|
395
383
|
* and the resumeCtxIterator function.
|
|
396
384
|
*/
|
|
397
|
-
|
|
385
|
+
onProps: ((props: Record<string, any>) => unknown) | undefined;
|
|
386
|
+
onPropsRequested: Function | undefined;
|
|
398
387
|
constructor(renderer: RendererImpl<TNode, TScope, TRoot, TResult>, root: TRoot | undefined, host: Retainer<TNode>, parent: ContextImpl<TNode, TScope, TRoot, TResult> | undefined, scope: TScope | undefined, ret: Retainer<TNode>);
|
|
399
388
|
}
|
|
400
|
-
declare const
|
|
389
|
+
declare const _ContextImpl: unique symbol;
|
|
401
390
|
/**
|
|
402
391
|
* A class which is instantiated and passed to every component as its this
|
|
403
392
|
* value. Contexts form a tree just like elements and all components in the
|
|
@@ -414,7 +403,7 @@ export declare class Context<TProps = any, TResult = any> implements EventTarget
|
|
|
414
403
|
/**
|
|
415
404
|
* @internal
|
|
416
405
|
*/
|
|
417
|
-
[
|
|
406
|
+
[_ContextImpl]: ContextImpl<unknown, unknown, unknown, TResult>;
|
|
418
407
|
constructor(impl: ContextImpl<unknown, unknown, unknown, TResult>);
|
|
419
408
|
/**
|
|
420
409
|
* The current props of the associated element.
|