@tur-ng/std 0.0.2 → 0.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.d.ts +89 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tur-ng/std",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "types": "src/index.d.ts",
6
6
  "files": [
package/src/index.d.ts CHANGED
@@ -639,6 +639,95 @@ declare module "tur:std" {
639
639
  export function lifecycleView(f: () => LifecycleDescriptor): Element;
640
640
  export function ReadableSubscribe(props: ReadableSubscribeProps): Element;
641
641
 
642
+ // ---------------------------------------------------------------------------
643
+ // Visual-effect elements (Opacity / Transform)
644
+ // ---------------------------------------------------------------------------
645
+
646
+ export interface OpacityProps {
647
+ value: Val<number>;
648
+ child?: Element;
649
+ queryKey?: Val<string[]>;
650
+ }
651
+
652
+ export interface TransformProps {
653
+ scale?: Val<number>;
654
+ scaleX?: Val<number>;
655
+ scaleY?: Val<number>;
656
+ rotate?: Val<number>;
657
+ translateX?: Val<number>;
658
+ translateY?: Val<number>;
659
+ /** Pivot for `rotate`/`scale`, within the child box. Defaults to
660
+ * `Alignment.Center` (matches Flutter's `Transform`). */
661
+ alignment?: Val<Alignment>;
662
+ child?: Element;
663
+ queryKey?: Val<string[]>;
664
+ }
665
+
666
+ /** Alpha-mask its child subtree by `value` (0.0..=1.0). */
667
+ export function Opacity(props: OpacityProps): Element;
668
+
669
+ /** Apply a 2D affine rotate/scale/translate to its child subtree. */
670
+ export function Transform(props: TransformProps): Element;
671
+
672
+ // ---------------------------------------------------------------------------
673
+ // CompositedTransformTarget / Follower — Flutter-style anchor linking.
674
+ // A follower renders at a target's global position (tracked continuously
675
+ // through layout / scroll / reactive / transform changes). Create a shared
676
+ // link via `createLayerLink()` and pass it to one target + one follower.
677
+ // Place the follower in a root overlay slot so it isn't clipped and paints
678
+ // on top (the Flutter `Overlay` pattern).
679
+ // ---------------------------------------------------------------------------
680
+
681
+ /** Shared handle connecting one `CompositedTransformTarget` to one
682
+ * `CompositedTransformFollower`. Create via `createLayerLink()`. */
683
+ export interface LayerLink {
684
+ readonly _layerLinkBrand: unique symbol;
685
+ }
686
+
687
+ /** Create a shared `LayerLink` connecting a target and a follower. */
688
+ export function createLayerLink(): LayerLink;
689
+
690
+ export interface CompositedTransformTargetProps {
691
+ /** A link created via `createLayerLink()`, shared with the follower. */
692
+ link: LayerLink;
693
+ child?: Element;
694
+ queryKey?: Val<string[]>;
695
+ }
696
+
697
+ export interface CompositedTransformFollowerProps {
698
+ /** A link created via `createLayerLink()`, shared with the target. */
699
+ link: LayerLink;
700
+ /** Anchor point on the target that the follower aligns to. The
701
+ * follower is translated so its `followerAnchor` lands here in global
702
+ * space. Defaults to `Alignment.TopLeft`. Reactive: pass a `derive`
703
+ * to change it at runtime. */
704
+ targetAnchor?: Val<Alignment>;
705
+ /** Anchor point on this follower that lines up with `targetAnchor`.
706
+ * Defaults to `Alignment.TopLeft`. Reactive. */
707
+ followerAnchor?: Val<Alignment>;
708
+ /** Additional offset (in the target's local coordinate space) applied
709
+ * to `targetAnchor`. Defaults to `{x: 0, y: 0}`. Reactive: pass a
710
+ * `derive` to change it at runtime (e.g. steppers). */
711
+ targetOffset?: Val<{ x: number; y: number }>;
712
+ /** Whether to keep rendering at the follower's layout position when no
713
+ * target is linked. Defaults to `true`. */
714
+ showWhenUnlinked?: boolean;
715
+ child?: Element;
716
+ queryKey?: Val<string[]>;
717
+ }
718
+
719
+ /** Marks a spot in the tree for a `CompositedTransformFollower` to track.
720
+ * A transparent passthrough. */
721
+ export function CompositedTransformTarget(
722
+ props: CompositedTransformTargetProps,
723
+ ): Element;
724
+
725
+ /** Renders at a target's anchor (tracked continuously). Place in a root
726
+ * overlay slot. */
727
+ export function CompositedTransformFollower(
728
+ props: CompositedTransformFollowerProps,
729
+ ): Element;
730
+
642
731
  // ---------------------------------------------------------------------------
643
732
  // Controllers / resources / colors / focus
644
733
  // ---------------------------------------------------------------------------