@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Interface UnsafeKaylaFiber

    interface UnsafeKaylaFiber {
        state: KaylaState<any>[];
        refs: KaylaRef<unknown>[];
        global: GlobalKayla;
        callProps: FCProps;
        scene: KaylaInternals.KaylaScene;
        exports: KaylaExports<Exports>;
        detectedParent?: KaylaFiber<any, any>;
        contextInfo?: { instance: KaylaContext<any>; value: unknown };
        lastLayer?: KaylaLayerInfo;
        get childrenCount(): number;
        maxSafeChildren: number;
        dynamicChildren: KaylaElement<any>[];
        getCorrectMousePos(pos?: Vector2): Vector2;
        getChildrenEntities(): KaylaRectEntity[];
        pointerHook(
            pos: Vector2,
            type: KaylaClickType,
            action: KaylaPointerAction,
        ): void;
        resizeHook(__namedParameters: { width: number; height: number }): void;
        bindEvents(): void;
        unbindEvents(): void;
        get key(): string;
        set key(s: string): void;
        get children(): KaylaElement<any>[];
        set children(s: KaylaElement<any>[]): void;
        entity?: KaylaRectEntity;
        onExport: () => KaylaExports<Exports>;
        onEffect: (() => void | (() => void))[];
        onViewportEffect: (
            (
                renderer: KaylaInternals.KaylaRenderer,
                width: number,
                height: number,
            ) => void
        )[];
        onGlobalPointer: {
            handler: (
                pos: Vector2,
                type: KaylaClickType,
                action: KaylaPointerAction,
            ) => void;
            config: KaylaClickConfig;
        }[];
        onInits: (() => void | (() => void))[];
        onUnInits: (() => void | (() => void))[];
        onUnEffect: (() => void)[];
        onEffectDeps?: KaylaState<any>[];
        onPaint: ((ctx: CanvasRenderingContext2D, event: KaylaEvent) => void)[];
        onTick: ((deltaS: number, event: KaylaEvent) => void)[];
        onTickSubsteps: KaylaInternals.KaylaSubstepper[];
        fc?: FC<any>;
        useStateCallIndex: number;
        useEffectCallIndex: number;
        useGlobalClickCallIndex: number;
        useDrawCallIndex: number;
        useStepCallIndex: number;
        useRefCallIndex: number;
        useInitCallIndex: number;
        useViewCallIndex: number;
        lastStateDeps: { stateRef: KaylaState<any>; stamp: number }[];
        watchedDeps?: KaylaState<any>[];
        lastDepStamps: number[];
        getAttachedRenderer(): KaylaInternals.KaylaRenderer;
        getAttachedGame(): KaylaInternals.KaylaGame;
        setMaxChildren(max: number): void;
        getMaxChildren(): number;
        getFiberChain(): UnsafeKaylaFiber[];
        getAllChildrenNestedFlattened(): UnsafeKaylaFiber[];
        getContextChain(): { instance: KaylaContext<any>; value: unknown }[];
        findContextValueFromInst(inst: KaylaContext<any>): unknown;
        getEntityChain(): KaylaRectEntity[];
        shouldFullRefresh(): boolean;
        captureDepStamps(): void;
        refresh(): void;
        updateChildren(
            fcChildren: KaylaElement<any>[],
            isRefreshCall: boolean,
        ): void;
        toString(): string;
        lastChildren: KaylaFiber<any, Record<string, KaylaExportables>>[];
        isFirstUse: boolean;
        use(): void;
        unuse(): void;
        getStringRepresentation(level?: number, pad?: string): string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    state: KaylaState<any>[]
    refs: KaylaRef<unknown>[]
    global: GlobalKayla
    callProps: FCProps
    detectedParent?: KaylaFiber<any, any>
    contextInfo?: { instance: KaylaContext<any>; value: unknown }
    lastLayer?: KaylaLayerInfo
    maxSafeChildren: number

    Advisory maximum number of direct children allowed before warning or enforcement. Default: 40.

    Can be changed via setMaxChildren().

    Enforcement is soft by default (logs warning + removes excess oldest children). Set to Infinity to disable limit.

    dynamicChildren: KaylaElement<any>[]
    onExport: () => KaylaExports<Exports> = ...
    onEffect: (() => void | (() => void))[]
    onViewportEffect: (
        (
            renderer: KaylaInternals.KaylaRenderer,
            width: number,
            height: number,
        ) => void
    )[]
    onGlobalPointer: {
        handler: (
            pos: Vector2,
            type: KaylaClickType,
            action: KaylaPointerAction,
        ) => void;
        config: KaylaClickConfig;
    }[]
    onInits: (() => void | (() => void))[]
    onUnInits: (() => void | (() => void))[]
    onUnEffect: (() => void)[]
    onEffectDeps?: KaylaState<any>[]
    onPaint: ((ctx: CanvasRenderingContext2D, event: KaylaEvent) => void)[]
    onTick: ((deltaS: number, event: KaylaEvent) => void)[]
    fc?: FC<any>
    useStateCallIndex: number = 0
    useEffectCallIndex: number = 0
    useGlobalClickCallIndex: number = 0
    useDrawCallIndex: number = 0
    useStepCallIndex: number = 0
    useRefCallIndex: number = 0
    useInitCallIndex: number = 0
    useViewCallIndex: number = 0
    lastStateDeps: { stateRef: KaylaState<any>; stamp: number }[]
    watchedDeps?: KaylaState<any>[]
    lastDepStamps: number[] = []
    lastChildren: KaylaFiber<any, Record<string, KaylaExportables>>[]
    isFirstUse: boolean = true

    Accessors

    • get childrenCount(): number

      Current number of direct child fibers (readonly). Reflects the length of lastChildren after the last reconciliation.

      Returns number

    • get key(): string

      Returns the key of the fiber.

      Returns string

    • set key(s: string): void

      Returns the key of the fiber.

      Parameters

      • s: string

      Returns void

    Methods

    • Sets the maximum allowed number of direct children for this fiber.

      If current child count exceeds the new limit, excess oldest children are immediately unmounted.

      Parameters

      • max: number

        New maximum (must be >= 0). Use Infinity to remove limit.

      Returns void