UNPKG

@pmndrs/uikit

Version:

Build performant 3D user interfaces with Three.js and yoga.

53 lines (52 loc) 3.69 kB
import { Signal } from '@preact/signals-core'; import { Group, Material, Mesh, Object3D } from 'three'; import { EventHandlers, Listeners } from '../index.js'; import { ParentContext } from '../context.js'; import { YogaProperties } from '../flex/index.js'; import { OrderInfo, ZIndexProperties } from '../order.js'; import { PanelProperties } from '../panel/instanced-panel.js'; import { WithAllAliases } from '../properties/alias.js'; import { AllOptionalProperties, WithClasses, WithReactive } from '../properties/default.js'; import { ScrollbarProperties } from '../scroll.js'; import { TransformProperties } from '../transform.js'; import { VisibilityProperties, WithConditionals } from './utils.js'; import { PointerEventsProperties } from '../panel/interaction-panel-mesh.js'; import { AppearanceProperties } from './svg.js'; import { PanelGroupProperties } from '../panel/index.js'; import { MergedProperties } from '../properties/index.js'; import { ThreeEventMap } from '../events.js'; export type InheritableIconProperties = WithClasses<WithConditionals<WithAllAliases<WithReactive<YogaProperties & ZIndexProperties & PanelProperties & AppearanceProperties & TransformProperties & PanelGroupProperties & ScrollbarProperties & VisibilityProperties & PointerEventsProperties>>>>; export type IconProperties<EM extends ThreeEventMap = ThreeEventMap> = InheritableIconProperties & Listeners & EventHandlers<EM>; export declare function createIconState<EM extends ThreeEventMap = ThreeEventMap>(parentCtx: ParentContext, text: string, svgWidth: number, svgHeight: number, style: Signal<IconProperties<EM> | undefined>, properties: Signal<IconProperties<EM> | undefined>, defaultProperties: Signal<AllOptionalProperties | undefined>): { node: Signal<import("../internals.js").FlexNode | undefined>; size: Signal<import("three").Vector2Tuple | undefined>; relativeCenter: Signal<import("three").Vector2Tuple | undefined>; borderInset: Signal<import("../internals.js").Inset | undefined>; overflow: Signal<import("yoga-layout/load").Overflow>; displayed: Signal<boolean>; scrollable: Signal<[boolean, boolean]>; paddingInset: Signal<import("../internals.js").Inset | undefined>; maxScrollPosition: Signal<[(number | undefined)?, (number | undefined)?]>; } & { root: import("../context.js").RootContext; hoveredSignal: Signal<number[]>; activeSignal: Signal<number[]>; mergedProperties: import("@preact/signals-core").ReadonlySignal<MergedProperties>; transformMatrix: Signal<import("three").Matrix4 | undefined>; globalMatrix: Signal<import("three").Matrix4 | undefined>; isClipped: Signal<boolean>; isVisible: import("@preact/signals-core").ReadonlySignal<boolean>; groupDeps: import("@preact/signals-core").ReadonlySignal<Required<PanelGroupProperties>>; backgroundOrderInfo: Signal<OrderInfo | undefined>; orderInfo: Signal<OrderInfo | undefined>; handlers: import("@preact/signals-core").ReadonlySignal<EventHandlers>; ancestorsHaveListeners: import("@preact/signals-core").ReadonlySignal<boolean>; text: string; svgWidth: number; svgHeight: number; interactionPanel: Mesh<import("three").PlaneGeometry, Material | Material[], import("three").Object3DEventMap> & { boundingSphere: import("three").Sphere; }; iconGroup: Group<import("three").Object3DEventMap>; }; export declare function setupIcon<EM extends ThreeEventMap = ThreeEventMap>(state: ReturnType<typeof createIconState>, parentCtx: ParentContext, style: Signal<IconProperties<EM> | undefined>, properties: Signal<IconProperties<EM> | undefined>, object: Object3D, abortSignal: AbortSignal): void;