import { type DoCheck, ElementRef, type OnChanges, type SimpleChanges } from '@angular/core'; import { type IHostInstance, type IStyleProp } from '@symbiote-native/engine'; import * as i0 from "@angular/core"; /** * A composed Angular component (Pressable, SafeAreaView, ScrollView, ...) is created as a * non-painting ANCHOR host (`ANCHOR_HOST_COMPONENTS` in renderer.ts) so it doesn't paint an * extra native view over its own template's real content. `class="..."`/`[class.x]`/`[ngClass]` * at the component's use site ALWAYS resolves through the renderer's addClass/removeClass onto * that anchor — Angular gives no `@Input()` interception hook for `class` the way it does for * `[style]` (which is why `style` alone was declared as an `@Input()` in the first place, see * `SymbiotePrimitiveHost` above) — so the anchor ends up holding the fully-resolved class-derived * style (`routeProp`'s `commitClassStyle` already wrote it to `anchor.props.style`) while the * REAL native node the component's own template creates never sees it. * * Call this from a composed component's own `hostProps`/style getter and merge the result AHEAD * of its own explicit `style` @Input, e.g. `style: [anchorHostStyle(this.elementRef), * this.resolvedStyle]` — array order matters: `flattenStyle`'s later-wins collapse is what makes * an explicit `[style]` on the component still beat its ambient class, mirroring the * class-loses-to-explicit-style cascade `commitClassStyle` already enforces for a direct * primitive. `this.elementRef` must be this component's OWN injected `ElementRef` (its anchor * host), not a `@ViewChild` into its template's inner primitive. * * Skipping this call for a new `ANCHOR_HOST_COMPONENTS` entry compiles clean under `tsc` AND a * real `ngc` AOT build — no type error, no template error — it just silently drops `class="..."` * forever; only a device/simulator render (or a committed-node style assertion) catches it. */ export declare function anchorHostStyle(elementRef: ElementRef): unknown; export declare function anchorStyleProp(elementRef: ElementRef): IStyleProp | undefined; /** * `anchorHostStyle` must be re-read on every check (a bare `class="x"` with no matching * `[style]` binding never appears in Angular's `SimpleChanges`/dirty-check inputs, so nothing * else signals "the anchor's class-derived style may have changed"). But `flattenStyle([...])` * always allocates a FRESH object, even when its content is byte-for-byte identical to last * time — and a windowed list component (FlatList/VirtualizedList/SectionList/ * VirtualizedSectionList) binds its resolved style into a structural-directive-bound `@Input()` * chain where a fresh reference on an UNRELATED CD pass is mistaken for a real change, which * reschedules ANOTHER CD tick (`VListOutletDirective`'s `context` `@Input()` calling * `markForCheck()`) — free-running forever. See the `flat-list-array-style.test.ts` regression * this fixes (and the near-identical `lastRecompute` dedup guard in `virtualized-list/index.ts`, * which this mirrors at the style-merge call site instead of a whole recompute step). Returns * `previous` unchanged when the freshly-flattened merge is shallow-equal to it, so a downstream * `@Input() style` binding sees NO change and skips its own update on an unrelated tick. */ export declare function stableAnchorStyle(elementRef: ElementRef, explicitStyle: unknown, previous: unknown): Record; /** * Restores the OnPush dirty-marking Angular skips for a `[style]` binding that a directive * declares as an input. Attach it to any component declaring a `style` input: * `hostDirectives: [{ directive: SymbioteStyleInputDirective, inputs: ['style'] }]`. * * An ordinary `[foo]` binding compiles to `ɵɵproperty` -> `setPropertyAndInputs`, whose last act * for a component host is `markDirtyIfOnPush` (`render3/instructions/shared.ts`) — the flag * `detectChangesInView` needs before it will re-execute a non-CheckAlways view. `[style]` and * `[class]` do NOT take that path: they compile to the styling instructions, which on finding a * directive input of the same name hand off to `setDirectiveInputsWhichShadowsStyling` * (`render3/instructions/property.ts`) — two lines that write the input and stop. No dirty flag. * The input lands and `ngOnChanges` fires, but the receiving component's own template, and every * getter it reads, is frozen at its creation value. Verified against @angular/core 22.0.8. * * Symbiote sits squarely on that gap: every composed component declares `style` as a real * `@Input()` on purpose, because a raw `[style]` binding would otherwise be decomposed key by key * by Angular's CSS style engine, which cannot represent an RN StyleProp array or an Animated value * (see `SymbiotePrimitiveHost` above). So the one binding name Angular forgets to mark is the one * carrying the whole styling surface. * * `markForCheck()` here is exactly the skipped `markDirtyIfOnPush`, not a bigger hammer: the write * happens inside the parent's refresh, and `markViewDirty` uses the `Dirty` bit alone while views * are refreshing (`render3/instructions/mark_view_dirty.ts`), which the ancestors then clear at the * end of their own `refreshView`. A component that already bridges its inputs into a signal (the * `inputsRevision` + `computed` pattern — Pressable, ScrollView) is immune on its own, since a * signal write dirties the template consumer, which `detectChangesInView` honors in any mode. */ export declare class SymbioteStyleInputDirective implements DoCheck, OnChanges { private readonly cdr; private readonly elementRef; private lastAnchorStyle; style?: unknown; ngOnChanges(): void; ngDoCheck(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Base for all Angular primitive host components (`view`, `text`, ...). * RN's `StyleProp` can be an object, an array, nested arrays, falsy entries, and Animated * values. Angular's raw `[style]` binding on a custom element routes through the CSS style * engine (`setStyle` per key), which crashes on numeric array keys. By declaring `style` as * an Angular `@Input()` on a known component, we intercept it here and forward a flattened * style object through `Renderer2.setProperty`, bypassing Angular's CSS styling path. * * Other props (source, pointerEvents, ...) are intentionally *not* declared as inputs. * Angular then treats them as host property bindings and still dispatches them through the * custom renderer's `setProperty`, so the engine's `routeProp` handles them as usual. */ export declare abstract class SymbiotePrimitiveHost implements DoCheck, OnChanges { private readonly renderer; private readonly elementRef; ngDoCheck(): void; style?: IStyleProp; /** * The underlying engine host node (public instance). Exposed so `findNodeHandle` can resolve * an Angular template ref (`#ref`) on a primitive host to its native reactTag. */ get nativeElement(): IHostInstance; ngOnChanges(changes: SimpleChanges): void; /** * Push one resolved prop onto the host element. `protected` rather than exposing the injected * Renderer2/ElementRef, so a subclass applying its own defaults (TextHost) uses the same single * write path this base already uses for `style`. */ protected setHostProp(key: string, value: unknown): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Applies a whole resolved props record (a shared `renderX(...).props` bag) onto a host * element via `Renderer2.setProperty`, one call per key. Angular templates compile bindings * ahead of time — there is no `v-bind="obj"` equivalent for a custom element — so a component * whose props come from a shared render function would otherwise have to declare every key as * its own static `[prop]="hostProps['x']"` binding. This generalizes the pattern * `SwitchHostPropsDirective` proved first: ``, * with `ref.node` exposing the native element for any imperative follow-up call. */ export declare class SymbioteHostPropsDirective { private readonly renderer; private readonly elementRef; private readonly cdr; private readonly wrapCallback; private registerMarkerAndWrap; private pushed; get node(): unknown; set symbioteHostProps(props: Record); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }